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

Posts

Posts

Suppose I have accelaration dependent forces like in fluid dynamic simulations.
If I use a model-part which describes the body's motion, and another which handles the fuid forces acting on the body, this results in an algebraic loop, which, in classical simulations needs to be iteratively converged (estimate acceleration, calc. forces, adapt acceleration estimation etc.).

My understandin is, that in modelica, the compiler solves this for me.


What if I would have the part of the model handling the fluid forces in an external (c) function?
Would omc produce code that e.g. uses multiple calls to the external function?

Now suppose the external function would be an interface to a more complex fluid-dynamics simulation.
Do I have any chance to provide additional information to the 'external module'?
In typ. implementations, the fluid-dynamics simulation needs to know if the call belongs to another step in the iteration process for the algebraic loop, or to the next timestep.
Would such an interface be possible?

Thx
Alex

Dec-15-11 14:20:25
Category: Developer

Hi all,
what is the state of PDE's in openmodelica?
I read in the modelica book of Prof. Fritzson about this topic and wonder if there has been any progress?
In the manuals and tutorials (Dr.Modelica) I found no related examples.

Thx
Alex

Hi all,

in our project, we have the control guys working in Simulink. I would prefer to do the system model in modelica. Is anywhere documented or could someone give me some hints about how to interface modelica with simulink?

I guess we have two use-cases:
1) the modelica model should be 'exported' and used in simulink for the cotrol guys to be able to develop their controller in their favorite environment.
2) the simulink controller needs to be added to the modlica model for me to be able to simulate the system from modelica.

Thank you!
alex

Hi all,

I wonder if there is some matlab code to browse the results (saved as mat file) in matlab? Where can I find information on how to extract simulation results from mat files?

Thanks
Alex

OK,
thank you.
Do you know which release this will be in?

Alex

Hi all,

I have some code developed in dymola, nicely structured using comments, such as
//=================
//== block a
//=================

OMedit seems to remove any comments.
Is there a possibility to structure the code anyhow?
Will this behaviour change in the future?

Alex

Apr-01-11 16:29:51
Category: Programming

Hi all,

lets say I have an equation of the form

\int_{t} \int_{k}  1/k exp{-ikx(t)} sin(t-\tau) dk d\tau

How to approach this in modelica?

A first approach could be to put the inner integral in a function which receives t and  \tau and uses e.g. Runge Kutta Method for integration.
Does there exist a block or anything for this or does one need to code the method?

thx
alex

Dec-16-10 13:52:52
Category: Programming

I made the test - the txt file is only evaluated at compile time....

so if I would like to make a parameterscan does it mean that i have to compile the modelica code for each run?

in dymola there are some parameterscan functions, e.g. 2d scan. so if I make 10x10 steps - does dymola compile the model 100 times?


alex

Dec-16-10 13:37:57
Category: Programming

Hi,

adrian pop stated:

There aren't any "references" yet in Modelica, everything is static!
The arrays have predetermined size (at compile time).

can't I read a parameter  from a file - as shown in utilities.readRealParameterModel -
and instantiate the array size using this parameter?

Is the txt file parsed at compile time? or can I change the parameter and rerun a compiled simulation?


alex

Dec-16-10 13:26:54
Category: Developer

about the doc and zip location: I misinterpreted the Readme. I thought the zip file would be available on the server for download (for those not wanting to run the installer).


