- Index
 - » Usage and Applications
 - » OpenModelica Usage and Applications
 - » Help : A simple question
 
Help : A simple question
Help : A simple question
 I am studying "Principles of Object-Oriented Modeling and Simulation with Modelica 2.1 (Peter Fritzson )". An example is as follows:
class Pendulum  "Planar Pendulum" 
  constant  Real PI=3.141592653589793; 
  parameter Real m=1, g=9.81, L=0.5; 
  Real F; 
  output    Real x(start=0.5),y(start=0); 
  output    Real vx,vy; 
equation 
  m*der(vx)=-(x/L)*F; 
  m*der(vy)=-(y/L)*F-m*g; 
  der(x)=vx; 
  der(y)=vy; 
  x^2+y^2=L^2; 
end Pendulum; 
when:
simulate(Pendulum, stopTime=4) 
plot(x)
it shows a figure the same as the book. 
But when stopTime=5 or other value, the result seems to be completely wrong. 
Can anybody tell me why?
Re: Help : A simple question
 Hi,
We're keeping an eye on the forum all the time but we're rather busy so it takes a while to reply.
I can't reproduce your error. For me plotting works rather fine for stopTime=5 and stopTime=20.
I used this script file: Pendulum.mos
Code:
loadFile("Pendulum.mo");
getErrorString();
simulate(Pendulum, stopTime=4);
getErrorString();
plot2(x);
getErrorString();
simulate(Pendulum, stopTime=5);
getErrorString();
plot2(x);
getErrorString();
simulate(Pendulum, stopTime=20);
getErrorString();
plot2(x);
getErrorString();
What version of OpenModelica are you running?
I'm using 1.5.0 RC2: http://www.ida.liu.se/~pelab/modelica/O … dows/rc2/.
If you're not using the same version try to uninstall your current one and install this new one.
Cheers,
Adrian Pop/
- adrpo
 - 
 - 
 - 885 Posts
 
Re: Help : A simple question
 The version I'm running is 1.5.0 RC1, and earliy I used 1.4.5. I have tried this in more than three computers running WindowsXP, and got the same error as I described above, which is realy  a blow to the enthusiasm of learning Modelica for me.
I have tried 1.5.0 RC2 . It works good indeed.
Thanks a lot !
- Index
 - » Usage and Applications
 - » OpenModelica Usage and Applications
 - » Help : A simple question
 
						 Thank you 
						