alelouis / ode-flow

Ordinary Differential Equation Flow

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ODE Flow

Ordinary Differential Equation flow visualization written in Rust with SDL2.

Ordinary Differential Equation

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.

Flow

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.

How to run

git clone https://github.com/alelouis/ode-flow.git
cd ode-flow
cargo run

Example

screen_capture

Enregistrement.de.l.ecran.2021-07-28.a.19.31.57.mov

About

Ordinary Differential Equation Flow


Languages

Language:Rust 100.0%