Skip to content

Instantly share code, notes, and snippets.

@userjjb
userjjb / gist:69762d81f3bb34f68bcc157d9f55f103
Created June 13, 2019 07:33
Simple Matlab implementation of N-body timestep with forward Euler
N = 2^8 * 100;
dt = 0.00001;
x1 = rand(N, 1);
x2 = rand(N, 1);
q = rand(N, 1) + 1;
v1 = zeros(N, 1);
v2 = v1;
%Start of a timestep