From 6123a3d2cf006c4f74e32ca39b10a5ddb02da129 Mon Sep 17 00:00:00 2001 From: Malte Lenz Date: Wed, 16 Jul 2025 11:31:45 +0200 Subject: [PATCH] Add starting point for figures in Mechanics.MultiBody. These originate from figures created for Wolfram System Modeler, and are likely to need cleanup and improvement. --- .../Examples/Elementary/DoublePendulum.mo | 17 ++++++++- .../Elementary/DoublePendulumInitTip.mo | 35 ++++++++++++++++++- .../MultiBody/Examples/Elementary/FreeBody.mo | 25 ++++++++++++- .../Examples/Elementary/HeatLosses.mo | 33 ++++++++++++++++- .../Examples/Elementary/InitSpringConstant.mo | 33 ++++++++++++++++- .../Elementary/LineForceWithTwoMasses.mo | 26 +++++++++++++- .../MultiBody/Examples/Elementary/Pendulum.mo | 22 +++++++++++- .../Elementary/PendulumWithSpringDamper.mo | 30 +++++++++++++++- .../Examples/Elementary/PointGravity.mo | 18 +++++++++- .../Elementary/PointGravityWithPointMasses.mo | 24 ++++++++++++- .../Examples/Elementary/RollingWheel.mo | 34 +++++++++++++++++- .../Elementary/RollingWheelSetDriving.mo | 31 +++++++++++++++- .../Elementary/RollingWheelSetPulling.mo | 30 +++++++++++++++- .../Examples/Elementary/SpringDamperSystem.mo | 18 +++++++++- .../Examples/Elementary/SpringMassSystem.mo | 24 ++++++++++++- .../Examples/Elementary/SpringWithMass.mo | 23 +++++++++++- .../Examples/Elementary/ThreeSprings.mo | 26 +++++++++++++- .../Elementary/UserDefinedGravityField.mo | 17 ++++++++- .../MultiBody/Examples/Loops/EngineV6.mo | 19 +++++++++- .../Examples/Loops/EngineV6_analytic.mo | 19 +++++++++- .../MultiBody/Examples/Loops/Fourbar1.mo | 28 ++++++++++++++- .../MultiBody/Examples/Loops/Fourbar2.mo | 28 ++++++++++++++- .../Examples/Loops/Fourbar_analytic.mo | 28 ++++++++++++++- 23 files changed, 565 insertions(+), 23 deletions(-) diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulum.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulum.mo index b7844880e4..53d1a023d6 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulum.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulum.mo @@ -56,5 +56,20 @@ object to false to switch off animation of all components. \"model -")); +", + figures = { + Figure( + title = "End point position", + identifier = "42aee", + preferred = true, + plots = { + Plot( + curves = { + Curve(x = boxBody2.frame_b.r_0[1], y = boxBody2.frame_b.r_0[2], legend = "End point position of pendulum in the x and y plane") + } + ) + } + ) + } + )); end DoublePendulum; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulumInitTip.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulumInitTip.mo index f2a23d8689..5b78cf4503 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulumInitTip.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/DoublePendulumInitTip.mo @@ -87,5 +87,38 @@ In this example, it is simply done by revolute2.phi.start = Mode
-")); +", + figures = { + Figure( + title = "Initial conditions", + identifier = "78253", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = boxBody2.frame_b.r_0[1], legend = "Position of end point of pendulum along the x axis"), + Curve(y = boxBody2.frame_b.r_0[2], legend = "Position of end point of pendulum along the y axis") + } + ), + Plot( + curves = { + Curve(y = der(boxBody2.r_0[1]), legend = "Velocity of end point of pendulum along the x axis"), + Curve(y = der(boxBody2.r_0[2]), legend = "Velocity of end point of pendulum along the y axis") + } + ) + } + ), + Figure( + title = "End point position", + identifier = "dc6f6", + plots = { + Plot( + curves = { + Curve(x = boxBody2.frame_b.r_0[1], y = boxBody2.frame_b.r_0[2], legend = "End point position of pendulum in the x and y plane") + } + ) + } + ) + } + )); end DoublePendulumInitTip; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/FreeBody.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/FreeBody.mo index 6785060fb1..1dd2ced2e1 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/FreeBody.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/FreeBody.mo @@ -80,5 +80,28 @@ This example demonstrates: \"model -")); +", + figures = { + Figure( + title = "Body position and spring forces", + identifier = "a2b4a", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = body.body.frame_a.r_0[1], legend = "Body position along x axis"), + Curve(y = body.body.frame_a.r_0[2], legend = "Body position along y axis"), + Curve(y = body.body.frame_a.r_0[3], legend = "Body position along z axis") + } + ), + Plot( + curves = { + Curve(y = spring1.spring.f, legend = "Force from left spring"), + Curve(y = spring2.spring.f, legend = "Force from right spring") + } + ) + } + ) + } + )); end FreeBody; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/HeatLosses.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/HeatLosses.mo index 5084fb2afd..75a066d132 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/HeatLosses.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/HeatLosses.mo @@ -188,5 +188,36 @@ a convection element to the environment. The total heat flow generated by the elements of this multi-body system and transported to the environment is present in variable convection.fluid.

