142
4 Modeling of Mechanical Oscillatory Systems with One Degree …
Fig. 4.10 Phase diagram of the Galilean pendulum
der(omega) = -g / l * sin(theta);
x = l * sin(theta);
y = -l * cos(theta);
else
der(omega) = -g / (l - r) * sin(theta);
x = (l - r) * sin(theta);
y = (-r) - (l - r) * cos(theta);
end if;
end PendulumWithNailVisualized;
4.3 Mathematical Pendulum with Spring
Formulation of the problem
On a weightless rod of length l, there is a load of mass m. A weightless spring of
rigidity k is attached to an arbitrary point of the rod at a distance d from the suspension
point (special cases are fastening in the middle of the rod or below the load). The
second end of the spring is mounted on the wall (see Fig. 4.11). When the rod is
upright, the spring is not deformed. Provide the ability to account for environmental
resistance.
Tasks
• Simulate the oscillations of a mathematical pendulum with a spring without taking
into account friction. Build a graph of the change in angular displacement over
4 Modeling of Mechanical Oscillatory Systems with One Degree …
Fig. 4.10 Phase diagram of the Galilean pendulum
der(omega) = -g / l * sin(theta);
x = l * sin(theta);
y = -l * cos(theta);
else
der(omega) = -g / (l - r) * sin(theta);
x = (l - r) * sin(theta);
y = (-r) - (l - r) * cos(theta);
end if;
end PendulumWithNailVisualized;
4.3 Mathematical Pendulum with Spring
Formulation of the problem
On a weightless rod of length l, there is a load of mass m. A weightless spring of
rigidity k is attached to an arbitrary point of the rod at a distance d from the suspension
point (special cases are fastening in the middle of the rod or below the load). The
second end of the spring is mounted on the wall (see Fig. 4.11). When the rod is
upright, the spring is not deformed. Provide the ability to account for environmental
resistance.
Tasks
• Simulate the oscillations of a mathematical pendulum with a spring without taking
into account friction. Build a graph of the change in angular displacement over
