Package Modelica.​Mechanics.​MultiBody.​Examples.​Loops
Examples with kinematic loops

Information

This package contains different examples to show how mechanical systems with kinematic loops can be modeled.

Content

ModelDescription
Engine1a
Engine1b
Engine1b_analytic
Model of one cylinder engine (Engine1a: simple, without combustion; Engine1b: with combustion; Engine1b_analytic: same as Engine1b but analytic loop handling)
EngineV6
EngineV6_analytic
V6 engine with 6 cylinders, 6 planar loops and 1 degree-of-freedom. Second version with analytic handling of kinematic loops and CAD data animation.
Fourbar1 One kinematic loop with four bars (with only revolute joints; 5 non-linear equations)
Fourbar2 One kinematic loop with four bars (with UniversalSpherical joint; 1 non-linear equation)
Fourbar_analytic One kinematic loop with four bars (with JointSSP joint; analytic solution of non-linear algebraic loop)
PlanarFourbar Planar four bars with one kinematic loop (with RevolutePlanarLoopConstraint joint)
PlanarLoops_analytic Mechanism with three planar kinematic loops and one degree-of-freedom with analytic loop handling (with JointRRR joints)

Extends from Modelica.​Icons.​ExamplesPackage (Icon for packages containing runnable examples).

Package Contents

NameDescription
Engine1aModel of one cylinder engine
Engine1bModel of one cylinder engine with gas force and preparation for assembly joint JointRRP
Engine1b_analyticModel of one cylinder engine with gas force and analytic loop handling
EngineV6V6 engine with 6 cylinders, 6 planar loops and 1 degree-of-freedom
EngineV6_analyticV6 engine with 6 cylinders, 6 planar loops, 1 degree-of-freedom and analytic handling of kinematic loops
Fourbar1One kinematic loop with four bars (with only revolute joints; 5 non-linear equations)
Fourbar2One kinematic loop with four bars (with UniversalSpherical joint; 1 non-linear equation)
Fourbar_analyticOne kinematic loop with four bars (with JointSSP joint; analytic solution of non-linear algebraic loop)
PlanarFourbarPlanar four bars mechanism with one kinematic loop (with RevolutePlanarLoopConstraint joint)
PlanarLoops_analyticMechanism with three planar kinematic loops and one degree-of-freedom with analytic loop handling (with JointRRR joints)
UtilitiesUtility models for Examples.Loops

Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Engine1a
Model of one cylinder engine

Information

This is a model of the mechanical part of one cylinder of an engine. The combustion is not modelled. The "inertia" component at the lower left part is the output inertia of the engine driving the gearbox. The angular velocity of the output inertia has a start value of 10 rad/s in order to demonstrate the movement of the engine.

The engine is modeled solely by revolute and prismatic joints. Since this results in a planar loop there is the well known difficulty that the cut-forces perpendicular to the loop cannot be uniquely computed, as well as the cut-torques within the plane. This ambiguity is resolved by using the option planarCutJoint in the Advanced menu of one revolute joint in every planar loop (here: joint B1). This option sets the cut-force in direction of the axis of rotation, as well as the cut-torques perpendicular to the axis of rotation at this joint to zero and makes the problem mathematically well-formed.

An animation of this example is shown in the figure below.

model Examples.Loops.Engine

Extends from Modelica.​Icons.​Example (Icon for runnable examples).


Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Engine1b
Model of one cylinder engine with gas force and preparation for assembly joint JointRRP

Information

This is a model of the mechanical part of one cylinder of an engine. It is similar to Loops.Engine1a. The difference is that a simple model for the gas force in the cylinder is added and that the model is restructured in such a way, that the central part of the planar kinematic loop can be easily replaced by the assembly joint "Modelica.Mechanics.MultiBody.Joints.Assemblies.JointRRP". This exchange of the kinematic loop is shown in Loops.Engine1b_analytic. The advantage of using JointRRP is, that the non-linear algebraic equation of this loop is solved analytically, and not numerically as in this model (Engine1b).

