exponential matrix

Is there a command to compute the exponential of a matrix using GAUSS? I am not talking about the element by element exponential. I talking about the exponential of a matrix as given in the following definition:

 

https://en.wikipedia.org/wiki/Matrix_exponential

 

I appreciate your interests in advance.

1 Answer



0



GAUSS does not have a built-in function for this yet, however, this code should do what you want:

A = { -0.57417717      -0.87184947       0.72815309      -0.75585604, 
       2.5429514       0.81242011    -0.0053033693      -0.67348003, 
     -0.50066776       -2.1355249        1.8998340       -2.0122135, 
      -1.6892236      -0.77342078      -0.77691244      -0.27255544 };
emat = expm(A);

proc (1) = expm(A);
    local eval, evec, out;
    { eval, evec } = eigv(A);
    
    out = evec * (eye(rows(eval)) .* exp(eval)) * inv(evec);
    
    retp(real(out));
endp;

Where emat should end up as:

     -0.84691011       -2.2387765        2.0983160       -1.1356752 
       2.5053272      -0.71110282        3.5202087       -3.1394592 
      -4.2278307       -6.5585548        7.4120945       -3.6513710 
     -0.57884903        2.3984690       -4.1551865        3.3012497

aptech

1,773

Your Answer

1 Answer

0

GAUSS does not have a built-in function for this yet, however, this code should do what you want:

A = { -0.57417717      -0.87184947       0.72815309      -0.75585604, 
       2.5429514       0.81242011    -0.0053033693      -0.67348003, 
     -0.50066776       -2.1355249        1.8998340       -2.0122135, 
      -1.6892236      -0.77342078      -0.77691244      -0.27255544 };
emat = expm(A);

proc (1) = expm(A);
    local eval, evec, out;
    { eval, evec } = eigv(A);
    
    out = evec * (eye(rows(eval)) .* exp(eval)) * inv(evec);
    
    retp(real(out));
endp;

Where emat should end up as:

     -0.84691011       -2.2387765        2.0983160       -1.1356752 
       2.5053272      -0.71110282        3.5202087       -3.1394592 
      -4.2278307       -6.5585548        7.4120945       -3.6513710 
     -0.57884903        2.3984690       -4.1551865        3.3012497

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.