4.2 Galileo Pendulum
141
Fig. 4.9 Graphs of the deviation angle (blue) and angular velocity (red) versus time
model PendulumWithNailVisualized
constant Real pi = 3.1416 ”Pi”;
constant Real g(unit = ”m/s2”) = 9.81
”gravitational acceleration”;
parameter Real l(unit = ”m”) = 10 ”length of the thread”;
parameter Real r(unit = ”m”) = 8
”distance from the pivot to the nail”;
parameter Real rad(unit = ”m”) = 0.5 ”radius of the bob”;
Real theta(unit = ”rad”, start = -pi / 6)
”angular displacement”;
Real omega(unit = ”rad/s”, start = 0) ”angular velocity”;
Real x(unit = ”m”) ”horizontal displacement of the bob”;
Real y(unit = ”m”) ”vertical displacement of the bob”;
equation
der(theta) = omega;
when theta < 0 then
reinit(omega, omega * (l - r) / l);
end when;
when theta > 0 then
reinit(omega, omega * l / (l - r));
end when;
if theta < 0 then
Précédent

- 153/274

Suivant