Reza Malek-Madani

Phase Plane

This program plots the phase portrait of the
system of differential equations
x' = -x + 2 y, y' = -2 x - 3 y,
using the initial positions 
(1, 1), (1, -1), (2, 2), and (3, 4) 
for the duration 0 < t < 3.

Here is the program:

tfinal = 3;
data={{1,1}, {1, -1}, {2,2}, {3,4}};
eqns={x'[t]== -x[t]+2 y[t], y'[t]==-2x[t]- 3 y[t]};
(* *)
sol = Table[NDSolve[Flatten[{eqns, 
x[0] == data[[i,1]],
y[0] == data[[i,2]]}],
{x, y}, {t, 0, tfinal}], 
{i, 1, Length[data]}];
soll1 = Flatten[sol, 1];
output1 = ParametricPlot[Evaluate[{x[t], y[t]} /. soll1], {t, 0, tfinal},
DisplayFunction->Identity];
OutPut = Show[output1,DisplayFunction->$DisplayFunction];

Here is the output:

[Graphics:phaseplanegr2.gif][Graphics:phaseplanegr1.gif]
go to Top