Help - Search - Members - Calendar
Full Version: simulation with no results ??
Modelica Forum > Modelica > MathModelica / OpenModelica
MOS701
Hello to you all !!

i am a newbie to modelica ,i just need to know if you just had have a such a problem, i defined a voltage commanded current source :

""""""""""""""""""""""""""""""""""""""""""""""""""
model VDCS

Modelica.Electrical.Analog.Interfaces.Pin P "positive noeud";
Modelica.Electrical.Analog.Interfaces.Pin N "negative noeud";
Modelica.Electrical.Analog.Interfaces.Pin C "command noeud" ;
parameter SI.Conductance Gain(start=1.0) "Gain parameter";

protected

Real iD;
Real vD;

equation

C.i = 0;
iD = P.i;
iD= Gain*vD;
vD=P.v - N.v;
end VDCS;


"""""""""""""""""""""""""""""""

and when i test this model with a constant voltage on the following test model :
""""""""""""""""""""""""""""""""""""""""""""""""
import Modelica.Electrical.Analog;

model simple_test_1

LAAS_MOS.VDCS S1 (Gain=10) ;
Modelica.Electrical.Analog.Basic.Resistor R1(R1=1);
Modelica.Electrical.Analog.Basic.Resistor R2 (R2=1);
Modelica.Electrical.Analog.Basic.Ground gnd;
Modelica.Electrical.Analog.Sources.ConstantVoltage E(V=5);

equation
connect(R1.p,S1.P);
connect(R1.n,gnd.p);
connect(S1.N,R2.p);
connect(R2.n,gnd.p);
connect(E.n,gnd.p);
connect(S1.C,E.p);

end simple_test_1;
"""""""""""""""""""""""""""""""""""""""""""""""

the simulation is good and the open modelica shell give that the results is in the "simple_test_1.res"
but in this file i only find the time interval with the dummy derivative but with no resulat for none of the model variabels. ?????
and i don't know what to do,

regards
adrpo

Hi,

You should put
getErrorString();
after each command like loadFile(), loadModel(), simulate(), etc.
If the parser encounters a syntactic error it will just try to jump
over the error. That's you should ask for the error string after loading.

Your model is not syntactically correct as you cannot have imports
outside models. This import is wrong: import Modelica.Electrical.Analog;

If you get rid of the impoort and also change:
SI.Conductance to Modelica.SIunits.Conductance.
and use this script:
loadModel(Modelica);
getErrorString();
loadFile("Test.mo");
getErrorString();
simulate(simple_test_1, stopTime=5);
getErrorString();

You will get:
omc.exe Test.mos
true
""
true
""
record SimulationResult
resultFile = "Simulation failed.
Too few equations, underdetermined system. The model has 9 variables and 8 equations
"
end SimulationResult;
""

It seems your model has one equation short.
You should add one more equation to be able to simulate.

Cheers,
Adrian Pop/
MOS701
Thank you man smile.gif
you are the man smile.gif
MOS701
can you please tell me what is the best way to use the "import" command ??

regards
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.