Analytic Solution for Linear Homogeneous Systems (Eigenvalue Analysis)
> with( linalg ):
Warning, new definition for adjoint
Warning, new definition for norm
Warning, new definition for trace
> I2 := matrix( 2, 2, [[1,0],[0,1]] ); # 2x2 identity matrix
> A := matrix( 2, 2,
> [ [ 2 , 1 ],
> [ -1 , 4 ] ] );
> eigenvalues( A );
>
> eigenvectors( A );
>
Case 3: Repeated Eigenvalue
> lambda := 3 ;
> V1 := vector( 2, [ 1 , 1 ] );
> V2 := vector( 2, [ x2 , y2 ] );
>
The straight-line solution is:
> Y1 := exp( lambda *t) * convert( V1, matrix );
>
To find a second linearly independent solution we must find any vector that satisfies or, equivalently, .
> sys := geneqns( evalm( A-lambda*I2 ), V2, V1 );
> soln := solve( sys, { x2, y2 } );
> V2 := subs( soln , x2=0, y2=0, evalm(V2) );
>
> Y2 := exp( lambda *t) * ( t * convert( evalm( V1 ), matrix ) + convert( evalm( V2 ) , matrix ) );
>
> SOLgen := c1 * Y1 + c2 * Y2;
>
>