速度 Verlet 算法不守恒能量 [英] Velocity verlet algorithm not conserving energy

查看:33
本文介绍了速度 Verlet 算法不守恒能量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的印象是,如果被建模的系统这样做,算法应该节约能源.我正在模拟太阳系,它应该节约能源.该程序保存角动量并确实产生稳定的轨道,但总能量(动能 + 引力势)围绕某个基线振荡.振荡是显着的.是否有可能发生这种情况的常见原因?

I was under the impression that the algorithm should conserve energy if the system being modelled does. I'm modelling the solar system, which should conserve energy. The program conserves angular momentum and does produce stable orbits, but the total energy (kinetic + gravitational potential) oscillates around some baseline. The oscillations are significant. Are there common reasons why this might happen?

模型假设行星是点质量、圆形轨道(我也试过椭圆轨道并且能量仍然振荡)并使用牛顿力学.我想不出该程序的其他哪些功能可能会影响结果.

Model assumes planets are point masses, circular orbits (I've also tried elliptical orbits and the energy still oscillates) and uses Newtonian mechanics. I can't think what other features of the program might be affecting the outcome.

如果只是预期能量振荡,那是什么原因造成的??

If it is just expected that the energy oscillates, what causes that??

推荐答案

从评论中合并:对于完全引力 N 体问题,我认为任何数值积分器都不会是辛的.即使对于绕中心运行的单点,Velocity Verlet 也不是辛的(易于检查,因为它具有 g = v^2/R 的简单解析解).所以我建议尝试一个高阶积分器(例如 Runge-Kutta),如果能量偏差几乎消失(意味着计算通常是正确的),您可以重新调整组合动能以保持总能量明确守恒.具体来说,您计算更新后的 Ekin_actual 和 Ekin_desired = Etotal_initial - Epotential,并按 sqrt(Ekin_desired/Ekin_actual) 缩放所有速度

Merged from the comments: For a full gravitational N-body problem, I don't think any numerical integrator will be symplectic. Velocity Verlet isn't symplectic even for a single point orbiting a center (easy to check, since it has a trivial analytical solution with g = v^2/R). So I suggest trying a higher-order integrator (such as Runge-Kutta), and if energy deviations almost go away (meaning the the calculations are generally correct), you can re-scale the combined kinetic energy to keep the total energy conserved explicitly. Specifically, you compute the updated Ekin_actual and Ekin_desired = Etotal_initial - Epotential, and scale all velocities by sqrt(Ekin_desired / Ekin_actual)

这篇关于速度 Verlet 算法不守恒能量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