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

Multi-level parameters

Multi-level parameters

I would like to have access to the dialog for parameters of two replaceable models M1 (x,y,z) and M2 (u,v) but as they are defined in an upper model SYS, the dialogs are not visibles

package TwoLevelParameter
  model M1
    parameter Real x;
    parameter Real y;
    parameter Real z;
    Real R;
  equation
    R = x + y + z;
  end M1;
 
   model M2
    parameter Real u;
    parameter Real v;
    Real R;
  equation
    R = u * v;
  end M2;
 
model SYS
  replaceable M1 m annotation(
    choices(choice(redeclare M1 m "Default"),
     choice(redeclare M2 m "Variant")));
end SYS;
 
 

  model Essai
  M1 m1(x = 1, y = 2, z = 3)  annotation(
      Placement(visible = true, transformation(origin = {-58, 54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  M2 m2(u = 2.3, v = 5.)  annotation(
      Placement(visible = true, transformation(origin = {36, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  SYS sys annotation(
      Placement(visible = true, transformation(origin = {-26, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  equation

  end Essai;

end TwoLevelParameter;

Edited by: JPG84 - Apr-06-21 08:17:48

Re: Multi-level parameters

Nobody knows ?
Best regards

Re: Multi-level parameters

This is not posibile yet. We are working on implementing it.

There are 0 guests and 0 other users also viewing this topic