expReturn the exponential of a matrix by adaptive Taylor series expansion with scaling and balancing |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
phi = Matrices.exp(A); phi = Matrices.exp(A,T=1);
This function computes the exponential eAT of matrix A, i.e.
(AT)^2 (AT)^3 Φ = e^(AT) = I + AT + ------ + ------ + .... 2! 3!
where e=2.71828..., A is an n x n matrix with real elements and T is a real number, e.g., the sampling time. A may be singular. With the exponential of a matrix it is, e.g., possible to compute the solution of a linear system of differential equations
der(x) = A*x -> x(t0 + T) = e^(AT)*x(t0)
The algorithm is taken from
The following steps are performed to calculate the exponential of A:
In several sources it is not recommended to use Taylor series expansion to calculate the exponential of a matrix, such as in 'C.B. Moler and C.F. Van Loan: Nineteen dubious ways to compute the exponential of a matrix. SIAM Review 20, pp. 801-836, 1979' or in the documentation of m-file expm2 in MATLAB version 6 (http://www.mathworks.com) where it is stated that 'As a practical numerical method, this is often slow and inaccurate'. These statements are valid for a direct implementation of the Taylor series expansion, but not for the implementation variant used in this function.
A |
Type: Real[:,size(A, 1)] |
---|---|
T |
Default Value: 1 Type: Real |
phi |
Type: Real[size(A, 1),size(A, 1)] Description: = exp(A*T) |
---|