Monday, January 14, 2008

The solution to a system of two, first order linear differential equations is given by:
To draw this solution one can use the code for Matlab or Octave 3 provided below:
function plotDiff2D()
%p. 351, eg. 1
t=[-2:0.1:2];
cT=[-2:.5:2];

for c1=cT
for c2=cT
x1=c1*exp(3*t)+c2*exp(-t);
x2=c1*2*exp(3*t)-2*c2*exp(-t);
lineS='b-';
if c1==0 || c2==0, lineS='r-'; end
hold on; plot3(x1,x2,t,lineS);
end
end
limm=6
xlim([-limm limm]);ylim([-limm limm]);
%axis square
xlabel('x1');
ylabel('x2');
zlabel('t');
grid on;

And this script produces graphs of solution in 2D (x1,x2) and 3D (x1,x2,t):



So it is seen from these graphs that solutions of systems of two first order differential equations are very interesting, and not necessarily easy to interpret.

1 comment: