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

Posts

Posts

Apr-07-14 10:12:46
Category: Programming

Thank you very much, the inner/outer method works!

Apr-02-14 11:55:45
Category: Programming

Yes, I know I can do it without inheritance when I have only one "Calc" model (block). But if I have e.g. 40 different "Calc" blocks and all of them use the same constant (for example density or constant A in this case), it's not practical to change that constant in 40 dialog windows one by one. That's the reason why I want one block ("Const") that defines that constant which will be used then by all 40 blocks. I know that it can be easily done in .xml file but, as I said, the block would be more elegant to me.

Apr-01-14 23:20:30
Category: Programming

I was thinking to make a block in library so I can drag it to designer window. And when I click on it there I want to change its parameters (e.g. parameter A) in the dialog window.

Mar-31-14 22:15:10
Category: Programming

Hi Koldo,

Yes, I know I can do that in .xml file, but the block seems more elegant way to me. Do you have any ideas?

Thanks

Mar-29-14 10:37:49
Category: Programming

Hi everyone,
I want to create a block which defines some physical constants that can be changed between simulations. Simple example:

model Const
    parameter Real A = 2;
end Const;

model Calc
    extends Const;
    parameter Real B = 3;
    Real C;
equation
    C = B + A;
end Calc;

So, variable C depends on parameters A and B. When I change parameter B in block Calc, the result (C) changes, but when I change the parameter A in block Const, the result (C) doesn't change. Model Calc always use the default value (2) of parameter A.

Can somebody help?

Thanks

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