Ordinary Differential Equation flow visualization written in Rust with SDL2.
The ODE used is defined at the top of the ode.rs
file.
// pendulum with friction
pub fn pendulum(x: f64, y: f64) -> (f64, f64) {
(y, -x.sin() - 0.5 * y)
}
This ODE models a simple 2D pendulum with air friction.
The particle flow is constructed by sampling randomly initial positions and propagating in gradient direction with Euler integration. A constant number of particles is kept by poping front particle vector once max size is reached.
git clone https://github.com/alelouis/ode-flow.git
cd ode-flow
cargo run