modelSpring

Linear translational spring with optional mass

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.

model Examples.Elementary.SpringWithMass

Parameters

TypeNameDefaultDescription
Booleananimationtrue= true, if animation shall be enabled
BooleanshowMasstrue= true, if point mass shall be visualized as sphere if animation=true and m>0
SI.TranslationalSpringConstantcSpring constant
SI.Lengths_unstretched0Unstretched spring length
SI.Massm0Spring mass located on the connection line between the origin of frame_a and the origin of frame_b
ReallengthFraction0.5Location 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
IntegernumberOfWindings5Number of spring windings
Advanced
SI.Distances_small1e-10Prevent zero-division if distance between frame_a and frame_b is zero
Advanced › If enabled, can give wrong results, see MultiBody.UsersGuide.Tutorial.ConnectionOfLineForces
BooleanfixedRotationAtFrame_afalse= true, if rotation frame_a.R is fixed (to directly connect line forces)
BooleanfixedRotationAtFrame_bfalse= true, if rotation frame_b.R is fixed (to directly connect line forces)

Connectors

TypeNameDefaultDescription
Interfaces.Frame_aframe_a (from PartialTwoFrames)Coordinate system a fixed to the component with one cut-force and cut-torque
Interfaces.Frame_bframe_b (from PartialTwoFrames)Coordinate system b fixed to the component with one cut-force and cut-torque

Components

TypeNameDefaultDescription
SI.Distancewidthworld.defaultForceWidthWidth of spring
SI.DistancecoilWidthwidth/10Width of spring coil
Types.ColorcolorModelica.Mechanics.MultiBody.Types.Defaults.SpringColorColor of spring
Types.SpecularCoefficientspecularCoefficientworld.defaultSpecularCoefficientReflection of ambient light (= 0: light is completely absorbed)
SI.DiametermassDiametermax(0, (width - 2*coilWidth)*0.9)Diameter of mass point sphere
Types.ColormassColorModelica.Mechanics.MultiBody.Types.Defaults.BodyColorColor of mass point
SI.Position[3]r_rel_aPosition vector from origin of frame_a to origin of frame_b, resolved in frame_a
Real[3]e_aUnit 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.ForcefLine force acting on frame_a and on frame_b (positive, if acting on frame_b and directed from frame_a to frame_b)
SI.DistancelengthDistance between the origin of frame_a and the origin of frame_b
SI.Positions(Guarded) distance between the origin of frame_a and the origin of frame_b (>= s_small))
SI.Position[3]r_rel_0Position vector from frame_a to frame_b resolved in world frame
Real[3]e_rel_0Unit vector in direction from frame_a to frame_b, resolved in world frame
Forces.LineForceWithMasslineForce
Modelica.Mechanics.Translational.Components.Springspring