Is computation of expm(A*8640) be accurate if Matrix A has element of value 30 and very low element of value 0.000000001where a is 7x7 Matrix
2 views (last 30 days)
Show older comments
This script is to compute P = P(0)*expm(A*8640) where P(0) is vector = [1 0 0 0 0 0 0] and Matrix A has skewed values of relative high value of mu = 30 and very low value of lambda_unsafe = 0.000000001 ;
The question is whether above computation of P is accurate ?
format longEng
lambda = 0.00031
lambda_com = 0.00012
lambda_unsafe = 0.000000001
lambda_com = 0.00046
lambda_alert1 = 0.00046
lambda_alert2 = 0.00012
lambda_minor = 0.0004
lambda_shutdown = 0.00023
mu = 30
mu1 = 2
mu2 = 0.2
A = [-(2*lambda+lambda_com+lambda_unsafe) 2*lambda lambda_com lambda_unsafe 0 0 0; mu -(mu+lambda+lambda_unsafe+lambda_alert1) lambda lambda_unsafe lambda_alert1 0 0; 0 0 -lambda_alert2 0 lambda_alert2 0 0; 0 0 0 0 0 0 0; 0 0 0 0 -(lambda_minor+lambda_shutdown) lambda_minor lambda_shutdown; mu1 0 0 0 0 -mu1 0; mu2 0 0 0 0 0 -mu2]
Pinitial = [1 0 0 0 0 0 0]
P= Pinitial * expm(8640*A)
0 Comments
Answers (1)
Walter Roberson
on 20 Jun 2021
No, of course it is not accurate. Except for -inf and +inf and 0, exponential involves transcendental base or result (or both, usually), and cannot be accurately calculated using any finite precision arithmetic.
e2 = expm(2)
The result will not be accurate. There does not exist a rational number A/B such that A/B = exp(2) exactly, but ieee 754 double precision arithmetic can only accurately represent (some of) the rational numbers.
5 Comments
Walter Roberson
on 21 Jun 2021
Well, you could do that. But first I would recommend setting accuracy goals, and then figuring out whether your inputs such as 0.00046 are precise enough for there to be any chance theoretically of meeting your accuracy goals.
See Also
Categories
Find more on Robust Control Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!