Opened 14 years ago

Last modified 7 years ago

#1551 new defect

Index reduction fails for "simple" model

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: Cc: Martin Sjölund, Frenkel, TUD, Lennart Ochel, Willi Braun

Description

model M
  Real y1,y2;
equation
  y1 = sin(time^2);
  y2 = der(der(y1));
end M;

Change History (5)

comment:1 by Jens Frenkel, 14 years ago

Dymola reports for this model:

The model has the same number of unknowns and equations: 2

Error: The model includes derivatives of order > 1 for:

y1


but that is not supported.

Errors detected in model.

Check aborted.

ERROR: 1 error was found



For this particular model it is possible to add a variable and an equation( Real dy1; der(y1) = dy1) to get a simulateable model. 


{{{model M

Real y1,y2,dy1;

equation

y1 = sin(time2);
dy1 = der(y1);
y2 = der(dy1);

end M;}}}

The question is if this is possible in general?

comment:2 by Martin Sjölund, 14 years ago

I don't know if it is possible in general, but you could either:

  • If index-reduction fails, add this equation (and try again)
  • Display an error message (like Dymola), but also add a suggestion that adding Real dy1 = der(y1) *might* result in a solvable model

comment:3 by Jens Frenkel, 13 years ago

  • since rev 9245 an error message is displayed. Adding Real dy1 = der(y1) is more complicated in  case of index-reduction fails (cause of get the reason for failing index reduction)

comment:4 by Per Östlund, 10 years ago

Cc: Frenkel TUD Lennart Ochel Willi Braun added; Jens Frenkel removed
Component: Backend
Milestone: Future
Version: trunk

In the current trunk an internal error message is shown, but the compilation continues anyway. A proper error message should be shown instead, and the compilation should abort.

in reply to:  4 comment:5 by Francesco Casella, 7 years ago

Replying to perost:

In the current trunk an internal error message is shown, but the compilation continues anyway. A proper error message should be shown instead, and the compilation should abort.

This is still the behaviour with 1.12.0-beta3. The compilation continues and later the C compiler fails.

If higher-order derivatives are not supported, after showing the error message

[1] 23:35:07 Translation Error
Internal error The model includes derivatives of order > 1 for: y1. 
That is not supported. Real dy1 = der(y1) *might* result in a solvable model

the compilation *must* abort

Note: See TracTickets for help on using tickets.