Phase Portrait for Linear Systemrestart:
with(plots):
with(DEtools):Define the differential equation using parameters:a:=1:b:=3:c:=3:d:=1:
LinDE := [diff(x(t),t) = a*x(t)+b*y(t),
diff(y(t),t) = c*x(t)+d*y(t)];Plot the phase portrait using Runge-Kutta method; the initial conditions are given in the first line and can be changed.IC1:=[[x(0)=-2,y(0)=2],[x(0)=2,y(0)=-2],[x(0)=0.01,y(0)=0.01],
[x(0)=-0.01,y(0)=-0.01],[x(0)=-1.9,y(0)=2],[x(0)=1.9,y(0)=-2],
[x(0)=-2,y(0)=1.9],[x(0)=2,y(0)=-1.9]];DEplot(LinDE, [x(t),y(t)], t=-1.7..1.8,
IC1,linecolour=BLUE, x=-2..2, y=-2..2, stepsize=0.1,
arrows=NONE, method=classical[rk4],scene=[x,y]);You could try changing the parameters in the equation to get different examles. Plot x versus tIC2:=[[x(0)=2,y(0)=-2]];DEplot(LinDE, [x(t),y(t)], t=0..1.7,
IC2,linecolour=BLUE, x=-1..2, y=-2..2, stepsize=0.1,
arrows=NONE, method=classical[rk4],scene=[t,x]);