-")); +", + figures = { + Figure( + title = "Heat losses", + identifier = "de1ad", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = body1.r_0[2], legend = "Elongation of body1"), + Curve(y = body2.r_0[2], legend = "Elongation of body2"), + Curve(y = body3.r_0[2], legend = "Elongation of body3") + } + ), + Plot( + curves = { + Curve(y = damper1.f, legend = "Force from damper1 connected to body1"), + Curve(y = springDamper.f, legend = "Force from springDamper connected to body2"), + Curve(y = springDamperSeries.f, legend = "Force from springDamperSeries connected to body3") + } + ), + Plot( + curves = { + Curve(y = damper1.heatPort.Q_flow, legend = "Heat flow from damper1 connected to body1"), + Curve(y = springDamper.heatPort.Q_flow, legend = "Heat flow from springDamper connected to body2"), + Curve(y = springDamperSeries.heatPort.Q_flow, legend = "Heat flow from springDamperSeries connected to body3") + } + ) + } + ) + } + )); end HeatLosses; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/InitSpringConstant.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/InitSpringConstant.mo index 5380696de1..c5eaa43c42 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/InitSpringConstant.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/InitSpringConstant.mo @@ -82,5 +82,36 @@ An animation of this simulation is shown in the figure below. \"model -"), experiment(StopTime=1.01)); +", + figures = { + Figure( + title = "Forces and initial conditions", + identifier = "83624", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = body.body.frame_a.f[2], legend = "Force from gravity on body") + }, + x = Axis(min = 0, max = 1.2) + ), + Plot( + curves = { + Curve(y = spring.c, legend = "Calculated spring constant"), + Curve(y = spring.spring.f, legend = "Force from spring on end point of the body") + }, + x = Axis(min = 0, max = 1.2) + ), + Plot( + curves = { + Curve(y = rev.phi, legend = "Angle of the revolute joint (set to 0 at initialization)"), + Curve(y = rev.w, legend = "Angular velocity of the revolute joint (set to 0 at initialization)"), + Curve(y = rev.a, legend = "Angular acceleration of the revolute joint (set to 0 at initialization)") + }, + x = Axis(min = 0, max = 1.2) + ) + } + ) + } + ), experiment(StopTime=1.01)); end InitSpringConstant; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/LineForceWithTwoMasses.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/LineForceWithTwoMasses.mo index 6c0c55f868..07a855048d 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/LineForceWithTwoMasses.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/LineForceWithTwoMasses.mo @@ -199,5 +199,29 @@ side in the back is the animation with the JointUPS component.
-")); +", + figures = { + Figure( + title = "Difference in cut forces", + identifier = "beedd", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = body_f_diff[1], legend = "Difference in cut-forces in bodyBox1 and bodyBox2 along x axis"), + Curve(y = body_f_diff[2], legend = "Difference in cut-forces in bodyBox1 and bodyBox2 along y axis"), + Curve(y = body_f_diff[3], legend = "Difference in cut-forces in bodyBox1 and bodyBox2 along z axis") + } + ), + Plot( + curves = { + Curve(y = rod_f_diff[1], legend = "Difference of cut-forces in rod1 and rod3 along x axis"), + Curve(y = rod_f_diff[2], legend = "Difference of cut-forces in rod1 and rod3 along y axis"), + Curve(y = rod_f_diff[3], legend = "Difference of cut-forces in rod1 and rod3 along z axis") + } + ) + } + ) + } + )); end LineForceWithTwoMasses; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/Pendulum.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/Pendulum.mo index d68cfad27b..2411f90787 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/Pendulum.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/Pendulum.mo @@ -35,5 +35,25 @@ assembled system. \"model -")); +", + figures = { + Figure( + title = "Pendulum angle", + identifier = "88bdb", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = rev.phi, legend = "Angle of pendulum") + } + ), + Plot( + curves = { + Curve(y = damper.tau, legend = "Torque applied to revolute joint from damper") + } + ) + } + ) + } + )); end Pendulum; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/PendulumWithSpringDamper.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/PendulumWithSpringDamper.mo index 35775f7a8c..c5ba8655cd 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/PendulumWithSpringDamper.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/PendulumWithSpringDamper.mo @@ -84,5 +84,33 @@ and a point fixed in the world frame: \"model -")); +", + figures = { + Figure( + title = "End point position", + identifier = "11319", + preferred = true, + plots = { + Plot( + curves = { + Curve(x = body1.r_0[1], y = body1.r_0[2], legend = "Pendulum end point position in the x-y plane") + } + ) + } + ), + Figure( + title = "Spring and damper", + identifier = "3fbed", + plots = { + Plot( + curves = { + Curve(y = spring1.spring.f, legend = "Force from spring affecting the elongation of the prismatic joint, depending on displacement"), + Curve(y = prismatic.s, legend = "Elongation of the prismatic joint"), + Curve(y = damper1.f, legend = "Force from damper affecting the prismatic joint depending on the elongation velocity") + } + ) + } + ) + } + )); end PendulumWithSpringDamper; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravity.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravity.mo index b6b66ab388..de4a8c9d67 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravity.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravity.mo @@ -43,5 +43,21 @@ point gravity field. \"model -")); +", + figures = { + Figure( + title = "Body positions", + identifier = "7bb2a", + preferred = true, + plots = { + Plot( + curves = { + Curve(x = body1.r_0[1], y = body1.r_0[2]), + Curve(x = body2.r_0[1], y = body2.r_0[2]) + } + ) + } + ) + } + )); end PointGravity; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravityWithPointMasses.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravityWithPointMasses.mo index ab741ddb79..d6cb15ee89 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravityWithPointMasses.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/PointGravityWithPointMasses.mo @@ -63,5 +63,27 @@ a default value, when the physical system does not provide the equations.

