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

Dependent parameter is not changing in FMU

Dependent parameter is not changing in FMU

Hello,

I have a simple model as follows:

Code:


model parameter_test
  parameter Real p1=1;
  parameter Real p2=p1;
  Real u1, u2;
equation
  u1 = p1;
  u2 = p2;
end parameter_test;

when i export it to FMU and import it back to OM, changing parameter p1 in the FMU block, does not affect any of p2, u1 and u2 after simulation;

i modified my code to the following then:

Code:


model parameter_test_2
  parameter input Real p1;
  parameter Real p2=p1;
  Real u1, u2;
equation
  u1 = p1;
  u2 = p2;
end parameter_test_2;

now changing p1 in FMU affects u1, but still the dependent parameter, p2 is not changing.

how can i modify this code, so that in the FMU, changing p1 affects p2 and u2 consequently?

Thanks,
Arvin

There are 0 guests and 0 other users also viewing this topic
You are here: