146
4 Modeling of Mechanical Oscillatory Systems with One Degree …
Fig. 4.13 Comparison of the angular displacements of the pendulum with the spring in a viscous
medium, at different positions of the spring attachment point
Real x(unit = ”m”) ”horizontal displacement of the bob”;
Real y(unit = ”m”) ”vertical displacement of the bob”;
/*visualization objects*/
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape bob(shapeType = ”sphere”, length = 2 * rad, width
= 2 * rad, height = 2 * rad, r = {x, y, 0}, r_shape =
{-rad, 0, 0}, color = {0, 50, 255});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape thread(shapeType = ”cylinder”, length = l, width =
0.2, height = 0.2, lengthDirection = {x, y, 0}, color =
{40, 100, 100});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape level1(shapeType = ”box”, length = l, width =
0.1, height = 0.1, r = {-l / 2, 0, 0}, color = {20, 20, 20});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape level2(shapeType = ”box”, length = 0.1, width
= 3, height = 0.1, widthDirection = {0, 1, 0}, r =
{-l / 2, -l / 2, 0}, color = {20, 20, 20});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape spring(shapeType = ”spring”, extra = 10, r =
{-l / 2, -l / 2, 0}, length = l / 2+d * sin(theta) , width
4 Modeling of Mechanical Oscillatory Systems with One Degree …
Fig. 4.13 Comparison of the angular displacements of the pendulum with the spring in a viscous
medium, at different positions of the spring attachment point
Real x(unit = ”m”) ”horizontal displacement of the bob”;
Real y(unit = ”m”) ”vertical displacement of the bob”;
/*visualization objects*/
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape bob(shapeType = ”sphere”, length = 2 * rad, width
= 2 * rad, height = 2 * rad, r = {x, y, 0}, r_shape =
{-rad, 0, 0}, color = {0, 50, 255});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape thread(shapeType = ”cylinder”, length = l, width =
0.2, height = 0.2, lengthDirection = {x, y, 0}, color =
{40, 100, 100});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape level1(shapeType = ”box”, length = l, width =
0.1, height = 0.1, r = {-l / 2, 0, 0}, color = {20, 20, 20});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape level2(shapeType = ”box”, length = 0.1, width
= 3, height = 0.1, widthDirection = {0, 1, 0}, r =
{-l / 2, -l / 2, 0}, color = {20, 20, 20});
Modelica.Mechanics.MultiBody.Visualizers.Advanced.
Shape spring(shapeType = ”spring”, extra = 10, r =
{-l / 2, -l / 2, 0}, length = l / 2+d * sin(theta) , width
