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

BackendDAEOptimize.makeEquationToResidualExp failed to transform equat

BackendDAEOptimize.makeEquationToResidualExp failed to transform equat

Hello

I currently have a problem when I try to run a calculation with this attached module.
I have a feeling that the problem is located on the if loop is not performing properly on initialization.
I get this error:
Internal error - BackendDAEOptimize.makeEquationToResidualExp failed to transform equation: tank1_4.mediumStream = test_model.Models.TestPressurelosses.tank1_4.Medium.setState_phX(tank1_4.p, tank1_4.h, {}, 0) to residual form!

Should I change the shape of the loop?


model-tank.zip


Thank you for your help
Steven

Attachments:

Re: BackendDAEOptimize.makeEquationToResidualExp failed to transform equat

I update this post.
The problem was with the if.
It is necessary to modify the structure of the if
       if portA.m_flow> = 0 then
         mediumA = Medium.setState_ph (portA.p, inStream (portA.h_outflow));
       else
         mediumA = Medium.setState_ph (portA.p, portA.h_outflow);
       end if;

in :
      mediumA = (if portA.m_flow> = 0 then Medium.setState_ph (portA.p, inStream (portA.h_outflow)) else Medium.setState_ph (portA.p, portA.h_outflow));

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