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!

