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



Yes, that's what I've been looking for!

Thank you very much!!!

Hello again!

Thanks for your help so far!
I tried to make t_dummy discrete but it didn't help me either...

But again I have an idea how it could work! I want to scan time in a variable.
So when you have the floating time, t_dummy would become [0,1,2,3,4,5] if you set the scan time to 1 second.
Is there any command to do this?

The smaller the sampling time the better results you would get and with the command pre() the time before a certain event could be read.

Hope you understand what I mean...

Do you have any suggestions again?

BIG THANKS and regards!

I use the delay function. But the DelayTime I want to use depends on the hit time.

Unfortunately all my effords were not successful.
Has any other one ideas for a solution?

The problem for me seems to be the variable time.
If you set:


t_dummy = time;

it seems to be protected! You can't use reinite to set t_dummy to a different value or anything else.

Regards and thanks for your answers!


Thanks for your answer, but with the when-equation it did'nt work...
Has anyone any other any idea?

I want to use it for a delay function.


Hi Guys!

Think of the bouncing ball. I have a ball, that's dropped from a certain height. It's accelerated by gravity and after a certain time the ball hits the floor. Everything runs!
Now i want to know the time, when the ball hits the floor, but I don't know how.

My intention was to use a while loop! A variable t_dummy runing with the time, and stopping, when the ball hits the floor!

 Spoiler Show Spoiler Hide Spoiler


while h > 0 loop
t_dummy = time;
end while;

But it seems, that while loops are not implemented yet...

Any other ideas, how this could be realised?????
Dec-21-11 13:10:03
Peter Fritzson's example for the Heat Diffusion

I've alreade read about the in operator and that it's not yet implied in OM.

Now I've tried to simulate the HeatDiffusion1D example in OMNotebook but always get an error when i write down th package DifferentialOperators1D.
The error is: missing token: RPAR

Here is my example Code:


package DifferentialOperators1D "Finite Difference differential operators"
  function pder "Returns vector of spatial derivative values of a 1D field"
    input Fields.Field1D f;
    input Integer x=1 "Diff order - first or second derivative";
    output Real df[size(f.val;1)];
    df := if x == 1 then SecondOrder.diff1(f.val, f.domain.dx)
    else SecondOrder.diff2(f.val, f.domain.dx);
  end pder;

  package FirstOrder "First order polynomial derivative approximations"
    function diff1 "First derivative"
      input Real u[:];
      input Real dx;
      output Real du[size(u,1)];       
    algorithm         // Left, central,  and right differences
      du := cat(1, {(u[2] - u[1])/dx}, (u[3:end] - u[1:end-2])/2/dx,
                   {(u[end] - u[end-1])/dx});
    end diff1;
  end FirstOrder; 
  package SecondOrder "Second order polynomial derivative approximations"
    function diff1 "First derivative"
      input Real u[:];
      input Real dx;
      output Real du[size(u,1)];
      du := cat(1, {(-3*u[1] + 4*u[2] - u[3])/2/dx },
                   {u[3:end] - u[1:end-2])/2/dx,
                   {(3*u[end] - 4*u[end-1] + u[end-2])/2/dx} );
    end diff1;
    function diff2 "Second derivative"
      input Real u[:];
      input Real dx;
      output Real du2[size(u,1)];
      du2 := cat(1, {(2*u[1] - 5*u[2] + 4*u[3] - u[4])/dx/dx },
                    (u[3:end] - 2*u[2:end-1] + u[1:end-2])/dx/dx,
                    {(2*u[end] - 5*u[end-1] + 4*u[end-2] - u[end-3])/dx/dx} );
    end diff2;
  end SecondOrder;
end DifferentialOperators1D;

Thanks for your help!

Hi all!

I simulated a Spring-Damper-System in OMEdit 1.8 by simulating gravity with force and then again with the MultiBody icon world. I compared the results to the same mathematical model in Matlab/Simulink. The one model with my simulated force (9.81N touching) got the same result, but the MultiBody model didn't.
Does anybody know why??

My values for the spring-damper system:

m =1;

Thanks for your help!!


Dec-13-11 15:21:25
Compare these two programs

Hello again!

I've only got one remaining problem! Where can I find which parameter in my matrix in matlab/simulink is which parameter in modelica? is there any lining up?
and anther one: my x axis has a wrong scale.
when i simulate for 20 secondes in omedit, in matlab the omedit simulation seems to simulate for 200 seconds. matlab file and omedit file don't fit.... current/hmm
anybody knows these problems?

Dec-07-11 17:59:03
Cannot install ModelicaML in Eclipse


I just wanted to install ModelicaML using Eclipse Helios, but couldn't.
Every Time when I come to the step where ModelicaML is installed in Eclipse, I get an error, because "one or more required items could not be found."

Can anybody help me?


Dec-01-11 00:59:46
Compare these two programs

Many Thanks! I looked for this since weeks now! Thank you!!

Dec-01-11 00:59:12
Simulation of the fullRobot and oneAxis Model from the library


I wanted to simulate the fullRobot and oneAxis Model from the library.
After half an hour of compiling and simulating, I came to the Plotting Area for the oneAxis Model, but there wasn't anything to select and plot..
Then I tried to simulate the fullRobot Model, but after nearly an hour of compiling and simulating I cancelled it with no output at all...
Took simply too long.
Anyone with the same probloms or can anyone help me?

I'm using OMEdit 1.8

Thanks, Fabian

Dec-01-11 00:41:36
Compare these two programs


I wanted to compare the models I have created in OMEdit to my models created in Matlab/Simulink!

When I simulate in OMEdit I can choose an Output Format and an (optional) File Name! But where is this file saved, so I can load it into Matlab/Simulink?

Is there another possability??

Thanks, cheers, Fabian

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