- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simulation finishes before that stop...
Simulation finishes before that stop time
Simulation finishes before that stop time
Hi,
I am not an expert user in OM. I want to start with this simple model
model SpringWithMass "Point mass hanging on a spring"
extends Modelica.Icons.Example;
Modelica.Mechanics.MultiBody.Forces.Spring spring(s_unstretched = 0.2, m = 0.1, c = 4000, width = 0.1, massDiameter = 0.07) annotation(Placement(visible = true, transformation(origin = {10,30}, extent = {{-10,10},{10,-10}}, rotation = 270)));
Modelica.Mechanics.MultiBody.Parts.Body body(r_0(start = {0,-0.3,0}, fixed = true), v_0(fixed = true), angles_fixed = true, w_0_fixed = true, r_CM = {0,0,0}, m = 1) annotation(Placement(visible = true, transformation(origin = {10,-10}, extent = {{-10,10},{10,-10}}, rotation = 270)));
inner Modelica.Mechanics.MultiBody.World world(animateGravity = false) annotation(Placement(visible = true, transformation(origin = {-30.7092,59.2199}, extent = {{-10,-10},{10,10}}, rotation = 0)));
equation
connect(world.frame_b,spring.frame_a) annotation(Line(points = {{-20.7092,59.2199},{10,59.2199},{10,40}}));
connect(body.frame_a,spring.frame_b) annotation(Line(points = {{10,0},{10,10},{10,20}}, color = {95,95,95}, thickness = 0.5));
annotation(experiment(StopTime = 5), Documentation(info = "<html>
<p>
This example shows that a force component may have a mass.
The 3-dimensional spring as used in this example, has an optional
point mass between the two points where the spring is attached.
In the animation, this point mass is represented by a small,
light blue, sphere.
</p>
<p align=\"center\">
<IMG SRC=\"../Images/MultiBody/Examples/Elementary/SpringWithMass.png\"
ALT=\"model Examples.Elementary.SpringWithMass\">
</p>
</html>"));
end SpringWithMass;
but the simulation , initially fixed to arrive up to 5 sec , but finished at 0.01 sec without error message.
I couldn't figure out what's happend?
Anybody could give me a clue?
Thanks,
Gustavo
Re: Simulation finishes before that stop time
Hi,
It will work like this (via a script.mos containing):
Code:
// start script.mos
loadModel(Modelica, {"3.2.1"}); getErrorString();
loadFile("swm.mo"); getErrorString();
setMatchingAlgorithm("PFPlusExt");
setIndexReductionMethod("dynamicStateSelection");
simulate(SpringWithMass); getErrorString();
// -- end script.mos
I guess you could also set these flags from OMEdit somehow, but I don't know for sure.
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simulation finishes before that stop...