-")); +", + figures = { + Figure( + title = "Body positions", + identifier = "681b4", + preferred = true, + plots = { + Plot( + curves = { + Curve(x = body1.r_0[1], y = body1.r_0[2], legend = "Position of body1 in the x-y plane"), + Curve(x = body2.r_0[1], y = body2.r_0[2], legend = "Position of body2 in the x-y plane") + } + ), + Plot( + curves = { + Curve(x = body3.r_0[1], y = body3.r_0[2], legend = "Position of body3 in the x-y plane"), + Curve(x = body4.r_0[1], y = body4.r_0[2], legend = "Position of body4 in the x-y plane") + } + ) + } + ) + } + )); end PointGravityWithPointMasses; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheel.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheel.mo index 81ae7dea1d..1feb6556c1 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheel.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheel.mo @@ -27,5 +27,37 @@ model RollingWheel Demonstrates how a single wheel is rolling on ground (starting with an initial velocity).

-")); +", + figures = { + Figure( + title = "Wheel position from above", + identifier = "d1c70", + preferred = true, + plots = { + Plot( + curves = { + Curve(x = wheel1.x, y = wheel1.y, legend = "Wheel position from above, in the x-y plane") + } + ) + } + ), + Figure( + title = "Wheel forces", + identifier = "134a8", + plots = { + Plot( + curves = { + Curve(y = wheel1.rollingWheel.f_n, legend = "Normal force acting on wheel") + } + ), + Plot( + curves = { + Curve(y = wheel1.rollingWheel.f_lat, legend = "Contact force on wheel in lateral direction"), + Curve(y = wheel1.rollingWheel.f_long, legend = "Contact force on wheel in longitudinal direction") + } + ) + } + ) + } + )); end RollingWheel; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetDriving.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetDriving.mo index 05f141b174..125541adca 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetDriving.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetDriving.mo @@ -85,5 +85,34 @@ equation Demonstrates how a RollingWheelSet (two wheels rigidly coupled together) is rolling on ground when driven by some external torques.

-")); +", + figures = { + Figure( + title = "Torques and forces", + identifier = "80032", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = torque1.tau, legend = "Torque on wheel1"), + Curve(y = torque2.tau, legend = "Torque on wheel2"), + Curve(y = wheelSet.wheelSetJoint.support.tau, legend = "Total torque on wheels") + } + ), + Plot( + curves = { + Curve(y = wheelSet.wheelSetJoint.rolling1.f_lat, legend = "Lateral force on wheel1"), + Curve(y = wheelSet.wheelSetJoint.rolling1.f_long, legend = "Longitudinal force on wheel1") + } + ), + Plot( + curves = { + Curve(y = wheelSet.wheelSetJoint.rolling2.f_lat, legend = "Lateral force on wheel2"), + Curve(y = wheelSet.wheelSetJoint.rolling2.f_long, legend = "Longitudinal force on wheel2") + } + ) + } + ) + } + )); end RollingWheelSetDriving; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetPulling.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetPulling.mo index a35798b485..c8d4275205 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetPulling.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/RollingWheelSetPulling.mo @@ -72,5 +72,33 @@ equation Demonstrates how a RollingWheelSet (two wheels rigidly coupled together) is rolling on ground when pulled by an external force.

