Simplifying output in Matlab
显示 更早的评论
If you get an expression like this as output
syms x
fx = -(1.0*(1.82e+39*x^2 + 1.81e+32*x - 3.04e+39))/(6.35e+41*x + 4.27e+37)
How do you simplify the output and use smaller numbers, for example
fx = -(1.0*(1.82e+7*x^2 + 1.81*x - 3.04e+7))/(6.35e+9*x + 4.27e+5)
6 个评论
Likely the best to be hoped for is —
syms x
fx = -(1.0*(1.82e+39*x^2 + 1.81e+32*x - 3.04e+39))/(6.35e+41*x + 4.27e+37)
fx = vpa(fx, 3)
fx = vpa(simplifyFraction(fx), 3)
.
Aleem Andrew
2021-11-7
Walter Roberson
2021-11-7
Is the rule that you want the numerator coefficient of x^1 to be in the range [1, 10) ?
Aleem Andrew
2021-11-7
Star Strider
2021-11-7
The integration proceeded very quickly, running it in Input argument for ode45 function type error (running R2021b), however the coefficient magnitudes are large, although not so different between them that this could be regarded as a ‘stiff’ system. It could be worth experimenting with ode15s or other stiff solvers to see if the speed increases significantly.
Jan
2021-11-7
The computation of smaller numbers is easier for human, but does not change the speed when performing the calculations on a computer.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

