Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

SMPM_Inverter Example does not create a valid simulation output

SMPM_Inverter Example does not create a valid simulation output

Hi,

I am using OMEdit 1.8.1, OpenModelica Beta1 (r12739).

I am trying to simulate the SMPM_Inverter example to get a clue on how to use the SM_PermanentMagnet model.
The SMPM_Inverter example should show this, but I am not able to succesfully simulate the example.
When I hit simulate with default parameters, a list of variables is created as a result of the simulation, but the variables seems to be invalid as they all show 0 from time 0 to 1e-9. Time 0  to 1e-9 seems wrong as the simulation should run for 1.5s.

Additionally simulating the example using the OMShell produces the following:
>> simulate(Modelica.Electrical.Machines.Examples.SMPM_Inverter, stopTime=1.5, numberOfIntervals=1500)
record SimulationResult
    resultFile = "C:/Users/kpe/AppData/Local/Temp/OpenModelica/Modelica.Electrical.Machines.Examples.SMPM_Inverter_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 1.5, numberOfIntervals = 1500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'Modelica.Electrical.Machines.Examples.SMPM_Inverter', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
    messages = "warning | Error solving nonlinear system residualFunc71 (size 3) at time 1e-006
DASSL--  AT T (=R1) AND STEPSIZE H (=R2) THE
      In above,  R1 =   .0000000000000E+00   R2 =   .1562500000000E-07
DASSL--  ITERATION MATRIX IS SINGULAR
warning | DDASRT: The matrix of partial derivatives is singular.
info    | DASRT can't continue. time = 0.001000
[:0:0-0:0:writable] warning | Simulation call assert() at time 0.000000
Level : error
Message : Model error: Argument of sqrt should be >= 0
info    | model terminate | Simulation terminated at time 9.53674e-010
",
    timeFrontend = 1.29787288003565,
    timeBackend = 0.807052447945161,
    timeSimCode = 0.0845395225483412,
    timeTemplates = 0.113381182361317,
    timeCompile = 2.65507079530592,
    timeSimulation = 0.439061781041785,
    timeTotal = 5.39709771853612
end SimulationResult;

Does anybody know why the SMPM_Inverter example does not work out of the box, in both OMEdit and OMShell?

Re: SMPM_Inverter Example does not create a valid simulation output

https://test.openmodelica.org/~marsj/MS … verter.sim

(from a more recent omc)

As you can see some variables have start-values outside their min-max range. This probably causes some issues with initialization.

Re: SMPM_Inverter Example does not create a valid simulation output

Ok I see,

But is the example not suppose to run out of the box? Or am I missing some point on the examples provides i.e. do they require a initialization file?

Another question, how did you create the *.sim file containing the warnings? There do not seem to be any warning, error output in OMEdit, or more correct there is a "Messages" window, but it does not show any of the warnings you have provided in the sim file.

/Klaus

Re: SMPM_Inverter Example does not create a valid simulation output

That's only because OMEdit fails at showing any messages (go slap Adeel around by adding a ticket if you want them). The regular simulate() command will show all warnings, simulation didn't finish, solution is unsound, etc messages.

All models in the MSL do not work out of the box. The MSL is a third-party library, not developed by us.

Re: SMPM_Inverter Example does not create a valid simulation output

Ok thanks for the quick reply, I will create a ticket for Adeel.

For the time being though I need to be able to get the warning/ error feedback so I can get clues on what I am doing wrong.
So when you say that you use the "regular simulate command()" what does that mean?

Is it the simulate command run from the OMShell? or something else?
When I simulate in the OMShell, or OMEdit I do not get the *.sim file output as you have provided.

If you can explain how you got the simulator to give you those warnings/ errors I would much appreciate it.

/Klaus

Re: SMPM_Inverter Example does not create a valid simulation output

From OMShell or any other tool that runs OpenModelica API (like mos-scripts)

Code:

loadModel(Modelica,{"3.2"});

res:=simulate(Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_Inverter);getErrorString();
writeFile("Modelica.Electrical.Machines.Examples.SynchronousInductionMachines.SMPM_Inverter.sim", res.messages);getErrorString();

There are 0 guests and 0 other users also viewing this topic
You are here: