Scaling variables for integration with ode15s
7 次查看(过去 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!