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
  • Index
  • » Users
  • » fran_jo
  • » Profile

Posts

Posts

Hi,

I am facing the same problem as here: https://www.openmodelica.org/forum/defa … thon#p4966 when I want to get the result file after the simulation. I have this piece of code that with previous version of OMPython did work.

Code:


OMPython = OMCSession()
...
inMemoryResultFile= OMPython.get(result, 'SimulationResults.resultFile')

So, how can I load the result file into memory?

Greetings!

Hi,

I have a model of a power system line, (8 variables and 8 equations, well balanced and the model works well in network examples). When using the Export XML tool, an xml file is created with only the declaration of parameters, and no equation

Code:


<equ:BindingEquations>
  </equ:BindingEquations>

  <equ:DynamicEquations>
    <equ:Equation>
      <exp:Sub>
      </exp:Sub>
    </equ:Equation> 
  </equ:DynamicEquations>

  <equ:InitialEquations>
  </equ:InitialEquations>

I should check the model or is there any issue with the exporting tool?

Cheers!

I see...

I reply to myself... I didn't expect the attributes from Result class to be public... so a simple call to <objectresult>.res is enought.
I hope this issue helps to solve the first question.

Cheers!

Let's "reopen" this case, related with the CORBA server

i am facing a similar problem. When executing the command getClassNames, using OMCProxy class, I get an object Result. The log shows that the command executes well and a list of names is printed. I want to manipulate this list. How can I get the value of this object Result? The class Result itself https://openmodelica.org/svn/OpenModeli … esult.java does not contain any method to get the proper result of the execution.

Greetings!

Mar-18-15 14:43:55
Model implemented in Modelica and simulated in OpenModelica

Hi Matthias!

A lot of work has been done since I ask the question. We were working on the models and some improvement have been made to them. I also update the last version of OpenModelica. So the minor problems that we are facing now is to set the proper initial conditions of the models, since Dymola is more flexible with variables that do not have initial value.

Cheers!

Sep-18-14 13:49:18
Model implemented in Modelica and simulated in OpenModelica

Hi everyone!

I am working on different models, every of them have been developed with Dymola tool. Without changing anything from the model, when I simulate the model with OpenModelica I get the following errors?

Code:

Translation    15:43:41        0:0-0:0    Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createEquationsForSystem1 failed for component {9:155}

Translation    15:43:41        0:0-0:0    Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createOdeSystem failed for component {95:154}
Translation    15:43:41        0:0-0:0    Internal error ./Compiler/BackEnd/SimCodeUtil.mo: function createEquationsForSystem1 failed

Is some functionality from the compiler not working properly?

Greetings!

Sep-04-14 14:53:56
Category: Programming

Hi!

I've just started reading about ModelicaXML and I would like to go into more details about that. I found an article from the 2003, so I would like to know how is the state of this project and how can I use this functionality.

Greetings!

I see...

Done it!! I forgot to execute "port selfupdate".

Cheers!

Hi!

I am trying to install OpenModelica in my Mac OS X but MacPorts does not find it. (I am running version 10.9.4 of Mac OS X) Is it still available for Mac?

Greetings!

Hi,

