Hot answers tagged

4

The correct dynamic equations in the polar coordinates should be $ \dot{v_r} = \omega^2 r - \alpha/r^2 \\ \dot{\omega} = - 2 v_r \omega /r\\ \dot{\theta} = \omega \\ \dot{r} = v_r $ Here is the fixed Python code: from math import * import numpy as np from matplotlib import pyplot as plt from scipy.integrate import odeint def vec(w,t): r,vr,theta,omega=...


2

There are two main questions you are asking: Can I solve Lotka-Volterra problem using explicit Euler time stepping method? Answer: Probably, but you will need to take very small time steps. It is non-linear, it sometimes has chaotic behaviour depending on the parameters. So the choice of $\Delta t$ will be important. I would probably use other time steppers,...


2

For debugging the code, there is a set of analytic solutions here for several reduced models corresponding to subsets of terms on the right-hand side. These analytic solutions have to be reproduced by the code. Verification testing of this kind is a standard practice for debugging simulation models. Reduced model 1: $ m \ddot{x} = - \gamma \dot{x} $ Solution:...


1

n-body problem would be dense (of course, if you don't do any filtering to remove "weak" couplings. As Maxim Umansky mentioned in the comments, some discretizations of time-dependent PDEs give rise to sparse ODE systems. Some others, like spectral methods, are dense ODE systems. In terms of parallel computing, I don't think there would be much ...


Only top voted, non community-wiki answers of a minimum length are eligible