An animation of this example is shown in the figure below.

model Examples.Loops.Engine

Extends from Modelica.​Icons.​Example (Icon for runnable examples) and Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Utilities.​Engine1bBase (Model of one cylinder engine with gas force).


Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Engine1b_analytic
Model of one cylinder engine with gas force and analytic loop handling

Information

This is the same model as Loops.Engine1b. The only difference is that the central part of the planar kinematic loop has been replaced by the assembly joint "Modelica.Mechanics.MultiBody.Joints.Assemblies.JointRRP". The advantage of using JointRRP is, that the non-linear algebraic equation of this loop is solved analytically, and not numerically as in Loops.Engine1b.

An animation of this example is shown in the figure below.

model Examples.Loops.Engine

Extends from Modelica.​Icons.​Example (Icon for runnable examples) and Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Utilities.​Engine1bBase (Model of one cylinder engine with gas force).


Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​EngineV6
V6 engine with 6 cylinders, 6 planar loops and 1 degree-of-freedom

Information

This is a V6 engine with 6 cylinders. It is hierarchically built up by using instances of one cylinder. For more details on the modeling of one cylinder, see example Engine1b. An animation of the engine is shown in the figure below.

model Examples.Loops.EngineV6

Simulate for 3 s with about 50000 output intervals, and plot the variables engineSpeed_rpm, 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.

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled

Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​EngineV6_analytic
V6 engine with 6 cylinders, 6 planar loops, 1 degree-of-freedom and analytic handling of kinematic loops

Information

This is a similar model as the example "EngineV6". However, the cylinders have been built up with component Modelica.Mechanics.MultiBody.Joints.Assemblies.JointRRR that solves the non-linear system of equations in an aggregation of 3 revolution joints analytically and only one body is used that holds the total mass of the crank shaft:

This model is about 20 times faster as the EngineV6 example and no linear or non-linear system of equations occur. In contrast, the "EngineV6" example leads to 6 systems of nonlinear equations (every system has dimension = 5, with Evaluate=false and dimension=1 with Evaluate=true) and a linear system of equations of about 40. This shows the power of the analytic loop handling.

Simulate for 3 s with about 50000 output intervals, and plot the variables engineSpeed_rpm, engineTorque, and filteredEngineTorque. Note, the result file has a size of about 240 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.

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled

Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Fourbar1
One kinematic loop with four bars (with only revolute joints; 5 non-linear equations)

Information

This is a simple kinematic loop consisting of 6 revolute joints, 1 prismatic joint and 4 bars that is often used as basic constructing unit in mechanisms. This example demonstrates that usually no particular knowledge of the user is needed to handle kinematic loops. Just connect the joints and bodies together according to the real system. In particular no cut-joints or a spanning tree has to be determined. In this case, the initial condition of the angular velocity of revolute joint j1 is set to 300 deg/s in order to drive this loop.

model Examples.Loops.Fourbar1

Extends from Modelica.​Icons.​Example (Icon for runnable examples).


Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Fourbar2
One kinematic loop with four bars (with UniversalSpherical joint; 1 non-linear equation)

Information

This is a second version of the "four-bar" mechanism, see figure:

model Examples.Loops.Fourbar2

In this case the three revolute joints on the left top-side and the two revolute joints on the right top side have been replaced by the joint UniversalSpherical that is a rod connecting a spherical and a universal joint. This joint is defined by 1 constraint stating that the distance between the two spherical joints is constant. Using this joint in a kinematic loop reduces the sizes of non-linear algebraic equations. For this loop, only one non-linear algebraic system of equations of order 1 remains.

At the UniversalSpherical joint an additional frame_ia fixed to the rod is present where components can be attached to the connecting rod. In this example just a coordinate system is attached to visualize frame_ia (coordinate system on the right in blue color).

