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?
大多数(如果不是所有)集成模块开箱即用,如果:
这对于天文模拟通常会失败,其中数量级变化并且值以及时间尺度在典型单位中通常很大。
积分器上述行为的原因是他们使用步长自适应,即调整积分步长以将估计误差保持在定义的水平。步长自适应又由许多参数控制,例如绝对容差、相对容差、最小时间步长等。您通常可以调整这些参数,但如果不这样做,则需要一些默认值和这些考虑到上述设置,选择默认值。
您可能会问自己:不能更动态地选择这些参数吗?作为集成模块的开发者和维护者,我粗略地预计引入这种自动化会产生以下后果:
| 归档时间: |
|
| 查看次数: |
71 次 |
| 最近记录: |