aboutsummaryrefslogtreecommitdiffstats
path: root/modelica-parser-lalrpop/examples/modelica_models/bar.mo
diff options
context:
space:
mode:
Diffstat (limited to 'modelica-parser-lalrpop/examples/modelica_models/bar.mo')
-rw-r--r--modelica-parser-lalrpop/examples/modelica_models/bar.mo17
1 files changed, 17 insertions, 0 deletions
diff --git a/modelica-parser-lalrpop/examples/modelica_models/bar.mo b/modelica-parser-lalrpop/examples/modelica_models/bar.mo
new file mode 100644
index 0000000..288f3b4
--- /dev/null
+++ b/modelica-parser-lalrpop/examples/modelica_models/bar.mo
@@ -0,0 +1,17 @@
+model Bar "Massless bar with two mechanical cuts."
+ MbsCut a b;
+ parameter
+ Position3 r[3] = [0, 0, 0]
+ "Position vector from the origin of cut-frame A"
+ " to the origin of cut-frame B";
+equation
+ // Kinematic relationships of cut-frame A and B
+ b.S = a.S;
+ b.r0 = a.r0 + a.S*r;
+ // Relations between the forces and torques acting at
+ // cut-frame A and B
+ 0 = a.f + b.f;
+ 0 = a.t + b.t - cross(r, a.f);
+ // The function cross defines the cross product
+ // of two vectors
+end Bar;