Intermediate step return ```InF``` while using exp

2 views (last 30 days)
```
aa=8e+05;
bb=1e+06;
tf=0.002;
temp=(-(bb*exp(bb*tf)-aa*exp(aa*tf))*exp(-bb*tf-aa*tf)+bb-aa)
```
Output is InF
I believe the InF comes from exp(bb*tf) and exp(aa*tf)
What should do to make this work? Thank you

Accepted Answer

Walter Roberson
Walter Roberson on 3 Jun 2022
Edited: Walter Roberson on 3 Jun 2022
aa=sym(8e+05) ;
bb =sym(1e+06) ;
tf =sym(0.002);
temp = simplify( (-(bb*exp(bb*tf)-aa*exp(aa*tf))*exp(-bb*tf-aa*tf)+bb-aa))
The answer involves two terms with exp() of -2000 and -1600, plus a constant 2000. The exp() terms are so small that they have no practical effect on the constant. The larger of the two exp() is roughly -1e-689

More Answers (0)

Tags

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!