There are mainly three types of force elements:
Elements of this package do not create rigid connections and therefore do not close kinematic loops.
| Name | Description |
|---|---|
| linear damping element | |
| linear spring element | |
| world force acting on frame | |
| world torque acting on frame | |
| body force acting on frame | |
| body torque acting on frame | |
| force acting between two frames | |
| torque acting between two frames | |
| soft impact between two spheres |
MultiBondLib.Mechanics3D.Forces.Damping
The damper generates a counteracting force that is proportional to the relative velocity.
The damping coefficient can be set by the parameter d.
| Type | Name | Default | Description |
|---|---|---|---|
| Real | d | 0 | Damping constant [N.s/m] |
| Type | Name | Description |
|---|---|---|
| Frame_a | frame_a | |
| Frame_b | frame_b |
model Damping "linear damping element"
parameter Real d(
final unit="N.s/m",
final min=0) = 0 "Damping constant";
Interfaces.Frame_a frame_a;
Interfaces.Frame_b frame_b;
protected
inner Defaults MBG_defaults(n=3);
Interfaces.Mech2MBG Mech2MBG1;
Interfaces.MBG2Mech MBG2Mech1;
Junctions.J0 J0_1(n=3);
Passive.R R1(R={d}, n=3);
Junctions.J0 J0_2(n=3);
Sources.Se Se1(n=3, e0={0});
Bonds.MultiBond MultiBond8;
Bonds.MultiBond MultiBond3;
Bonds.MultiBond MultiBond1;
Bonds.MultiBond MultiBond2;
Bonds.MultiBond MultiBond4;
Bonds.MultiBond MultiBond5;
Bonds.Utilities.MultiBondTail MultiBondTail2;
Bonds.Utilities.MultiBondTail MultiBondTail1;
Bonds.Utilities.MultiBondTail MultiBondTail3;
Bonds.Utilities.MultiBondTail MultiBondTail4;
equation
connect(Mech2MBG1.frame_a, frame_a);
connect(MultiBond1.MultiBondCon2, J0_1.MultiBondCon1);
connect(MultiBond4.MultiBondCon2,J0_2. MultiBondCon1);
connect(MultiBond8.MultiBondCon2, J0_2.MultiBondCon3);
connect(MultiBond8.MultiBondCon1, Se1.MultiBondCon1);
connect(MultiBond5.MultiBondCon2, J0_2.MultiBondCon2);
connect(J0_1.MultiBondCon2, MultiBond2.MultiBondCon2);
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond3.MultiBondCon1, J0_1.MultiBondCon4);
connect(R1.MultiBondCon1, MultiBond3.MultiBondCon2);
connect(MultiBond4.MultiBondCon1, Mech2MBG1.MultiBondConRot);
connect(MultiBond5.MultiBondCon1, MBG2Mech1.MultiBondConRot);
connect(MultiBond2.MultiBondCon1, MBG2Mech1.MultiBondConTrans);
connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondConTrans);
end Damping;
MultiBondLib.Mechanics3D.Forces.Spring
The spring generates a counteracting force that is linear dependent on the positional shift.
The spring coefficient can be set by the parameter c. The rest lenght can be specified by the parameter s0.
A spring with a rest length s0 unequal to zero, has a stiff behavior if its length is approaching zero. The parameter s_small in the advanced menu reduces this stiffness for spring lengths ranging from zero up to s_small.
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | animation | true | animate spring |
| Real | c | 0 | Spring constant [N/m] |
| Position | s0 | 0 | rest length of spring [m] |
| Advanced | |||
| Position | s_small | 1e-4 | critical Spring length [m] |
| Animation | |||
| if animation = true | |||
| Distance | width | world3D.defaultForceWidth | Width of spring [m] |
| Distance | coilWidth | width/5 | Width of spring coil [m] |
| Integer | numberOfWindings | 5 | Number of spring windings |
| Color | color[3] | world3D.defaultForceElementC... | Color of spring |
| Type | Name | Description |
|---|---|---|
| Frame_a | frame_a | |
| Frame_b | frame_b |
model Spring "linear spring element"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_a frame_a;
Interfaces.Frame_b frame_b;
parameter Boolean animation = true "animate spring";
parameter Real c(
final unit="N/m",
final min=0) = 0 "Spring constant";
parameter SI.Position s0 = 0 "rest length of spring";
parameter SI.Position s_small = 1e-4 "|Advanced||critical Spring length";
parameter SI.Distance width= world3D.defaultForceWidth
"|Animation|if animation = true| Width of spring";
parameter SI.Distance coilWidth=width/5
"|Animation|if animation = true| Width of spring coil";
parameter Integer numberOfWindings=5
"|Animation|if animation = true| Number of spring windings";
parameter MB.Types.Color color= world3D.defaultForceElementColor
"|Animation|if animation = true| Color of spring";
SI.Distance s;
SI.Distance d[3];
SI.Force f[3];
protected
outer World3D world3D;
inner Defaults MBG_defaults(n=3);
Interfaces.MBG2Mech MBG2Mech1;
Interfaces.Mech2MBG Mech2MBG1;
Junctions.J0 J0_1(n=3);
Junctions.J0 J0_2(n=3);
Sources.Se Se1(n=3, e0={0});
Sources.mSe mSe1(n=3);
Bonds.MultiBond MultiBond8;
Bonds.MultiBond MultiBond3;
Bonds.MultiBond MultiBond1;
Bonds.MultiBond MultiBond2;
Bonds.MultiBond MultiBond4;
Bonds.MultiBond MultiBond5;
Bonds.Utilities.MultiBondTail MultiBondTail2;
Bonds.Utilities.MultiBondTail MultiBondTail1;
Bonds.Utilities.MultiBondTail MultiBondTail3;
Bonds.Utilities.MultiBondTail MultiBondTail4;
parameter Integer ndim=if world3D.enableAnimation and animation then 1 else 0;
MB.Visualizers.Advanced.Shape springShape[ndim](
each shapeType="spring",
each color=color,
each length=s,
each width=width,
each height=coilWidth,
each lengthDirection=d,
each widthDirection={0,0,1},
each r_shape={0,0,0},
each r=MBG2Mech1.x,
each extra=numberOfWindings,
each R=MB.Frames.Orientation(T=identity(3),w=zeros(3)));
equation
//equations to compute the spring force
d = Mech2MBG1.x - MBG2Mech1.x;
s = sqrt(d*d);
f = if s >= s_small then c*d - s0*c*(d/s) else c*d - s0*c*(d/s_small);
mSe1.s = f;
connect(Mech2MBG1.frame_a, frame_a);
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond1.MultiBondCon2, J0_1.MultiBondCon1);
connect(MultiBond4.MultiBondCon2,J0_2. MultiBondCon1);
connect(MultiBond5.MultiBondCon2, J0_2.MultiBondCon2);
connect(MultiBond3.MultiBondCon2, J0_1.MultiBondCon4);
connect(mSe1.MultiBondCon1, MultiBond3.MultiBondCon1);
connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondConTrans);
connect(MultiBond8.MultiBondCon2, J0_2.MultiBondCon3);
connect(Se1.MultiBondCon1, MultiBond8.MultiBondCon1);
connect(MultiBond5.MultiBondCon1, MBG2Mech1.MultiBondConRot);
connect(MultiBond4.MultiBondCon1, Mech2MBG1.MultiBondConRot);
connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(MultiBond2.MultiBondCon1, J0_1.MultiBondCon2);
end Spring;
MultiBondLib.Mechanics3D.Forces.WorldForce
The force vector has to be given by an input signal and is resolved in the inertial system.
| Type | Name | Description |
|---|---|---|
| Frame_b | frame_b | |
| input RealInput | force[3] |
model WorldForce "world force acting on frame"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_b frame_b;
protected
outer World3D world3D;
inner Defaults MBG_defaults(n=3);
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Sources.Se Se2(n=3, e0={0});
Bonds.MultiBond MultiBond4;
public
Modelica.Blocks.Interfaces.RealInput force[3];
Sources.mSe mSe1;
equation
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondConRot);
connect(Se2.MultiBondCon1, MultiBond1.MultiBondCon1);
connect(MultiBond4.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(mSe1.MultiBondCon1, MultiBond4.MultiBondCon1);
connect(force, mSe1.s);
end WorldForce;
MultiBondLib.Mechanics3D.Forces.WorldTorque
The torque vector has to be given by an input signal and is resolved in the inertial system.
| Type | Name | Description |
|---|---|---|
| Frame_b | frame_b | |
| input RealInput | torque[3] |
model WorldTorque "world torque acting on frame"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_b frame_b;
protected
outer World3D world3D;
inner Defaults MBG_defaults(n=3);
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Sources.Se Se1(e0={0});
Bonds.MultiBond MultiBond4;
Passive.mTF_effort mTF_effort1;
Bonds.MultiBond MultiBond2;
public
Sources.mSe mSe1;
Modelica.Blocks.Interfaces.RealInput torque[3];
equation
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond4.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConRot);
connect(mTF_effort1.MultiBondCon2, MultiBond2.MultiBondCon1);
connect(mTF_effort1.MultiBondCon1, MultiBond1.MultiBondCon2);
connect(mTF_effort1.M, MBG2Mech1.R);
connect(torque, mSe1.s);
connect(mSe1.MultiBondCon1, MultiBond1.MultiBondCon1);
end WorldTorque;
MultiBondLib.Mechanics3D.Forces.BodyForce
The force vector has to be given by an input signal and is resolved in the corresponding body system.
| Type | Name | Description |
|---|---|---|
| Frame_b | frame_b | |
| input RealInput | force[3] |
model BodyForce "body force acting on frame"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_b frame_b;
protected
outer World3D world3D;
inner Defaults MBG_defaults(n=3);
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Sources.Se Se2(n=3, e0={0});
Bonds.MultiBond MultiBond4;
public
Modelica.Blocks.Interfaces.RealInput force[3];
Sources.mSe mSe1;
protected
Passive.mTF_effort mTF_effort1;
Bonds.MultiBond MultiBond2;
equation
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondConRot);
connect(Se2.MultiBondCon1, MultiBond1.MultiBondCon1);
connect(MultiBond4.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(force, mSe1.s);
connect(MultiBond2.MultiBondCon1, mSe1.MultiBondCon1);
connect(mTF_effort1.MultiBondCon1, MultiBond2.MultiBondCon2);
connect(MultiBond4.MultiBondCon1, mTF_effort1.MultiBondCon2);
connect(MBG2Mech1.R, mTF_effort1.M);
end BodyForce;
MultiBondLib.Mechanics3D.Forces.BodyTorque
The torque vector has to be given by an input signal and is resolved in the corresponding body system.
| Type | Name | Description |
|---|---|---|
| Frame_b | frame_b | |
| input RealInput | torque[3] |
model BodyTorque "body torque acting on frame"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_b frame_b;
protected
outer World3D world3D;
inner Defaults MBG_defaults(n=3);
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Sources.Se Se1(e0={0});
Bonds.MultiBond MultiBond4;
public
Sources.mSe mSe1;
Modelica.Blocks.Interfaces.RealInput torque[3];
equation
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond4.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
connect(torque, mSe1.s);
connect(mSe1.MultiBondCon1, MultiBond1.MultiBondCon1);
connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondConRot);
end BodyTorque;
MultiBondLib.Mechanics3D.Forces.Force
The force vector has to be given by an input signal. The force acts from frame a on frame b and is resolved in the body system of frame a.
| Type | Name | Description |
|---|---|---|
| Frame_b | frame_b | |
| input RealInput | force[3] | |
| Frame_a | frame_a |
model Force "force acting between two frames"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_b frame_b;
protected
outer World3D world3D;
inner Defaults MBG_defaults(n=3);
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Sources.Se Se2(n=3, e0={0});
Bonds.MultiBond MultiBond4;
public
Modelica.Blocks.Interfaces.RealInput force[3];
Sources.mSe mSe1;
Interfaces.Frame_a frame_a;
Interfaces.Mech2MBG mech2MBG;
protected
Bonds.MultiBond MultiBond2;
Bonds.MultiBond MultiBond3;
public
Junctions.J0 j0_1;
Junctions.J0 j0_2;
protected
Bonds.MultiBond MultiBond5;
Bonds.MultiBond MultiBond6;
public
Bonds.Utilities.MultiBondTail multiBondTail;
Bonds.Utilities.MultiBondTail multiBondTail1;
Bonds.Utilities.MultiBondTail multiBondTail2;
Bonds.Utilities.MultiBondTail multiBondTail3;
protected
Bonds.MultiBond MultiBond7;
public
Passive.mTF_flow mTF_flow;
equation
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondConRot);
connect(MultiBond4.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(force, mSe1.s);
connect(mech2MBG.frame_a, frame_a);
connect(MultiBond4.MultiBondCon1, j0_1.MultiBondCon2);
connect(MultiBond1.MultiBondCon1, j0_2.MultiBondCon2);
connect(MultiBond3.MultiBondCon2, j0_2.MultiBondCon1);
connect(MultiBond2.MultiBondCon2, j0_1.MultiBondCon1);
connect(MultiBond2.MultiBondCon1, mech2MBG.MultiBondConTrans);
connect(MultiBond3.MultiBondCon1, mech2MBG.MultiBondConRot);
connect(MultiBond6.MultiBondCon1, Se2.MultiBondCon1);
connect(MultiBond7.MultiBondCon1, mSe1.MultiBondCon1);
connect(MultiBond5.MultiBondCon2, j0_1.MultiBondCon4);
connect(MultiBond6.MultiBondCon2, j0_2.MultiBondCon4);
connect(mTF_flow.MultiBondCon2, MultiBond7.MultiBondCon2);
connect(mTF_flow.MultiBondCon1, MultiBond5.MultiBondCon1);
connect(mech2MBG.R, mTF_flow.M);
end Force;
MultiBondLib.Mechanics3D.Forces.Torque
The torque vector has to be given by an input signal. The torque acts from frame a on frame b and is resolved in the body system of frame a.
| Type | Name | Description |
|---|---|---|
| Frame_b | frame_b | |
| input RealInput | torque[3] | |
| Frame_a | frame_a |
model Torque "torque acting between two frames"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_b frame_b;
protected
outer World3D world3D;
inner Defaults MBG_defaults(n=3);
Interfaces.MBG2Mech MBG2Mech1;
Bonds.MultiBond MultiBond1;
Sources.Se Se2(n=3, e0={0});
Bonds.MultiBond MultiBond4;
public
Modelica.Blocks.Interfaces.RealInput torque[3];
Sources.mSe mSe1;
Interfaces.Frame_a frame_a;
Interfaces.Mech2MBG mech2MBG;
protected
Bonds.MultiBond MultiBond3;
public
Junctions.J0 j0_2;
protected
Bonds.MultiBond MultiBond5;
Bonds.MultiBond MultiBond6;
public
Bonds.Utilities.MultiBondTail multiBondTail3;
protected
Sources.Se Se1(n=3, e0={0});
public
Passive.mTF_effort mTF_effort;
protected
Bonds.MultiBond MultiBond2;
public
Passive.mTF_flow mTF_flow;
protected
Bonds.MultiBond MultiBond7;
equation
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond1.MultiBondCon2, MBG2Mech1.MultiBondConRot);
connect(MultiBond4.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(mech2MBG.frame_a, frame_a);
connect(MultiBond3.MultiBondCon2, j0_2.MultiBondCon1);
connect(MultiBond3.MultiBondCon1, mech2MBG.MultiBondConRot);
connect(mSe1.MultiBondCon1, MultiBond6.MultiBondCon1);
connect(MultiBond5.MultiBondCon2, mech2MBG.MultiBondConTrans);
connect(Se2.MultiBondCon1, MultiBond5.MultiBondCon1);
connect(Se1.MultiBondCon1, MultiBond4.MultiBondCon1);
connect(mSe1.s, torque);
connect(mTF_effort.MultiBondCon2, MultiBond1.MultiBondCon1);
connect(mTF_effort.M, MBG2Mech1.R);
connect(mTF_flow.MultiBondCon1, MultiBond2.MultiBondCon1);
connect(mech2MBG.R, mTF_flow.M);
connect(MultiBond7.MultiBondCon2, mTF_flow.MultiBondCon2);
connect(MultiBond7.MultiBondCon1, j0_2.MultiBondCon2);
connect(MultiBond2.MultiBondCon2, mTF_effort.MultiBondCon1);
connect(MultiBond6.MultiBondCon2, j0_2.MultiBondCon4);
end Torque;
MultiBondLib.Mechanics3D.Forces.SoftImpuls_SphereSphere
The spheres are supposed to suround the two connector with the radii ra and rb.
The collision characteristics can be specified by the coefficients of the virtual spring and damper.
| Type | Name | Default | Description |
|---|---|---|---|
| Real | c | 0 | Spring constant [N/m] |
| Real | d | 0 | Damping constant [N.s/m] |
| Radius | ra | 1 | radius of sphere at frame a [m] |
| Radius | rb | 1 | radius of sphere at frame b [m] |
| Advanced | |||
| Position | s_small | 1e-4 | critical Spring length [m] |
| Type | Name | Description |
|---|---|---|
| Frame_a | frame_a | |
| Frame_b | frame_b |
model SoftImpuls_SphereSphere "soft impact between two spheres"
import SI = Modelica.SIunits;
import MB = Modelica.Mechanics.MultiBody;
Interfaces.Frame_a frame_a;
Interfaces.Frame_b frame_b;
parameter Real c(
final unit="N/m",
final min=0) = 0 "Spring constant";
parameter Real d(
final unit="N.s/m",
final min=0) = 0 "Damping constant";
parameter SI.Radius ra = 1 "radius of sphere at frame a";
parameter SI.Radius rb = 1 "radius of sphere at frame b";
parameter SI.Position s_small = 1e-4 "|Advanced||critical Spring length";
// parameter Real muR "friction coefficient";
// parameter SI.Velocity vAdhesion "range of Adhesion";
SI.Distance s;
SI.Distance r[3];
Real eR[3];
SI.Force fI[3];
// SI.Force fR[3];
// SI.Velocity deltaV[3];
// SI.Velocity vR[3];
protected
outer World3D world3D;
protected
inner Defaults MBG_defaults(n=3);
protected
Interfaces.MBG2Mech MBG2Mech1;
Interfaces.Mech2MBG Mech2MBG1;
protected
Junctions.J0 J0_1(n=3);
Junctions.J0 J0_2(n=3);
Sources.Se Se1(n=3, e0={0});
Sources.mSe mSe1(n=3);
Bonds.MultiBond MultiBond8;
Bonds.MultiBond MultiBond3;
Bonds.MultiBond MultiBond1;
Bonds.MultiBond MultiBond2;
Bonds.MultiBond MultiBond4;
Bonds.MultiBond MultiBond5;
Bonds.Utilities.MultiBondTail MultiBondTail2;
Bonds.Utilities.MultiBondTail MultiBondTail1;
Bonds.Utilities.MultiBondTail MultiBondTail3;
Bonds.Utilities.MultiBondTail MultiBondTail4;
equation
//equations to compute the spring force
r = Mech2MBG1.x - MBG2Mech1.x;
s = sqrt(r*r);
eR = if s >= s_small then r/s else r/s_small;
fI = if (s-ra-rb) < 0 then c*(s-ra-rb)*eR else zeros(3);
mSe1.s = fI;
connect(Mech2MBG1.frame_a, frame_a);
connect(MBG2Mech1.frame_b, frame_b);
connect(MultiBond1.MultiBondCon2, J0_1.MultiBondCon1);
connect(MultiBond4.MultiBondCon2,J0_2. MultiBondCon1);
connect(MultiBond5.MultiBondCon2, J0_2.MultiBondCon2);
connect(MultiBond3.MultiBondCon2, J0_1.MultiBondCon4);
connect(mSe1.MultiBondCon1, MultiBond3.MultiBondCon1);
connect(MultiBond1.MultiBondCon1, Mech2MBG1.MultiBondConTrans);
connect(MultiBond8.MultiBondCon2, J0_2.MultiBondCon3);
connect(Se1.MultiBondCon1, MultiBond8.MultiBondCon1);
connect(MultiBond5.MultiBondCon1, MBG2Mech1.MultiBondConRot);
connect(MultiBond4.MultiBondCon1, Mech2MBG1.MultiBondConRot);
connect(MultiBond2.MultiBondCon2, MBG2Mech1.MultiBondConTrans);
connect(MultiBond2.MultiBondCon1, J0_1.MultiBondCon2);
end SoftImpuls_SphereSphere;