Question

Question 5: Find the exact solutions in the time domain using dsolve. Recall the matrix representation for our two-vessel watQuestion 6: Cumulative Outflows Lets now focus on the col Let fi(t) and f2(t) be the cumulative outflows from time 0 to time

Question 5: Find the exact solutions in the time domain using dsolve. Recall the matrix representation for our two-vessel water clock is: d又 -=Ax, where A= DE: Hint: Start with the code below. Then enter A, x0, and the DE. Use dsolve. syms yl (t) y2 (t) Use dot notation to access the components of the solution Question 5: Record your solution for the two unknowns y1(t) and y2(t). The first is given for you y2 (t) = y, (t) = e-t, Answer:
Question 6: Cumulative Outflows Let's now focus on the col Let fi(t) and f2(t) be the cumulative outflows from time 0 to time t, for each vessel. Because of the identity: and the total outflows from each vessel Qi = 1 , y(t) these integrated outflows are just: ) ) dt and fa(t) 2() dt Evaluate each integral using MATLAB's int command, then create a simultaneous plot of the three quantities: Hideal (t) = t, fi (t) and f2 (t) = H(t). The plot is given for free. Question 6: Record your answers for the cumulative outflows. The first is given for free. f1 (t) = 1-e-t, f, (t) = Answer:
0 0
Add a comment Improve this question Transcribed image text
Answer #1


%%Matlab code for solving set of eqa tions using dsolve clear all close all Answering question 5. Solving system of equation

%%Matlab code for solving set of eqations using dsolve
clear all
close all
%Answering question 5.
%Solving system of equation using dsolve

syms y1(t) y2(t)
eqns = [diff(y1,t)==-y1, diff(y2,t)==y1-y2];
cond = [y1(0)==1, y2(0)==1];

[y1Sol(t),y2Sol(t)] = dsolve(eqns,cond);
%printing the result
fprintf('Solution using dsolve\n');

fprintf('y1(t)=')
disp(y1Sol)

fprintf('y2(t)=')
disp(y2Sol)

%%Answering question 6.
%calculating cumulative outflow
y1_int=int(y1Sol,t,[0 t]);
y2_int=int(y2Sol,t,[0 t]);

%printing the result
fprintf('Solution using int\n');

fprintf('f1(t)=')
disp(y1_int)

fprintf('f2(t)=')
disp(y2_int)

%%%%%%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%%%%%%%%

Add a comment
Know the answer?
Add Answer to:
Question 5: Find the exact solutions in the time domain using dsolve. Recall the matrix representation for our two-vess...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT