Code covered by the BSD License
-
AlphaCalc(Pr,Ptheta,mass,P)
Finds the Angular acceleration of the Lorenze wheel
-
CenterOfMass(Pr,Ptheta,mass)
Finds the Center of mass in polar coordinates
-
MainPlotFunc(r,theta,h,t,P)
Initialize the Graph
-
MainPlotFunc(u,P)
Initialize the Graph
-
MomentOfInertia(Pr,Ptheta,mas...
Convert everything to Cartesian
-
lorenze_dynamics(t,x,u,flag,P...
end sfuntmpl
-
plotLorenze(r,theta,h,t,P)
Plotting for the Lorenze Wheel (controlling Lorenze with NLC)
-
Initialize.m
-
LorenzeSimulinkV1
-
View all files
from
Discrete Lorenz Water Wheel Simulation
by Trevor
This is a simulation of an 8 tank lorenze water wheel. The water speed is manually controlled.
|
| AlphaCalc(Pr,Ptheta,mass,P)
|
function alpha = AlphaCalc(Pr,Ptheta,mass,P)
% Finds the Angular acceleration of the Lorenze wheel
% the parameter was included in case later developments require some of the
% physical parameters from the Initialize.m file
COM_position = CenterOfMass(Pr,Ptheta,mass);
r_COM = COM_position(1);
theta_COM = COM_position(2);
Inertia = MomentOfInertia(Pr,Ptheta,mass,r_COM,theta_COM);
relativeTheta = mod(theta_COM,pi/2);
if theta_COM > 3*pi/2
Angle = -(pi/2 - relativeTheta);
elseif theta_COM > pi
Angle = -((pi/2-relativeTheta) +pi/2);
elseif theta_COM > pi/2
Angle = (relativeTheta + pi/2);
else
Angle = relativeTheta;
end
F_mag = 9.8*sum(mass);
torque = r_COM*F_mag*sin(Angle);
alpha = torque/Inertia;
end
|
|
Contact us