- Index
- » Programming
- » Modelica Language
- » Example RevoluteLoop2D/CutJoints
Example RevoluteLoop2D/CutJoints
Example RevoluteLoop2D/CutJoints
Hello,
I'm new in OM, i work with OM since a few weeks.
I test the example of OM: 'RevoluteLoop2D' , but it doesn't work.
If I simulate it without the library CutJoints, it works!
Also I make examples by myself, no example works with CutJoints only without CutJoints.
Can anybody help me and explain why?
Here is the example RevoluteLoop2D:
class RevoluteLoop2D
import ModelicaAdditions.MultiBody.Parts;
import ModelicaAdditions.MultiBody.Joints;
import ModelicaAdditions.MultiBody.CutJoints;
Parts.InertialSystem InertialSystem1;
Parts.CylinderBody cylinderBody1(r = {1, 0, 0}, Radius = 0.02,
Material = {0.5, 0.5, 0, 0});
Joints.Revolute revolute1(startValueFixed = true, q(start = -1.0));
Parts.CylinderBody cylinderBody2(r = {0, -1, 0});
Joints.Revolute revolute2;
Parts.CylinderBody cylinderBody3(r = {-1, 0, 0}, Material = {0,1, 0, 0.5});
Joints.Revolute revolute3;
Parts.CylinderBody cylinderBody4(r = {0, 1, 0});
CutJoints.Revolute2Dloop revolute2Dloop1;
equation
connect(InertialSystem1.frame_b, cylinderBody1.frame_a);
connect(cylinderBody1.frame_b, revolute1.frame_a);
connect(revolute1.frame_b, cylinderBody2.frame_a);
connect(InertialSystem1.frame_b, revolute3.frame_a);
connect(revolute3.frame_b, cylinderBody4.frame_a);
connect(cylinderBody2.frame_b, revolute2.frame_a);
connect(cylinderBody3.frame_a, revolute2.frame_b);
connect(revolute2Dloop1.frame_b, cylinderBody3.frame_b);
connect(cylinderBody4.frame_b, revolute2Dloop1.frame_a);
end RevoluteLoop2D;
Regards
Melanie
Re: Example RevoluteLoop2D/CutJoints
OpenModelica doesn't support the constrain(...) function that is not part of the Modelica specification.
With the current OpenModelica I get this:
ModelicaAdditions/MultiBody/CutJoints.mo:331:7-331:76:writable] Error: The language feature constrain function is not supported.
Suggested workaround: rewrite code without using constrain equation
constrain(revolute2Dloop1.constraintResidue[2],revolute2Dloop1.constraintResidue_d[2],revolute2Dloop1.constraintResidue_dd[2]);
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
- Index
- » Programming
- » Modelica Language
- » Example RevoluteLoop2D/CutJoints