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

Posts

Posts

FINALLY!!!

I been frustrated for a while with this library so, yesterday I took it personally I decided to track down the problem... and I think I did!  current/big_smile

At least, the excavator and several other examples (like OpenCenter) now compiles perfectly!

Is baffling how simple the solution is. It fails because of this model:   Basic.FluidPower2MechTrans

And the solution is to move everything in the 'algorithm' section to the 'equation' section

WAS:

Code:


algorithm
  assert(V > 0, "Volume in fluid chamber is negative or zero.\n" + "Increase the residualVolume or the stopStiffness");
  assert(p_vol < maxPressure or s_rel < 0, "Maxiumum pressure in chamber has been exceeded");
  when empty then
    Modelica.Utilities.Streams.print("\nWARNING: CylinderChamber has reached end of travel.");
    Modelica.Utilities.Streams.print("         This could cause erratic behavior of the simulation.");
    Modelica.Utilities.Streams.print("         (time = " + String(time) + ")");
  end when;
equation
  // medium equations
  // the pressure is the same everywhere
  for i in 1:n_ports loop
    p_vol = p[i];
  end for;
...

SHOULD BE:

Code:


equation
  assert(V > 0, "Volume in fluid chamber is negative or zero.\n" + "Increase the residualVolume or the stopStiffness");
  assert(p_vol < maxPressure or s_rel < 0, "Maxiumum pressure in chamber has been exceeded");
  when empty then
    Modelica.Utilities.Streams.print("\nWARNING: CylinderChamber has reached end of travel.");
    Modelica.Utilities.Streams.print("         This could cause erratic behavior of the simulation.");
    Modelica.Utilities.Streams.print("         (time = " + String(time) + ")");
  end when;

  // medium equations
  // the pressure is the same everywhere
  for i in 1:n_ports loop
    p_vol = p[i];
  end for;
...

and that is! so far I been able to play a little bit with the library with no problems.

Mind you, I discovered this yesterday, there could be some other problem somewhere else but I havent came across it yet.

Now Ill try to warn the maintainers of the source, lets see if Im not breaking something else and can make it into 1.9.4! current/smile

Jorge

Hello everyone,

First, thanks to the developers for this set of tools, truly great to have such thing in the opensource world!


Im fairly new to Modelica and Openmodelica so probably Im missing something really stupid...

Thing is I was playing with OMOptim and found missing variables in the 'Model Variables' window. I can find there all the 'parameters' but never all the other 'internal' variables that are, in fact, the results of the simulation. Therefore, I can't create 'Objectives' for the optimization.

Puzzled I decided to start really simple so I slightly modified the first sample model from the book "Modelica by example":

Code:


model FirstOrder
  parameter Real a(start=1,fixed=true);
  Real x;
equation
  der(x) = a-x;
end FirstOrder;

cant get simpler that this. It compiles and runs perfectly and I can see a,x,der(x) and time in the plotting part of OMEdit

When I load that model into OMOptim only parameter 'a' is shown in the "model variables" window.

Maybe Im missing something but shouldt (at least) 'x' be listed there so I can use it as an 'Objectives' variable?

I cant really find what Im missing  current/hmm

Regards,
Jorge

EDIT:
screenshot of OMOptim:

https://openmodelica.org/images/agorapro/attachments/4903/mini_omoptim.png

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