I am working with OMEdit developing models in a user defined library, which contains many models. The issue is that I loose a lot of time saving a change in a single model. OMEdit saves all the models existing in the library, and this is time consuming. (I can prepare coffee meanwhile ;( )

Are you aware of this? Should it be reported as a bug?

Greetings!

I see...

Thanks a lot. Actually, what I am doing now is take advantage of the dymosim.exe that dymola generates when compiling each model and call this .exe file from outside (using Python). This is another way, but it requires to compile first the model inside dymola.

I will try your suggestion.

Cheers!

Hi everyone!

I am working with ModelicaML and I am continously getting the StackOverFlow error. The size of the model is not big, just 5 or 6 classes with their parameters, but the performance when selecting or looking for some data type, editing properties is really really slow until I get the error. I check out the updates from Eclipse itself and there is nothing to update. I can not check out now the current version of things because it is looking for a data type

Greetings!

Hi everyone!

Is there any way to call a function of Dymola from outside, let's say command line, in the same way as we do with OpenModelica?
I am interested in using the dymola compiler and scripting functions without opening the application itself.

Greetings!

Hi everyone!

I am quite new in ModelicaML. I have my class model and connection model for a very simple model. Now I am in the step of code generation and here is my doubt.
I have seen that for a specific class, it creates as many instances of another class as it is used in the connection model.

I have a class Pin that I use in a class Bus. In the connection model I have two instances of the Bus class, and for each instance, there are two connection ports being two instances of Pin class. So, I have four instances of the Pin class. When I generate the code, in the class Bus appears four instances of the Pin class, but by definition (in the class model) the Bus class should only have two instances of the Pin class.

Is this the correct behavior of the code generation or I have some issue in my design?

Greetings!

I see...

adrpo wrote:


You cannot use -overrideFile to set values for initialization (that can only be used to set bindings, not start values for parameters and variables).
For initialization you have to edit your model and add (start = Value, fixed = true).

So Adrian, there is no way to set initial values (for example, from a power flow solution) directly to the model using scripting? What about using the option -override?

Cheers!

I see...

I am facing the same problem, and hope to read a good solution for this. My concern is to set the initial values for every single variable in the model. So, using the .mat file or .txt file is the best option for me.

How should be the structure of the .mat file? I should be the same as the output .mat file from a simulation?

Cheers!

Hi everyone!

After completing a simulation with the command OMPython.simulate(), I am interested get the resultant simulation time with the OMPython.get() method. The thing is that i do not know the correct sintax current/sad I've been looking for this in the user manual but I find nothing. (May be because I do not understand completely how to use the method)

Greetings!

I see...

Thank you so much!

And regarding simflags again, if I want to use the option -overrideFile=, I was trying to use a .txt file for that with the variables written like this:

Code:

vf1=0.5

pm1=0.01

Is it the correct way? Because I was facing the same issue as before

Code:

| warning | invalid command line option: bla bla bla...

Hi everyone!

I am having some trouble using simFlags, how do I have to separate the variables within simFlags?

Code:

simulate(model,outputFormat=mat

,method="dassl",fixedStepSize=False
,stopTime=10
,tolerance=0.00001
,startTime=0
,numberOfIntervals=1000
[b],simflags="-override vf1=" + String(0.5)+ ", pm1="+ String(0.01))[/b]

I am getting this output, that I think is caused because of the simFlags

Code:

record SimulationResult

    resultFile = "C:/Users/fragom/AppData/Local/Temp/OpenModelica/model_res.mat",
    simulationOptions = "startTime = 0.0, stopTime = 10.0, numberOfIntervals = 1000, tolerance = 0.00001, method = 'dassl', fileNamePrefix = 'SmarTSLab.Models.smibwbuses', options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = '-override vf1=0.5, pm1=0.01'",
    messages = "stdout            | warning | [b]invalid command line option: pm1=0.01[/b]
stdout            | info    | usage: C:/Users/fragom/AppData/Local/Temp/OpenModelica/model.exe

Greetings!

Hi everyone!

I couldn't find the topic with the search so... Working on OMShell again, when I want to simulate a model that depends on another model (myModel.mo has some components from myLibrary.mo) I want which is the best way to load this user defined library ?

Greetings!

I see...

I missed the {} characters current/roll

Cheers!

Hi everyone!

I am using OMShell. I need some help with how to use the plot command to plot more than one variable, in the same figure. How can I hold the plot to show different variables?

Greetings!

I see...

If you have correctly installed OpenModelica, you should see this file, setup.py, under [OPENMODELICA_ROOT]\share\omc\scripts\PythonInterface. I guess you execute the installation with CMD, inside this folder right?

Cheers!

Mar-24-14 14:57:28
Installation problem of ModelicaML via Eclipse Modeling Tool

I see...

I have the same version of Eclipse and I could installed successfully. Since you said that you have followed all the steps as the manual says, I am afraid that the only help I can give you is to re install everything again. (It seems also that you have installed the modeling tools for Eclipse)

Cheers!

Hi everyone!

For questions regarding ModelicaML... should I also use this forum?

Greetings!

I see...

This is my code from OMEdit (I remove all the annotation keywords)

Code:


model VanDerPol
  parameter Real x1_0 = 0;
  parameter Real x2_0 = 1;
  Real x1(start = x1_0);
  Real x2(start = x2_0);
  Modelica.Blocks.Interfaces.RealInput u;
equation
  der(x1) = (1 - x2 ^ 2) * x1 - x2 + u;
  der(x2) = x1;
end VanDerPol;

model TestVanDerPol
  VanDerPol vanderpol(x2_0 = 1);
  Modelica.Blocks.Sources.Sine u_sin(freqHz = 50);
equation
  connect(u_sin.y,vanderpol.u);
end TestVanDerPol;

The strange thing is that the output trajectory of x1 and x2 are plotted ok but not the sin (in OMEdit)

Cheers!

Hi!

I am working with a simple Van Der Pol model with a sinusoidal input as input, using the Sources.Sin block. It seems to work ok because the outputs from the Van Der Pol are quite ok, but when I plot the input signal from the sin I get a straight line ???
https://drive.google.com/file/d/0B3hdjNocLdHrcjB3ckdlcTZHeVU
(Sorry, I wanted to share a picture but it doesn't work current/sad, unless you right-clik on it current/smile )

Greetings!

adrpo wrote:

We also have a Java-Corba client as an Eclipse project that you can use to connect to OMC:
http://www.ida.liu.se/~adrpo/omc/corba/_java/

Cheers,
Adrian Pop/

I see,

Adrian, is there any example or guide on how to use it?

Cheers!

I see,

These links are broken...

Cheers!

I see,

In this document you explain the way of configuring a builder within Eclipse. If have the OpenModelica 1.9 already installed and the MDT plug-in properly installed also, do I have to follow this document to configure the builder? Or can I configure the builder with the binaries I have in the OpenModelica release?

(I hope you understand what I try to explain)

Cheers!

I see,

So, does it means that I can debug a model using a MDT Debut configuration?

Cheers!

Hi everyone!

Which is the purpose of the MDT Configuration. I have tried to build a project and run it, but I see no output neither a simple result. I has the same use as the simulate function in the MDT console?

(In the user manual, there is very little explained about that, only a couple of screenshots, and if the document is correct, these screen shots are missing current/hmm  ??? )

Greetings!

Jan-07-14 16:16:14
Using the MDT console in Eclipse to simulate a model

I see,

this is solved. I had an issue with the name of the model. I was calling the model itself but it was inside of a package.

Cheers!

Jan-07-14 15:43:59
Using the MDT console in Eclipse to simulate a model

I see,

Yes! I am using the MDT console. Now it works!

But... simulation failed.

Code:

messages = "Simulation Failed. Model: SMIB does not exist! Please load it first before simulation.",

How can I solve this? building the project or there is some load function?

Cheers!

Jan-07-14 14:34:47
Using the MDT console in Eclipse to simulate a model

Hello everyone!

Keep on learning about OpenModelica MDT plug-in for Eclipse, I am trying to simulate a very simple model like this:

Code:

omc> simulateModel(SMIB, stopTime=10, measureTime=true)


omc> plot(h)
false

According to the user manual, this command should produce a report, and then plot the behaviour of the variable h, that's right? What is going wrong here? (I think I have the plug-in correctly installed. I have also have installed OpenModelica 1.9 in my computer)

Greetings!

Hi everyone!

So, the subject of this topic explain the problem itself. I have installed correctly the MDT into Eclipse, I have created a modelica project. Now, I have a model that uses a different library that the modelica library. This new library is a self created one.
When I use it with OMEdit is it simple to work with it. I load the .mo file that contain my library, then I open my model and I can simulate it. So, how can I do this in Eclipse?

Greetings!

Hi everyone!

I am new in OpenModelica. I am trying to run the VanDerPol example from OMNotebook, but I do not get the correct output.

>>setCommandLineOptions("+d=initialization");

>> simulate(VanDerPol, startTime=0, stopTime=25)
record SimulationResult
    resultFile = "",
    messages = "Simulation failed for model: VanDerPol
Warning: Assuming fixed start value for the following 2 variables:
         x:VARIABLE(start = 1.0 ) .VanDerPol, .Real type: Real
         y:VARIABLE(start = 1.0 ) .VanDerPol, .Real type: Real
"
end SimulationResult;

I have read in the forum about the +d=initialization parameter, so I executed the setCommandLineOptions. Why the example does not run properly?

Greetings!

Nov-14-13 13:09:13
I get this error: Parse error: The identifier at start end ...

Hi everyone!

I want to change a model name from the text editor, but once I type the first letter I got a pop-up error message and the next error:

Syntax    10:56:45        1:6-30:13    Parse error: The identifier at start and end are different

From the pop-up messge, if I choose the Fix errors manually, the pop-up message appears again and again.
How can I fix this issue?

Greetings!

Aug-20-13 01:13:47
I have a translation error with an OpenModelica-Example

Hi,

I have just created the ticket with the file that reproduces the error.

Greetings!

Aug-18-13 15:03:27
I have a translation error with an OpenModelica-Example

Mac OS X 10.6.8

Cheers!

Aug-18-13 14:46:31
I have a translation error with an OpenModelica-Example

Hi!

I think I have the error:
Translation    13:40:22        0:0-0:0    Error building simulator. Build log: /usr/bin/gcc-4.2   -falign-functions -msse2 -mfpmath=sse   -I"/opt/local/include/omc" -I. -L"/Users/Cesc/Proyectos/Modelica"  -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o RLCircuit.o RLCircuit.c
/usr/bin/gcc-4.2   -falign-functions -msse2 -mfpmath=sse   -I"/opt/local/include/omc" -I. -L"/Users/Cesc/Proyectos/Modelica"  -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME  -c -o RLCircuit_records.o RLCircuit_records.c
/usr/bin/g++-4.2 -I. -o RLCircuit RLCircuit.o RLCircuit_records.o -I"/opt/local/include/omc" -I. -L"/Users/Cesc/Proyectos/Modelica"  -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -L"/Users/Cesc/Proyectos/Modelica"     -falign-functions -msse2 -mfpmath=sse   -L"/opt/local/lib/omc" -Wl,-rpath,'/opt/local/lib/omc' -lSimulationRuntimeC   -ldl -linteractive  -lexpat -L/opt/local/lib -Wl,-headerpad_max_install_names -arch x86_64  -lintl  -liconv -lgc  -llapack  -lpthread -lf2c
Undefined symbols:
  "_dgesv_", referenced from:
      _solveLapack in libSimulationRuntimeC.a(libSimulationRuntimeC.a.o)
      _solveNewton in libSimulationRuntimeC.a(libSimulationRuntimeC.a.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [omc_main_target] Error 1

I use OMEdit in Mac OS X. I have followed the instruction from the web site about intalling OpenModellica in Mac but I does not work.

Any help?

Cheers!

  • Index
  • » Users
  • » fran_jo
  • » Profile
You are here: