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

PowerGrid library examples do not pass the check (problem & solution!)

PowerGrid library examples do not pass the check (problem & solution!)

Hi everyone,

I was trying to run the examples from the PowerGrid 1.0.0 library under OM 1.16.1 and I found that they didn't pass the check, so they couldn't be compiled and run.

The error was: "Following variable is discrete, but does not appear on the LHS of a when-statement ..."

I could get the model to pass the check (and to simulate) by commenting out the "discrete" identifier of three variables from the following two files:
  \lib\omlibrary\PowerGrids 1.0.0\Electrical\Branches\TransformerFixedRatioWithBreaker.mo
  \lib\omlibrary\PowerGrids 1.0.0\Electrical\Branches\LineConstantImpedanceWithBreakers.mo

These are the actual lines:
   discrete Types.ComplexAdmittance Y_actual "Actual series admittance";
   discrete Types.ComplexAdmittance YA_actual "Actual shunt admittance at port A";
   discrete Types.ComplexAdmittance YB_actual "Actual shunt admittance at port B";

After commenting them:
  /* discrete */ Types.ComplexAdmittance Y_actual "Actual series admittance";
  /* discrete */ Types.ComplexAdmittance YA_actual "Actual shunt admittance at port A";
  /* discrete */ Types.ComplexAdmittance YB_actual "Actual shunt admittance at port B";

Hope this helps to someone current/wink

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