Scaling variables for integration with ode15s
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello,
I am integrating a set of differential equations with ode15s and some of my variables have very different orders of magnitude; e.g some are within the [0,1] range and some can go as high as 1E30. I just wanted to know if this causes inaccuracies in the results and if I need to find a way to scale my variables or if there is an built-in option for that.
I am wondering because in the litterature I read detailing the equations I use for my model they recommend adding a scaling factor for integration but I do not know how to implement this yet and MATLAB does the integration anyways, I just don't know if the results are precise.
댓글 수: 0
답변 (1개)
John D'Errico
2022년 9월 15일
There is a reasonable chance your results may problematic, if you do not scale things. While you may get a result, you will have no idea if has has any usefulness. Possibly it will not, lacking that scaling.
Is there a built-in option for this? How could there be? MATLAB cannot read your mind. MATLAB does what you tell it to do. If it did not, instead modifying your problems as it thinks might be the case, this would itself be a serious problem.
How do you scale variables? Do you understand that, for example, in the metric system, you can work in meters, kilometers, nanometers, centimeters, etc. Another example, is to consider the distance to the nearest star is about 4 light years. A nice, easy number to work with. Would you rather record that distance in feet? Millimeters? Picometers?
Depending on the units chosen, your numbers will have MANY orders of magnitude difference. But YOU need to make that choice as is appropriate.
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!