the 2908 error seems to happen only if i try to install omc for my user only. installing for all works fine. i checked this with the original release - the same problem (i didn't notice, because i installed that one for all users).

alex

Hi,

is the simforge project still active? the tracker issues seem a bit like spam....

when using simforge with the omc 1.6 release, it states no omc>1.5 is present.
shouldn't simforge be usable with omc 1.6? how to fix this?

alex

Dec-15-10 12:55:39
Category: Programming

It works now, I had an error in my code.
Thank you!

is the pltpkg no more supported? The section in the manual is still present...

Dec-15-10 10:12:58
Category: Developer

Hi,

the msi nightly build version 7392 produces an error 2908 'component cannot be registered'.

In addition, the folder doc and zip are no more present in the 1.6.0 nightly build directory - is this intended?

Alex

Hallo,

I can not find the pltpkg and the SimpleVisual packages in 1.6.0
The example code 3.5.2 'programmable drawing of 2d graphics'
results in the error
[<interactive>:11:1-12:17:writable] Error: Class pltpkg.rect not found in scope testGeom.$for loop scope$.$for loop scope$.$for loop scope$.$for loop scope$ (looking for a function or record).

I tested this in the notebook.

do I have to load / import the package? from where?

how about coin3d - do I need to install it separately?

alex

ok,
and how about the mat file interface - where can I find it?
guess there is some c-code which I didn't find...

shouldn't be to much coding in order to wrap this code in order to provide a modelica library allowing to write mat files - or not?

alex

Dec-14-10 19:10:44
Category: Programming

the instatiation
ModelA modelsInArray[2](p = {1.2, 1.4});
works.

but how about accessing the instances 'inner' variables:

ModelArray[1].b=2.0; // does not work

alex

2. thats exactly my plan: setting output=empty and writing only variables in which I'm interested in.
but using sample is the explicit way to do it.
what I wonder is if there is a possibility to get hands on the output interval setting.... otherwise one would need to specify the sample interval manually in the model...


1. yes, I have seen that i can select .mat as output file. what I want is different:
suppress all output  outputFormat="empty".

at sampled times write some specific variables to a .mat file (as discussed above). the question is: do I need to link and call matlabs mat libs or can i use openmodelica onboard code (as you stated om actually can write .mat files)....


alex

everything in one would be nice, but I guess a hard work to do.... (btw. is the OMEdit a java or a c++/qt application?)

ah, ok.
guess this holds people back from submitting bugs....

Hallo,

both OMEdit and MDT are a great piece of code. But having the MDT editors functionality (identation and completion etc.) while having OMEdits graphical editor at the same time would be even better.

I tried opening a project in both tools.
Changing and saving the code in OMEdit, eclipse recognizes the file change an allows to update the dispayed code.
BUT vice versa (changing the code in eclipse) will not issue something like a  'source changed event'.

How do you handle this? Only use one of the tools (at a time)?

Is it planned to extend the functionality of OMEdit for a watch file process, a more powerful editor or even external editor support?


alex

Hallo,

i want to write some selected variables into a mat file. this can be decomposed in 2 questions:

1) openmodelica (at least 1.6.0) can write results as .mat. is this feature (writing mat files) accessible for users? e.g. writing data in a mat file (not the default result file) from within a simulation or script?
I would have linked against the matlab libraries, wrote some modelica wrappers to the library - but if openmodelica can do it why should i reinvent the wheel?

2) is there a user side access to the 'output event':
what i mean is if i would like to write some variables in a file x times per second, i could explicitely write a sample statement, therein call the corresponding code (modelica or c) writing the data to a file.
on the other hand modelica has the output interval setting. is it possible to use a part of that mechanism - either 'reading' the output interval setting & using it in a sample block or even better register a function to be executed when output is written...


thank you

alex

Hi,

I found that submitting a bug in the tracker requires registration - is this correct?

Alex

Dec-14-10 16:25:52
Category: Programming

Hi all,

I read that one could hold variables of any type in arrays.

suppose I have a model called ModelA which has a Real variable b and a Real parameter p.



I now want to hold several instances of such a model in an array, setting the parameter different for different instances

Is something like the following possible:


 parameter Integer n=2;

//get a container
 ModelA modelsInArray[n];

//fill in modelInstances
modelsInArray[1]=ModelA(p=1.2);
modelsInArray[2]=ModelA(p=1.4);

//access a variable
modelssInArray[1].b=42;



Is there something similar to c/c++ pointers and references so one could hold the references to modeinstances in an array?


Tanks

alex

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