Opened 14 years ago

Closed 10 years ago

#1237 closed defect (fixed)

Array equations not handled inside of when equations

Reported by: Per Östlund Owned by: Per Östlund
Priority: high Milestone:
Component: Backend Version: 1.6.0
Keywords: Cc: Per Östlund

Description

Array equations are not handled inside of when equations yet. Support for DAE.ARRAY_EQUATION need to be added to at least DAEUtil.verifyWhenEquationStatements and DAE.lowerWhenEqn2. Example model:

function inv "a function to calculate inverse of a 2x2 matrix"
input Real A[2,2];
output Real B[2,2];
Real Det;
algorithm
Det:=A[1,1]*A[2,2]-A[2,1]*A[1,2];
B[1,1]:=A[2,2]/Det;
B[1,2]:=-A[1,2]/Det;
B[2,1]:=-A[2,1]/Det;
B[2,2]:=A[1,1]/Det;
end inv;

model inverse

Real P[2,2]={{6,4},{5,7}};
Real Q[2,2];
equation
when sample(0,0.5) then
Q=inv(P);
end when;
end inverse;

Change History (1)

comment:1 by Per Östlund, 10 years ago

Cc: perost, → perost
Component: Backend
Resolution: fixed
Status: newclosed

Seems to work now.

Note: See TracTickets for help on using tickets.