Example with
> A := matrix( [ [ 2, 1 ], [ -1, 4 ] ] );
>
> charpoly( A, lambda );
> eigenvals( A );
Notice that the eigenvalues are positive - so the origin is a source - but the eigenvalue is repeated.
>
> eigenvects( A );
Note that there is only one eigenvector for this matrix.
>
The straight-line solutions are:
> Y1 := exp(3*t) * matrix( 2, 1, [ 1, 1 ] );
>
> V1 := matrix( 2, 1, [ 1, 1 ] );
> V2 := matrix( 2, 1, [ v1, v2 ] );
> eqn := evalm( A &* V2 - ( 3*V2 + V1 ) );
> soln := solve( { -v1+v2-1 = 0 }, { v1, v2 } );
> V2 := subs( soln , v2=1, evalm(V2) );
>
> Y2 := exp(3*t) * evalm( t * V1 + V2 );
>
> ode1 := diff( x(t), t ) = 2*x(t) + y(t);
> ode2 := diff( y(t), t ) = -x(t) + 4*y(t);
> MODEL := { ode1, ode2 }:
> VARS := { x(t), y(t) }:
> DOMAIN := t=0..3:
> RANGE := x=-2..2, y=-2..2:
> dirPLOT := DEplot( MODEL, VARS, DOMAIN, RANGE, arrows=MEDIUM ):
> dirPLOT;
>
>
IC := [ [ x(0)=0.5, y(0)=0.4 ], [ x(0)=0.1, y(0)=0.05 ], [ x(0)=0.01, y(0)=0.005 ],
[ x(0)=0.5, y(0)=0.6 ], [ x(0)=0.1, y(0)=0.15 ], [ x(0)=0.01, y(0)=0.015 ],
[ x(0)=-0.5, y(0)=-0.4 ], [ x(0)=-0.1, y(0)=-0.05 ], [ x(0)=-0.01, y(0)=-0.005 ],
[ x(0)=-0.5, y(0)=-0.6 ], [ x(0)=-0.1, y(0)=-0.15 ], [ x(0)=-0.01, y(0)=-0.015 ] ]:
> solPLOT := DEplot( MODEL, VARS, DOMAIN, RANGE, IC, arrows=NONE, stepsize=0.1, linecolor=GREEN ):
> #solPLOT;
>
> ICline := [ [ x(0)=0.1, y(0)=0.1 ], [ x(0)=-0.1, y(0)=-0.1 ] ]:
> linePLOT := DEplot( MODEL, VARS, DOMAIN, RANGE, ICline, arrows=NONE, linecolor=BLUE ):
> #linePLOT;
>
> display( [ dirPLOT, solPLOT, linePLOT ], title=`Example of Repeated Eigenvalues (Source)` );
>