How can I simplify numerical calculations in symbolic math toolbox?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Antonio
am 16 Okt. 2015
Kommentiert: Walter Roberson
am 16 Okt. 2015
Hi there,
When I write this:
fR == simplify((Alpha/uR)*((y/uR)^(Alpha-1))*exp(-(uS/y)^k))
I get something like this:
fR =
(12153*exp(-(10/y)^(601/100))*(y/20)^(11153/1000))/20000
Could you tell me please how to simplify the numerical calculations?! I mean I want the term "(11153/1000))/20000" be printed as "0.000557".
Thanks
0 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Okt. 2015
Use the vpa function. (If you want to solve an equation and avoid fractions, use the vpasolve function.)
3 Kommentare
Star Strider
am 16 Okt. 2015
Actually, that’s essentially what you want. It’s just expressing the decimal fractions literally instead of as decimals. However, I’m not quite certain why it’s rendering, for instance, (11153/1000) as a fraction and not as 11.153. Maybe close enough is good enough for vpa. (I get the same result as you do.)
Walter Roberson
am 16 Okt. 2015
Exponents are not converted to floating point because a floating point exponent means something different than a rational exponent. With rational exponents you need to worry about multiple roots and principle roots, but with floating point exponent the operation x^(a/b) is defined strictly in terms of exp(a/b * log(x)) which is a single value that is complex in cases where algebraic x^(a/b) might be real-valued.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!