Another feature is that the length of the connecting rod can be automatically calculated during initialization. In order to do this, another initialization condition has to be given. In this example, the initial value of the distance of the prismatic joint j2 has been fixed (via the "Initialization" menu) and the rod length of joint "UniversalSpherical" is computed during initialization since parameter computeLength = true is set in the joint parameter menu. The main advantage is that during initialization no non-linear system of equation is solved and therefore initialization always works. To be precise, the following trivial non-linear equation is actually solved for rodLength:

   rodLength*rodLength = f(angle of revolute joint, distance of prismatic joint)

Extends from Modelica.​Icons.​Example (Icon for runnable examples).


Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​Fourbar_analytic
One kinematic loop with four bars (with JointSSP joint; analytic solution of non-linear algebraic loop)

Information

This is a third version of the "four-bar" mechanism, see figure:

model Examples.Loops.Fourbar_analytic

In this case the three revolute joints on the left top-side and the two revolute joints on the right top side have been replaced by the assembly joint Joints.Assemblies.JointSSP which consists of two spherical joints and one prismatic joint. Since JointSSP solves the non-linear constraint equation internally analytically, no non-linear equation appears any more and a Modelica translator can transform the system into state space form without solving a system of equations. For more details, see MultiBody.UsersGuide.Tutorial.LoopStructures.AnalyticLoopHandling.

Extends from Modelica.​Icons.​Example (Icon for runnable examples).


Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​PlanarFourbar
Planar four bars mechanism with one kinematic loop (with RevolutePlanarLoopConstraint joint)

Information

A planar four link mechanism demonstrating possible usage of the RevolutePlanarLoopConstraint. In this planar example, all the revolute joints rotate about axes perpendicular to the x-y plane, i.e. they all are parallel to each other. To enable a unique numerical solution in such a case, one RevolutePlanarLoopConstraint has to be introduced instead of the common revolute joint.

Another option is to use the assembly joint Joints.Assemblies.JointRRR instead of a part of the mechanism, as demonstrated in the example PlanarLoops_analytic.

model Examples.Loops.PlanarFourbar

Extends from Modelica.​Icons.​Example (Icon for runnable examples).


Model Modelica.​Mechanics.​MultiBody.​Examples.​Loops.​PlanarLoops_analytic
Mechanism with three planar kinematic loops and one degree-of-freedom with analytic loop handling (with JointRRR joints)

Information

It is demonstrated how the Modelica.Mechanics.MultiBody.Joints.Assemblies.JointRRR joint can be used to solve the non-linear equations of coupled planar loops analytically. In the mechanism below no non-linear equation occurs any more from the tool view, since these equations are solved analytically in the JointRRR joints. For more details, see MultiBody.UsersGuide.Tutorial.LoopStructures.AnalyticLoopHandling.

In the following figure the parameter vectors of this example are visualized in the animation view.

model Examples.Loops.PlanarLoops2

Extends from Modelica.​Icons.​Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Lengthrh[3]{0.5, 0, 0}Position vector from 'lower left' revolute to 'lower right' revolute joint for all the 3 loops
Lengthrv[3]{0, 0.5, 0}Position vector from 'lower left' revolute to 'upper left' revolute joint in the first loop
Lengthr1b[3]{0.1, 0.5, 0}Position vector from 'lower right' revolute to 'upper right' revolute joint in the first loop
final Lengthr1a[3]r1b + rh - rvPosition vector from 'upper left' revolute to 'upper right' revolute joint in the first loop
Lengthr2b[3]{0.1, 0.6, 0}Position vector from 'lower right' revolute to 'upper right' revolute joint in the second loop
final Lengthr2a[3]r2b + rh - r1bPosition vector from 'upper left' revolute to 'upper right' revolute joint in the second loop
Lengthr3b[3]{0, 0.55, 0}Position vector from 'lower right' revolute to 'upper right' revolute joint in the third loop
final Lengthr3a[3]r3b + rh - r2bPosition vector from 'upper left' revolute to 'upper right' revolute joint in the third loop

Generated 2018-12-12 12:12:23 EST by MapleSim.