-")); +", + figures = { + Figure( + title = "Forces and position", + identifier = "c9274", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = force.force[1], legend = "Force applied along the x axis in the world coordinate system"), + Curve(y = force.force[2], legend = "Force applied along the y axis in the world coordinate system") + } + ), + Plot( + curves = { + Curve(y = wheelSet.frameMiddle.f[1], legend = "Force applied along the x axis in the middle wheel set coordinate system"), + Curve(y = wheelSet.frameMiddle.f[2], legend = "Force applied along the y axis in the middle wheel set coordinate system") + } + ), + Plot( + curves = { + Curve(y = wheelSet.frameMiddle.r_0[1], legend = "Position of middle frame of wheels along x axis"), + Curve(y = wheelSet.frameMiddle.r_0[2], legend = "Position of middle frame of wheels along y axis") + } + ) + } + ) + } + )); end RollingWheelSetPulling; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringDamperSystem.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringDamperSystem.mo index 574e0b4be6..f9c87c64b4 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringDamperSystem.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringDamperSystem.mo @@ -134,5 +134,21 @@ This example demonstrates: \"model -")); +", + figures = { + Figure( + title = "Position of masses", + identifier = "e2f60", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = body1.r_0[2], legend = "Position of body1 with damper and spring"), + Curve(y = body2.r_0[2], legend = "Position of body1 with spring") + } + ) + } + ) + } + )); end SpringDamperSystem; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringMassSystem.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringMassSystem.mo index 96dfee7190..7972481285 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringMassSystem.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringMassSystem.mo @@ -123,5 +123,27 @@ can be utilized: \"model -")); +", + figures = { + Figure( + title = "Positions and forces", + identifier = "0eb0f", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = body1.r_0[2], legend = "Position along y axis of body1"), + Curve(y = body2.r_0[2], legend = "Position along y axis of body2") + } + ), + Plot( + curves = { + Curve(y = spring1.f, legend = "Force along y axis of body1"), + Curve(y = spring2.spring.f, legend = "Force along y axis of body2") + } + ) + } + ) + } + )); end SpringMassSystem; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringWithMass.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringWithMass.mo index 715b7da7d7..d03e821318 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringWithMass.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/SpringWithMass.mo @@ -44,5 +44,26 @@ light blue, sphere. \"model -")); +", + figures = { + Figure( + title = "Elongation of spring", + identifier = "f7644", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = spring.lineForce.length, legend = "Elongation of spring") + } + ), + Plot( + curves = { + Curve(y = spring.lengthFraction, legend = "Fraction of distance from frame_a to frame_b where mass in spring is located"), + Curve(y = spring.m, legend = "Mass of springMass") + } + ) + } + ) + } + )); end SpringWithMass; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/ThreeSprings.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/ThreeSprings.mo index 09735a44d1..39870498fb 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/ThreeSprings.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/ThreeSprings.mo @@ -110,5 +110,29 @@ alt=\"model Examples.Elementary.ThreeSprings\"> For a more thorough explanation, see MultiBody.UsersGuide.Tutorial.ConnectionOfLineForces.

