Code covered by the BSD License  

Highlights from
Discrete Lorenz Water Wheel Simulation

image thumbnail

Discrete Lorenz Water Wheel Simulation


Trevor (view profile)


This is a simulation of an 8 tank lorenze water wheel. The water speed is manually controlled.

function u = CenterOfMass(Pr,Ptheta,mass)

% Finds the Center of mass in polar coordinates

% Convert from polar to cartesian 

x = Pr.*cos(Ptheta);
y = Pr.*sin(Ptheta);

M_x = mass.*x;
M_y = mass.*y;

Total_Mass = sum(mass);

COM_x = sum(M_x)/Total_Mass;
COM_y = sum(M_y)/Total_Mass;

r = sqrt(COM_y^2 + COM_x^2);
theta = atan2(COM_y,COM_x);
theta = mod(theta,2*pi);
u(1) = r;
u(2) = theta;

Contact us