The package contains two converter elements, that enable the comfortable wrapping of bondgraphic models.
Name | Description |
---|---|
Frame_a | connector for the planar objects |
Frame_b | connector for the planar objects |
Frame | connector for the planar objects |
Potentials | redundant part of the connector for the planar objects |
MBG2Mech | links the bond graph with the mechanic connector |
Mech2MBG | links the mechanic connector with the bond graph |
connector Frame_a "connector for the planar objects" extends Frame; end Frame_a;
connector Frame_b "connector for the planar objects" extends Frame; end Frame_b;
The connector defines 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.)
All 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 planar objects" import SI = Modelica.SIunits; Potentials P; flow SI.Force fx "Cut-force"; flow SI.Force fy "Cut-force"; flow SI.Torque t "Cut-torque"; end Frame;
These 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 for the planar objects" extends Modelica.Icons.Record; import SI = Modelica.SIunits; SI.Position x "Position"; SI.Position y "Position"; SI.Angle phi; SI.Velocity vx "Velocity"; SI.Velocity vy "Velocity"; SI.AngularVelocity w; encapsulated function equalityConstraint "Returns the constraint residues to express that two frames have the same orientation" import Modelica; import MultiBondLib.PlanarMechanics.Interfaces; extends Modelica.Icons.Function; input Interfaces.Potentials P1; input Interfaces.Potentials P2; output Real residue[3]; algorithm residue := {P1.x-P2.x,P1.y-P2.y,P1.phi-P2.phi}; end equalityConstraint; end Potentials;
model MBG2Mech "links the bond graph with the mechanic connector" import MultiBondLib; MultiBondLib.Interfaces.MultiBondCon MultiBondCon1(n=3); Frame_b frame_b; MultiBondLib.Interfaces.RealSignal q[3]; equation MultiBondCon1.e[1]*MultiBondCon1.d = frame_b.fx; MultiBondCon1.e[2]*MultiBondCon1.d = frame_b.fy; MultiBondCon1.e[3]*MultiBondCon1.d = frame_b.t; MultiBondCon1.f[1] = frame_b.P.vx; MultiBondCon1.f[2] = frame_b.P.vy; MultiBondCon1.f[3] = frame_b.P.w; q[1] = frame_b.P.x; q[2] = frame_b.P.y; q[3] = frame_b.P.phi; end MBG2Mech;
model Mech2MBG "links the mechanic connector with the bond graph" import MultiBondLib; Frame_a frame_a; MultiBondLib.Interfaces.MultiBondCon MultiBondCon1(n=3); MultiBondLib.Interfaces.RealSignal q[3]; equation MultiBondCon1.e[1]*MultiBondCon1.d = frame_a.fx; MultiBondCon1.e[2]*MultiBondCon1.d = frame_a.fy; MultiBondCon1.e[3]*MultiBondCon1.d = frame_a.t; MultiBondCon1.f[1] = frame_a.P.vx; MultiBondCon1.f[2] = frame_a.P.vy; MultiBondCon1.f[3] = frame_a.P.w; q[1] = frame_a.P.x; q[2] = frame_a.P.y; q[3] = frame_a.P.phi; end Mech2MBG;