Opened 8 years ago

Closed 8 years ago

#4446 closed defect (fixed)

Function input iteration leads to wrong results

Reported by: Patrick Täuber Owned by: Patrick Täuber
Priority: high Milestone: Future
Component: Backend Version:
Keywords: input iteration Cc:

Description (last modified by Patrick Täuber)

Calculating the following model leads to the wrong results for x[2]:

model testInputIteration
  Real x[2],z;
equation
  x[1] = 5+time;
  (x[1],x[2]) = f(z);
end testInputIteration;

function f
  input Real z;
  output Real x1;
  output Real x2;
algorithm
  x1 := z;
  x2 := z+2;
end f;

Output:
time=0, x[1]=5, x[2]=5, z=5

Related issue: #4046

Change History (2)

comment:1 by Patrick Täuber, 8 years ago

Description: modified (diff)
Status: newaccepted

comment:2 by Patrick Täuber, 8 years ago

Resolution: fixed
Status: acceptedclosed

Fixed together with #4046 in dc91086.

Note: See TracTickets for help on using tickets.