modelSpring
Extends from Interfaces.PartialTwoFrames (Base model for components providing two frame connectors + outer world + assert to guarantee that the component is connected).
Information
Linear spring acting as line force between frame_a and frame_b. A force f is exerted on the origin of frame_b and with opposite sign on the origin of frame_a along the line from the origin of frame_a to the origin of frame_b according to the equation:
f = c*(s - s_unstretched);
where "c" and "s_unstretched" are parameters and "s" is the distance between the origin of frame_a and the origin of frame_b.
Optionally, the mass of the spring is taken into account by a point mass located on the line between frame_a and frame_b (default: middle of the line). If the spring mass is zero, the additional equations to handle the mass are removed.
In the following figure a typical animation of the spring is shown. The blue sphere in the middle of the spring characterizes the location of the point mass.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | animation | true | = true, if animation shall be enabled |
| Boolean | showMass | true | = true, if point mass shall be visualized as sphere if animation=true and m>0 |
| SI.TranslationalSpringConstant | c | Spring constant | |
| SI.Length | s_unstretched | 0 | Unstretched spring length |
| SI.Mass | m | 0 | Spring mass located on the connection line between the origin of frame_a and the origin of frame_b |
| Real | lengthFraction | 0.5 | Location of spring mass with respect to frame_a as a fraction of the distance from frame_a to frame_b (=0: at frame_a; =1: at frame_b) |
| Animation › if animation = true | |||
| Integer | numberOfWindings | 5 | Number of spring windings |
| Advanced | |||
| SI.Distance | s_small | 1e-10 | Prevent zero-division if distance between frame_a and frame_b is zero |
| Advanced › If enabled, can give wrong results, see MultiBody.UsersGuide.Tutorial.ConnectionOfLineForces | |||
| Boolean | fixedRotationAtFrame_a | false | = true, if rotation frame_a.R is fixed (to directly connect line forces) |
| Boolean | fixedRotationAtFrame_b | false | = true, if rotation frame_b.R is fixed (to directly connect line forces) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Interfaces.Frame_a | frame_a (from PartialTwoFrames) | Coordinate system a fixed to the component with one cut-force and cut-torque | |
| Interfaces.Frame_b | frame_b (from PartialTwoFrames) | Coordinate system b fixed to the component with one cut-force and cut-torque |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Distance | width | world.defaultForceWidth | Width of spring |
| SI.Distance | coilWidth | width/10 | Width of spring coil |
| Types.Color | color | Modelica.Mechanics.MultiBody.Types.Defaults.SpringColor | Color of spring |
| Types.SpecularCoefficient | specularCoefficient | world.defaultSpecularCoefficient | Reflection of ambient light (= 0: light is completely absorbed) |
| SI.Diameter | massDiameter | max(0, (width - 2*coilWidth)*0.9) | Diameter of mass point sphere |
| Types.Color | massColor | Modelica.Mechanics.MultiBody.Types.Defaults.BodyColor | Color of mass point |
| SI.Position[3] | r_rel_a | Position vector from origin of frame_a to origin of frame_b, resolved in frame_a | |
| Real[3] | e_a | Unit vector on the line connecting the origin of frame_a with the origin of frame_b resolved in frame_a (directed from frame_a to frame_b) | |
| SI.Force | f | Line force acting on frame_a and on frame_b (positive, if acting on frame_b and directed from frame_a to frame_b) | |
| SI.Distance | length | Distance between the origin of frame_a and the origin of frame_b | |
| SI.Position | s | (Guarded) distance between the origin of frame_a and the origin of frame_b (>= s_small)) | |
| SI.Position[3] | r_rel_0 | Position vector from frame_a to frame_b resolved in world frame | |
| Real[3] | e_rel_0 | Unit vector in direction from frame_a to frame_b, resolved in world frame | |
| Forces.LineForceWithMass | lineForce | ||
| Modelica.Mechanics.Translational.Components.Spring | spring |