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

Help with debugging a model

Help with debugging a model

I've got a model that works fine in Dymola but when I try to run the same thing in open Modelica it throws this error message at me.

assert | debug | <p>Invalid root: (-7.41609)^(0.62)</p>
assert | info | <p>simulation terminated by an assertion at initialization</p>

The equation that has such a root doesn't have any negative values, i.e. all the R.H.S values in the equations given below are inputs and none of them are negative. I'm not sure why there would be such an invalid root as what is mentioned in the error message. 

   Refp[j] = if j == 1 then mdot * D / (A * Mu_hc) else mdot * D / (A * Mu_l[j - 1]);
   f_fp[j]  = 17.24 / Refp[j] ^ 0.62;

Any suggestions on how to debug this error are welcome. Thanks in advance.

Edited by: knkc - Feb-03-17 09:53:00

Re: Help with debugging a model

Hi knkc,

According to your code below Refp[j] is not an input but is assigned a calculated value - one of the two expressions in the if statement.

The error message indicates that during initialization the value of Refp[j] becomes 17.24/(-7.41609) = -2.32468.

This means that one of the variables mdot, D, A, Mu_hc, Mu_I[j-1] must be negative.

Now, I don't know what the variables in your model represent but a guess would be that


  1. mdot is a mass flow rate that is calculated from a pressure difference

  2. the pressures are states in your model


If that is true then the pressure drop could be negative during initialization if their initial guesses are bad.

Best regards,
Rene Just Nielsen

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