Code covered by the BSD License  

Highlights from
Discrete Lorenz Water Wheel Simulation

image thumbnail

Discrete Lorenz Water Wheel Simulation

by

 

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

MomentOfInertia(Pr,Ptheta,mass,COM_r,COM_theta)
function I = MomentOfInertia(Pr,Ptheta,mass,COM_r,COM_theta)


% Convert everything to Cartesian

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

x_COM = COM_r.*cos(COM_theta);
y_COM = COM_r.*sin(COM_theta);

% Calculate the distance

dx = x - x_COM;
dy = y - y_COM;

r_sqrd = (dx.^2 + dy.^2);

M_r = mass.*r_sqrd;

Total_Mass = sum(mass);

I = sum(M_r)/Total_Mass;


end

Contact us