Opened 12 years ago

Closed 7 years ago

#2091 closed defect (fixed)

reinit(der(x), ...) should give better error message

Reported by: Peter Aronsson Owned by: somebody
Priority: high Milestone: 2.0.0
Component: Frontend Version: trunk
Keywords: Cc: Lennart Ochel

Description

Validating this model:

model bouncingball
  Real y;
  Real dery13;
initial equation 
  y=5;
  der(y)=0;
equation 
  der(dery13)=-9.81;
  when {y < 0,y > 0} then
    reinit(der(y), (-0.95)*der(y));
  end when;
  dery13=der(y);
end bouncingball;

gives this error message:

Error: No matching function found for reinit in component <NO COMPONENT>
Error: Class reinit not found in scope bouncingball.
Error: Error occured while flattening model bouncingball

A more helpful message would be "Error: The first argument of reinit must be a variable of type Real or an array of such variables."

Change History (11)

in reply to:  description ; comment:1 by Lennart Ochel, 12 years ago

Replying to petar:

A more helpful message would be "Error: The first argument of reinit must be a variable of type Real or an array of such variables."

Or even better:

"Error: The first argument of reinit must be a variable of type Real or an array 
of such variables that must be selected as a state (resp., states) at least when 
the enclosing when clause becomes active"

comment:2 by Lennart Ochel, 12 years ago

Cc: Lennart Ochel added

comment:3 by Martin Sjölund, 11 years ago

Milestone: 1.9.01.9.1

Postponed until 1.9.1

comment:4 by Martin Sjölund, 10 years ago

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

comment:5 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

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

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

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

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

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

Milestone: 1.9.51.10.0

Milestone renamed

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

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

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

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

in reply to:  1 comment:11 by Francesco Casella, 7 years ago

Milestone: 1.12.02.0.0
Resolution: fixed
Status: newclosed

Replying to lochel:

Replying to petar:

A more helpful message would be "Error: The first argument of reinit must be a variable of type Real or an array of such variables."

Or even better:

"Error: The first argument of reinit must be a variable of type Real or an array 
of such variables that must be selected as a state (resp., states) at least when 
the enclosing when clause becomes active"

The new front end gives:

[1] 02:18:06 Translation Error
[M: 10:5-10:35]: The first argument to reinit must be a variable of type Real or an array of such variables.
Note: See TracTickets for help on using tickets.