Given the following linear system of differential equations
$u'(t) = 6u(t)+9v(t)+15w(t)$
$v'(t)=-5u(t)-10v(t)-21w(t)$
$w'(t)=2u(t)+5v(t)+11w(t)$
with the initial conditions $u(0)=1, v(0)=2, w(0)=3$
Solve the system with matlab
.
First question asks to code a function that takes input t and outputs $x(t)=[u(t),v(t),w(t)]$, if this is needed to answer the question then comment asking for it.
(b) For plotting the three solution components on $I = [0,1]$, use a vector times that subdivides $I$ into 100 sub intervals. Build the corresponding vector values of the solution components (each time slot holding three components) by the commands arrayfun
and cell2mat
. Plot the three curves in a single frame.
(c) Write a function solvesys
that takes the coefficient matrix $A$ as well as the initial vector $\vec{x}(0)$ as input parameters and creates the plot of the three solution components on [0,1] as before. Check that it leads to the same result for the above system and then use it on the $30 \times 30$ Hilbert matrix $A$ with initial vector $\vec{x}(0)=(1,\ldots,30)$.
I have a slight understanding that for plotting $x,y,z$ graphs i need to create a 'meshgrid' although i do not know what values i am to use, or how to apply that to my question. I further don't understand the subdividing $I$ to build corresponding vector values.