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; |
i.e. some stuff and junk about Python, Perl, Matlab, Ruby, Mac X, Linux, Solaris, ...
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:
And this script produces graphs of solution in 2D (x1,x2) and 3D (x1,x2,t):
Labels:
MATLAB