Hi all,
I've been playing for some time with OpenModelica and, on the one hand,
I'm very impressed with the flexibility and ease of use of Modelica and
some very nice features of OpenModelica itself like the OmNotebook.
These features made me think that OM could be terrific tool to use in an
introductory course on Mechanics. But, on the other hand, I found very
disappointing that I can not predict in any reasonable way when a model
is going to work or not. For example solving position problems for bar
mechanisms only worked when only one angle was unknown, and even then I
get some weird behaviors like the following:
This model works fine:
model PistonMovement
constant Real pi=3.1415926535897932384626433832795;
parameter Real l1=3., l2=5., omega=1., th3=pi;
Real th1,th2(start=5.639684198386), x(start=4.);
equation
th1=time*omega+pi/2.;
l1*cos(th1)+l2*cos(th2)+x*cos(th3)=0;
l1*sin(th1)+l2*sin(th2)+x*sin(th3)=0;
end PistonMovement;
But this one yields wrong results:
model PistonMovement2
constant Real pi=3.1415926535897932384626433832795;
parameter Real l1=3., l2=5., omega=1.;
Real th1,th2(start=5.639684198386), x(start=4.);
equation
th1=time*omega+pi/2.;
l1*cos(th1)+l2*cos(th2)-x=0;
l1*sin(th1)+l2*sin(th2)=0;
end PistonMovement2;
As you can see in the first model th3 is a constant equal to PI and, in
the second one I only suppressed th3 and replaced cos(th3) by -1 and
sin(th3) by 0.
I simulated both models with the command:
simulate(Name of each model, stopTime=10.)
And I'm using OMNotebok 3.0 for OpenModelica 1.4.4 on Windows Vista.
Another problem I found is that many elements from the Standard Modelica
Library do not work.And I'm not talking about the multibody library or
others that are not supported. I'm talking about those parts of the
library included with OpenModelica and that are supposed to work fine
like the Mechanical.Translational one.
In the following example, If I use the SlidingMass component the model
works fine, but if I define the same simple model using the Stop
component there is no way (that I know) to make it work.
The good one:
model prova
import Tra = Modelica.Mechanics.Translational;
Tra.Force forca(f=1.);
Tra.SlidingMass massa(m=1.);
equation
connect(forca.flange_b, massa.flange_a);
end prova;
The bad one:
model prova
import Tra = Modelica.Mechanics.Translational;
Tra.Force forca(f=1.);
Tra.Stop massa(m=1., L=0., smax=1000., smin=-1000., v_small=0.001,
F_prop=.00001, F_Coulomb = .0001, F_Stribeck = .0002, fexp=2.);
equation
connect(forca.flange_b, massa.flange_a);
end prova;
I tried many different values for the Stop parameters with the same result.
My question to the forum is: Are those problems due to the OpenModelica
solver, that it is not able to solve problems with several nonlinear
transcendental equations or manage highly nonlinear components of the
library like the Stop component, or it is something I'm doing wrong? (or
that I could do better?) And If so, does anybody have any hints on what
would be the right way to do it?
Thanks in advance for your attention (and for your responses)
Victor
--
Víctor Martínez Moll | Universitat de les Illes Balears
Departament de Física | Edifici Mateu Orfila
Àrea d'Enginyeria Mecànica | E-07122, Palma de Mallorca, SPAIN
e-mail: [EMAIL PROTECTED] | Tel:34-971171374 Fax:34-971173426