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
  • » brunoleos
  • » Profile

Posts

Posts

Thank you again adrpo.

And, about the possibility of symbolic substitutions that you also mentioned, could you direct me to some commands or documents?

Thank you adrpo,

I see, the numerical simulation is really going to be a problem.

Could you direct me to the sources where the interpreter is implemented?

Also, about the possibility of symbolic substitutions, could you direct me to some commands?

Hi ceraolo,

My question is not about teaching Modelica.

And take care with your concept of "acausal", which seems misleading. The compilation process goes through a "causalization" stage, which is needed for numerical simulation. This works besides the acausal approach of systems modeling, which is explored by Modelica, but of property of the underlying physics.

Please consider verifying the far right section of this picture: https://www.openmodelica.org/svn/OpenMo … iagram.jpg

I, as you, don't know if an interpreter is feasible, or even possible. So let's consider the opinion of those expert in the compiler development, which can give us a much better answer.

(please disconsider this answer)

Hi ceraolo, I'm glad for your answer.

My issue is really in the switching from modeling and simulation, and, as my application is going to explore this feature, for trial and error modeling, it's important to me.

About Modelica being equation-based, and maybe being impossible to solve iteratively, I was thinking just now if we could use the causality of the system and solve iteratively by substitution, equation by equation. It would need a sorting of the equations, and I don't know how it would behave with differential equations, but maybe this is a possibility?

Jan-16-17 15:50:05
Category: Developer

Does it exist a Modelica language interpreter?

I'm developing an educational application for interactive simulation of very simple models.

I'd like that the switching from connections editing to simulating be faster than the perceived now. As this switching involves compilation of the model, the process is complex and takes about 10 seconds even for simple models. As the application is for test an error, i'm afraid having to wait so many times is not good.

I'm wondering if using an interpreter I could have a faster response from editing the model and simulating it, and if it would allow interactive simulation.

1. Is there any option for this with OpenModelica?
2. Does anyone know if such solution exist outside OpenModelica?
3. Which steps should I follow if I had to build the interpreter based on OMC from source?

Does it exist a Modelica language interpreter?

I'm developing an educational application for interactive simulation of very simple models.

I'd like that the switching from connections editing to simulating be faster than the perceived now. As this switching involves compilation of the model, the process is complex and takes about 10 seconds even for simple models. As the application is for test an error, i'm afraid having to wait so many times is not good.

I'm wondering if using an interpreter I could have a faster response from editing the model and simulating it, and if it would allow interactive simulation.

1. Is there any option for this with OpenModelica?
2. Does anyone know if such solution exist outside OpenModelica?
3. Which steps should I follow if I had to build the interpreter based on OMC from source?

Oct-07-16 20:41:03
inverter simulation in openmodelica

If you are using the command-line interface, maybe changing to the GUI of OMEdit can help. Do you get any simulation error?

Sorry neferkamichael for being late, the notifications are going to my spam.

Yes, OpenModelica is supposed to do what you want: Build multiphysics models, set parameters of model components, and run simulations. This can be done by Modelica code directly and the OMCompiler command-line interface, and also through the OMEdit graphical interface. There is a package for 3D visualization and I think multibody also, but I haven't used them yet.

In addition,

I've just accomplished it with the executable generated directly from omc.exe.

Maybe the executable from OMEdit is built in a particular way, so not meant to be run outside the environment?

Sep-27-16 16:16:35
how to utilize the exe file that is compiled when i simulate a model?

In regard to pierluigiRossi, I also have problems when trying to run the executable generated by OMEdit. When I try to run it at command line, there is no response at all.

With the executable generated directly by omc.exe, I have no problems.

Thanks for the fast reply.

I've faced this document also, but is this for the typed API only? I need reference for model creation calls (createModel, addComponent, addConnection), which are not in that last link. I've just faced a problem where the specification told to use Code() sintax, all around the document, but the current version just accepts $Code().

You could download the last release of OpenModelica, and could start with OMNotebook (for learning the language and API fundamentals) or OMEdit, which has a bunch of component libraries which you can use to model and simulate. Both OMNotebook and OMEdit are installed with the last OpenModelica release binary available to download.

Hi all,

I'm looking for an updated reference for the scripting API (I'm going to use it with CORBA).

Is there an updated version of OMC_API-HowTo.pdf? If not, could anyone link me to the source code where the commands are parsed?

I can make an interactive simulation from OMEdit using OPC UA interface. From OMEdit, the resulting run options are:

[OMEditCompilationPath]\testOPC.exe -port=50685 -logFormat=xml -override=startTime=0,stopTime=120,stepSize=0.24,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=testOMI_res.mat -jacobian=coloredNumerical -clock=RT -w -lv=LOG_STATS -embeddedServer=opc-ua -rt=1

When I try to run this from command line, from that same path, it just finishes immediately, without any messages. I try the OPC connection from my client (UaExpert) but the server is not found.

I tried changing the -port argument but no deal (don't know what this arg means by the way).

Any hints?

My version is "OpenModelica v1.11.0-dev-83-g372119f"

I have never used OPC DA, just UA, but in the System Documentation, topic 6.3.3.* there are guidelines on how to put it to work.

I have just solved it using an input block from the basic interface. So simple...

Hi everyone,

I'm experimenting an interactive simulation with OPC UA. My main problem is that I don't know how to build a model that can have it's inputs modified. My current state: I cannot write to my model's variables, just to the simulation variables ("run" and "step").

I've built a simple RC circuit in OMEdit, with a commuting switch for capacitor charge/discharge. I just want to be able to change the switch state ("control" variable) in the client, but I receive the following error in UaExpert:

https://openmodelica.org/images/agorapro/attachments/5247/mini_uaexpert-badwrite.png

My model is this:

https://openmodelica.org/images/agorapro/attachments/5247/mini_omedit-rc.png

testOMI.mo

My version is "OpenModelica v1.11.0-dev-83-g372119f"

sjoelund.se wrote:


It is listed in freeopcua-client, but I know that earlier versions did not support alias variables. So perhaps you just need to update your OMC. It is a new and experimental feature, so things may change quickly.

What are the best options for interactive simulation nowadays? OMI is deprecated, OPC is being developed, so the good options are FMUs and external functions?

Sep-21-16 14:13:53
About the use of code generated with +simCodeTarget=CSharp

Hi all OpenModelica Community,

When I compile my code as in:

$ omc mymodel.mo +s +simCodeTarget=CSharp

a "mymodel.cs" file is generated.

I suppose a .NET compatible simulation runtime will be generated after compiling that file.

How can I compile it, and after that, how can I use the generated .NET runtime?

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