Normalised units, why do we use them in numerical integration?

Edw*_*ner 1 python simulation matplotlib numerical-methods numerical-integration

I was simulation the solar system (Sun, Earth and Moon). When I first started working on the project I used the base units: for distance I used meters [m], for time I used seconds [s] and for velocity/speed I was using meters per second [m/s]. Because I was dealing with solar system the numbers were pretty big, for example the distance beetween the Earth and Sun is 150*10^9 m.

When I ran the simulation - numerical integration (I was using the solve_ivp method, function in scipy library) - the results were completely wrong... Here is example of Earth and Moon trajectories. 地球和月球

But then I got a suggestion from a friend that I should use the standardised units, for distance astronimocal units [AU] and years for time [year]. And the simulation started working flawlessly!

My question is: Why is that? Why didn't work at first and started wotking suddenly after I switched from base to standard units?? Why were calculations wrong when using base units?

Wrz*_*mft 5

大多数(如果不是所有)集成模块开箱即用,如果:

  • 您的动态变量具有相同的数量级;
  • 该数量级为 1;
  • 动态的最小时间尺度也具有数量级 1。

这对于天文模拟通常会失败,其中数量级变化并且值以及时间尺度在典型单位中通常很大。

积分器上述行为的原因是他们使用步长自适应,即调整积分步长以将估计误差保持在定义的水平。步长自适应又由许多参数控制,例如绝对容差、相对容差、最小时间步长等。您通常可以调整这些参数,但如果不这样做,则需要一些默认值和这些考虑到上述设置,选择默认值。

题外话

您可能会问自己:不能更动态地选择这些参数吗?作为集成模块的开发者和维护者,我粗略地预计引入这种自动化会产生以下后果:

  • 大约千分之二十的用户不会遇到像您这样的问题。
  • 大约五万名用户(包括上述用户)错过了学习有关集成商如何工作和阅读文档的基本知识的机会。
  • 大约千分之一的用户会遇到比上述更难解决的自动化问题。
  • 我需要引入新的参数来控制对于普通用户来说更难掌握的自动化。
  • 我花了很多时间来设计和实现自动化。

  • @nicholaswogan:*我的空间已经用完了。* – 没错。我可以在这里写我自己的关于步长适应的教科书章节,但是很多这样的内容已经存在(并且比这个问题的答案更容易找到)。我必须假设提问者/读者有一些背景知识或者能够使用正确的关键字获得它。不管怎样,我一句话概括了。 (2认同)