Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3693 closed defect (fixed)

root of negative value

Reported by: jan.hagemann@… Owned by: Lennart Ochel
Priority: high Milestone: 1.9.4
Component: Backend Version: v1.9.4-dev-nightly
Keywords: Cc: Patrick Täuber

Description

The example
testsuite/simulation/modelica/tearing/Tearing19-cel.mos
fails with activated wrapFunctionCalls-module.

The error dump:

assert            | warning | The following assertion has been violated during initialization at time 0.000000
assert            | debug   | Model error: Argument of asin($cse6) outside the domain -1.0 <= nan <= 1.0

This is strange, since cse variables are only introduced for the simulation system. The initialization is solved propably.

Change History (9)

comment:1 by Lennart Ochel, 9 years ago

It seems that the problem comes from a bad value that is calculated for $Px5 in function Tearing19_eqFunction_46 in Tearing19_02nls.c.

comment:2 by Lennart Ochel, 9 years ago

Cc: Patrick Täuber added

Tearing19_eqFunction_46 is one of the inner equations of a tearing set:

/*
 equation index: 46
 type: SIMPLE_ASSIGN
 x5 = (1.0 - (x4 ^ 4.0 + x0 * x1 * x2)) ^ 0.2
 */
void Tearing19_eqFunction_46(DATA *data, threadData_t *threadData)
{
  TRACE_PUSH
  const int equationIndexes[2] = {1,46};
  modelica_real tmp1054;
  tmp1054 = $Px4;
  tmp1054 *= tmp1054;
  e3 = pow(1.0 - (tmp1054 * tmp1054) + ($Px0) * (($Px1) * ($Px2)), 0.2);
  TRACE_POP
}

In this case, x5 is root of a negative number, which let function pow fail.

Probably, we should not solve explicitly for roots. Patrick, what do you think?

comment:3 by Lennart Ochel, 9 years ago

comment:4 by Lennart Ochel, 9 years ago

Summary: tearing example fails with activated wrapFunctionCalls moduleroot of negative value

comment:5 by Lennart Ochel, 9 years ago

Status: newaccepted

comment:6 by Lennart Ochel, 9 years ago

Resolution: fixed
Status: acceptedclosed

comment:7 by Lennart Ochel, 9 years ago

Milestone: Future1.9.4

comment:8 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:9 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.