%%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 %%%%%%%%%%%%%%%%%%%%
Question 5: Find the exact solutions in the time domain using dsolve. Recall the matrix representation for our two-vess...
Question 7: Solve the entire problem using Laplace Transforms. Recall the DE for our two-vessel water clock ах - Ax, where A dt k(0)= DE IC: -1] Let X(s) denote the Laplace transform of x(t). Then x(s) = (sl-A)-1 (0) There is no forcing term, so this is just the zero-input or homogeneous solution. Solve for X(s) and record your answer in the answer template. The first component has been given for you Question 7: The solution in the transform...
Question 8: Integrating the Flows We saw earlier, that the situation is clearer if we plot the cumulative outflows fi (t) and f2(t), where: f1(t) = So yı(t) dt f2(t) = M(t) dt and Now recall identity #32 in our Table of Laplace transforms for the transform of an integral Integration in the time domain is simply division by s in the transform domain If the transform off(t) is F (s), then the transform of its integral (from 0 to...