Opened 11 years ago

Last modified 11 years ago

#2310 closed defect

referenced a variable that was not declared as a <variable> — at Version 3

Reported by: Lennart Ochel Owned by: Lennart Ochel
Priority: critical Milestone: 1.9.0
Component: Code Generation Version: trunk
Keywords: Cc: Adeel Asghar, Martin Sjölund

Description (last modified by Lennart Ochel)

This model should probably be simulated without errors:

model foo
  Real a;
  Real b(fixed=true);
initial equation
  pre(a) = b^2;
equation
  der(a) = time;
  when initial() then
    b = pre(a);
  end when;
end foo;

output:

assert            | assert  | Referenced '$PRE._a' that was not declared as <variable>


Process crashed

Change History (3)

comment:1 by Lennart Ochel, 11 years ago

Description: modified (diff)

comment:2 by Lennart Ochel, 11 years ago

Owner: changed from probably noone to Lennart Ochel
Status: newassigned

With +d=initialization I get also:

Assuming fixed start value for the following 1 variables:
         a:VARIABLE() .foo, .Real type: Real

This is wrong. The initial conditions are already fully specified.

comment:3 by Lennart Ochel, 11 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.