The package contains two converter elements, that enable the comfortable wrapping of bondgraphic models.
Name | Description |
---|---|
Frame_a | connector for the mechanical components |
Frame_b | connector for the mechanical components |
Frame | connector for the mechanical components |
Potentials | redundant part of the connector |
MBG2Mech | links the bond graph with the mechanic connector |
Mech2MBG | links the bond graph with the mechanic connector |
connector Frame_a "connector for the mechanical components" extends Frame; end Frame_a;
connector Frame_b "connector for the mechanical components" extends Frame; end Frame_b;
The connectordefines the following potential variables:
The connector defines the following flow variables:
The potential variables are summarized in a record P. So the variable name has to be preceeded by a P. (I. e.: the gain access to the position: Type frame.P.x.)
The variables w and t are resolved in their body system, that is specified by the orientation R. All other variables are resolved in the inertial system.
Do not use this connector directly! Use its two inheritors "Frame_a" and "Frame_b".
connector Frame "connector for the mechanical components" import SI = Modelica.SIunits; Potentials P; flow SI.Force f[3] "Cut-force"; flow SI.Torque t[3] "Cut-torque"; end Frame;
This potential variables form a redundant set of information. This is causing problems by the closure of kinematic loops. To overcome these problems this record also contains the function 'equalityConstraint'.
record Potentials "redundant part of the connector" extends Modelica.Icons.Record; import SI = Modelica.SIunits; SI.Position x[3] "Position"; Real R[3, 3] "Orientation"; SI.Velocity v[3] "Velocity"; SI.AngularVelocity w[3] "angular Velocity"; encapsulated function equalityConstraint "Return the constraint residues to express that two frames have the same orientation" import Modelica; import MultiBondLib.Mechanics3D.Interfaces; extends Modelica.Icons.Function; input Interfaces.Potentials P1; input Interfaces.Potentials P2; output Real residue[6]; algorithm residue := {P1.x[1]-P2.x[1],P1.x[2]-P2.x[2],P1.x[3]-P2.x[3],cross(P1.R[1, :], P1.R[2, :])*P2.R[2, :],-cross(P1.R[1, :], P1.R[2, :])*P2.R[1, :],P1.R[2, :]*P2.R[1, :]}; // residue[1:3] := P1.x-P2.x; // residue[4] := cross(P1.R[1, :], P1.R[2, :])*P2.R[2, :]; // residue[5] := cross(P1.R[1, :], P1.R[2, :])*P2.R[1, :]; // residue[6] := P1.R[2, :]*P2.R[1, :]; end equalityConstraint; end Potentials;
The converter element separates the translational and rotational domain, because the according bondgraphic variables are resolved in different coordinate systems. The bondgraphic variables of the translational domain are resolved in the inertial system, but the variables of the rotational domain are resolved in the body system, which is specified by the rotational matrix R.
model MBG2Mech "links the bond graph with the mechanic connector" import MultiBondLib; MultiBondLib.Interfaces.MultiBondCon MultiBondConTrans(n=3); Frame_b frame_b; MultiBondLib.Interfaces.RealSignal x[3]; MultiBondLib.Interfaces.RealSignal R[3,3]; MultiBondLib.Interfaces.MultiBondCon MultiBondConRot(n=3); equation MultiBondConTrans.e*MultiBondConTrans.d = frame_b.f; MultiBondConRot.e*MultiBondConRot.d = frame_b.t; MultiBondConTrans.f = frame_b.P.v; MultiBondConRot.f = frame_b.P.w; x = frame_b.P.x; R = frame_b.P.R; end MBG2Mech;
The converter element separates the translational and rotational domain, because the according bondgraphic variables are resolved in different coordinate systems. The bondgraphic variables of the translational domain are resolved in the inertial system, but the variables of the rotational domain are resolved in the body system, which is specified by the rotational matrix R.
model Mech2MBG "links the bond graph with the mechanic connector" import MultiBondLib; Frame_a frame_a; MultiBondLib.Interfaces.MultiBondCon MultiBondConRot(n=3); MultiBondLib.Interfaces.RealSignal x[3]; MultiBondLib.Interfaces.RealSignal R[3,3]; MultiBondLib.Interfaces.MultiBondCon MultiBondConTrans(n=3); equation MultiBondConTrans.e*MultiBondConTrans.d = frame_a.f; MultiBondConRot.e*MultiBondConRot.d = frame_a.t; MultiBondConTrans.f = frame_a.P.v; MultiBondConRot.f = frame_a.P.w; x = frame_a.P.x; R = frame_a.P.R; end Mech2MBG;