-")); +", + figures = { + Figure( + title = "Spring elongations and forces", + identifier = "e80de", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = spring1.spring.f, legend = "Force in spring1"), + Curve(y = spring2.spring.f, legend = "Force in spring2"), + Curve(y = spring3.spring.f, legend = "Force in spring3") + } + ), + Plot( + curves = { + Curve(y = spring1.spring.s_rel, legend = "Elongation of spring1"), + Curve(y = spring2.spring.s_rel, legend = "Elongation of spring2"), + Curve(y = spring3.spring.s_rel, legend = "Elongation of spring3") + } + ) + } + ) + } + )); end ThreeSprings; diff --git a/Modelica/Mechanics/MultiBody/Examples/Elementary/UserDefinedGravityField.mo b/Modelica/Mechanics/MultiBody/Examples/Elementary/UserDefinedGravityField.mo index 1becd29f7c..30beba3a94 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Elementary/UserDefinedGravityField.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Elementary/UserDefinedGravityField.mo @@ -74,5 +74,20 @@ the rotation angle of the pendulum, rev.phi, has the following values: = 90 = -2.42 rad -")); +", + figures = { + Figure( + title = "Angle of revolute", + identifier = "8b0fa", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = rev.phi, legend = "RevoluteAngle") + } + ) + } + ) + } + )); end UserDefinedGravityField; diff --git a/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6.mo b/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6.mo index b8ee518da2..0a03f43293 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6.mo @@ -159,5 +159,22 @@ Simulate for 3 s with about 50000 output intervals, and plot the variables engineTorque, and filteredEngineTorque. Note, the result file has a size of about 300 Mbyte in this case. The default setting of StopTime = 1.01 s (with the default setting of the tool for the number of output points), in order that (automatic) regression testing does not have to cope with a large result file.

-"), experiment(StopTime=1.01), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,100}}))); +", + figures = { + Figure( + title = "Engine speed and torque", + identifier = "9d32b", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = engineSpeed_rpm), + Curve(y = engineTorque), + Curve(y = filteredEngineTorque) + } + ) + } + ) + } + ), experiment(StopTime=1.01), Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-120,-100},{120,100}}))); end EngineV6; diff --git a/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6_analytic.mo b/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6_analytic.mo index 42ce42fc4f..e26c8385a4 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6_analytic.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Loops/EngineV6_analytic.mo @@ -81,5 +81,22 @@ Simulate for 3 s with about 50000 output intervals, and plot the variables -"), experiment(StopTime=1.01)); +", + figures = { + Figure( + title = "Engine speed and torque", + identifier = "33d57", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = engineSpeed_rpm), + Curve(y = engineTorque), + Curve(y = filteredEngineTorque) + } + ) + } + ) + } + ), experiment(StopTime=1.01)); end EngineV6_analytic; diff --git a/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar1.mo b/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar1.mo index 2f4598f703..5f8416b36b 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar1.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar1.mo @@ -122,5 +122,31 @@ of revolute joint j1 is set to 300 deg/s in order to drive this loop.

\"model
-")); +", + figures = { + Figure( + title = "j1 and j2", + identifier = "75e97", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = j1_phi, legend = "Angle of revolute joint j1") + } + ), + Plot( + curves = { + Curve(y = j2_s, legend = "Distance of prismatic joint j2") + } + ), + Plot( + curves = { + Curve(y = j1_w, legend = "Angular velocity of revolute joint j1"), + Curve(y = j2_v, legend = "Velocity of revolute joint j2") + } + ) + } + ) + } + )); end Fourbar1; diff --git a/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar2.mo b/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar2.mo index 989bdabb48..1db4d14594 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar2.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar2.mo @@ -124,5 +124,31 @@ for rodLength:
 rodLength*rodLength = f(angle of revolute joint, distance of prismatic joint)
 
-")); +", + figures = { + Figure( + title = "Joints j1 and j2", + identifier = "42bb2", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = j1_phi, legend = "Angle of revolute joint j1") + } + ), + Plot( + curves = { + Curve(y = j2_s, legend = "Distance of prismatic joint j2") + } + ), + Plot( + curves = { + Curve(y = j1_w, legend = "Angular velocity of revolute joint j1"), + Curve(y = j2_v, legend = "Velocity of prismatic joint j2") + } + ) + } + ) + } + )); end Fourbar2; diff --git a/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar_analytic.mo b/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar_analytic.mo index cae7b6d769..10e63e4325 100644 --- a/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar_analytic.mo +++ b/Modelica/Mechanics/MultiBody/Examples/Loops/Fourbar_analytic.mo @@ -94,5 +94,31 @@ form without solving a system of equations. For more details, see MultiBody.UsersGuide.Tutorial.LoopStructures.AnalyticLoopHandling.

-")); +", + figures = { + Figure( + title = "Joints j1 and j2", + identifier = "bb174", + preferred = true, + plots = { + Plot( + curves = { + Curve(y = j1_phi, legend = "Angle of revolute joint j1") + } + ), + Plot( + curves = { + Curve(y = j2_s, legend = "Distance of prismatic joint j2 (jointSSP.prismatic)") + } + ), + Plot( + curves = { + Curve(y = j1_w, legend = "Angular velocity of revolute joint j1"), + Curve(y = j2_v, legend = "Velocity of prismatic joint j2 (jointSSP.prismatic)") + } + ) + } + ) + } + )); end Fourbar_analytic;