Sets of differential equations

`ode23`

and `ode45`

can also be applied for sets of differential equations. For example, consider the set of differential equations
(5.6) | ||

The initial values

With the commands

`ode23`

and `ode45`

this type of differential equations can be tackled. To start, we write the function file `deq.m' in the `MATLAB Editor/Debugger', with the contents:
function xdot = deq(t,x) xdot = [5*x(1)-2*x(2);7*x(1)-4*x(2)];Note, that

`>> [t,x] = ode23('deq',[0,1],[2,8])`

now calculates on the time interval [0,1] the values of

`>> plot(t,x)`

Since

`>> ode23('deq',[0,1],[2,8])`

the graphs of

`odeplot`

is used. Note that you could also have written the file `deq.m' in the following way:
function xdot = deq(t,x) A = [5,-2;7,-4]; x = [x(1);x(2)]; xdot = A*x;

Esteur 2010-03-22