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

Posts

Posts

Thank's a lot!!!

Sep-24-12 23:20:07
Ball falls through the ground
Category: Programming

Thank you very much for your answers !!! You saved me a lot of sleepless nights current/smile  Solver issues are really annoying.

@sjoelund.se  What you changed is basicly that you increased v_min from 0.05 to 0.5 ?? Or do I miss anything else?

Sep-24-12 23:17:09
Ball falls through the ground
Category: Programming

Thank you very much for your answer !!! You saved me a lot of sleepless nights current/smile But what you changed is basicly that you increased v_min from 0.05 to 0.5 ?? Or do I miss anything else?

Sep-22-12 16:30:28
Ball falls through the ground

I'm sorry for posting this in the wrong topic. I've opened an new thread in "Programming Modelica Language". As I couldn't find any erase function I guess I have to leave this thread here.

Sep-22-12 16:23:46
Ball falls through the ground
Category: Programming

At this point of time I'm learning simulation with OM from a book. Right now I'm trying to simulate a bouncing ball which falls to the ground from a certain height and stands still after a certain time. But my problem is that the Ball falls through the ground after a certain point of time although I've included some mechanisms to prevent OM from doing this.

Here's the code:

model huepfenderBall02
  parameter Real k = 0.825; //collision factor
  parameter Real g = 9.81;
  parameter Real v_min = 0.05; //min. speed

  Real x(start = 1.5); //height
  Real x_pkt; // speed
  Real beschleunigung(start = g);  //acceleration
 
equation
  x_pkt = der(x);  //Integration of path
  -beschleunigung = der(x_pkt); // Integration of speed
  when x <= 0.0 then
      beschleunigung = if abs(pre(x_pkt)) > v_min then g else 0.0; // one mechanism to prevent the ball falling through the ground
    reinit(x_pkt, if abs(pre(x_pkt)) > v_min then -k * pre(x_pkt) else 0.0); // scnd mechasim
    reinit(x, 0.0);
 
  end when;
end huepfenderBall02;

Can anyone help me?


Edited By:  meadowstress
Yesterday 20:58:59

Sep-21-12 21:38:35
Ball falls through the ground

At this point of time I'm learning simulation with OM from a book. Right now I'm trying to simulate a bouncing ball which falls to the ground from a certain height and stands still after a certain time. But my problem is that the Ball falls through the ground after a certain point of time although I've included some mechanisms to prevent OM from doing this.

Here's the code:

model huepfenderBall02
  parameter Real k = 0.825; //collision factor
  parameter Real g = 9.81;
  parameter Real v_min = 0.05; //min. speed

  Real x(start = 1.5); //height
  Real x_pkt; // speed
  Real beschleunigung(start = g);  //acceleration
 
equation
  x_pkt = der(x);  //Integration of path
  -beschleunigung = der(x_pkt); // Integration of speed
  when x <= 0.0 then
      beschleunigung = if abs(pre(x_pkt)) > v_min then g else 0.0; // one mechanism to prevent the ball falling through the ground
    reinit(x_pkt, if abs(pre(x_pkt)) > v_min then -k * pre(x_pkt) else 0.0); // scnd mechasim
    reinit(x, 0.0);
 
  end when;
end huepfenderBall02;

Can anyone help me?

Thank's so far for your answers. So what you're saying is: No way around Shell??? That  sucks.

I'm kind of new to OM so what do I enter in the OEMShell?

I've Simulated your Modelica Code and cannot find any text messages.

Do I have to open any special output window? And if so where do I open it?  I haven't found any entries in the menu about any text output windows.

Or do I have to execute Open Modellica in the Windows Shell?

I need to print out some control values at specific events in the simulation.  The book I read uses "Modelica.Utilities.Streams.print()" but as I have figured out Open Modelica does not support this function.

So is there any alternative for this in Open Modelica or not?

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