Opened 17 years ago

Last modified 17 years ago

#1012 closed defect (fixed)

Solving of linear system of equations generates incorrect results.

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: critical Milestone:
Component: Simulation Code Generation Version: 1.4.5
Keywords: Cc: Adrian Pop, Adrian Pop

Description

Bug reported by H. Dieter Wilhelm.
Simulation of model Test below generates incorrect results.
{{{connector Port

Real pressure;

flow Real flowrate;

end Port;

model Pipe

Port port;

parameter Real a = 1;

equation

port.pressure = port.flowrate * a;

end Pipe;

model Pump

Port port;

equation

port.flowrate = -( time - port.pressure);

end Pump;

------------------------------

model Test

Pump pu;
Pipe pi;

equation

connect(pu.port,pi.port);

end Test;
}}}
{{{simulate(Test);
}}}

See the plot. 

The results should follow:
  pi.flowrate = time/(1+a)
 
but the results are basically constant (except for the time variable).
There is only a step change at the last time step!?

Attachments (2)

incorrect.png (9.3 KB ) - added by Adrian Pop 17 years ago.
correct.png (10.7 KB ) - added by Adrian Pop 17 years ago.
Correct output after bug was fixed.

Download all attachments as: .zip

Change History (4)

by Adrian Pop, 17 years ago

Attachment: incorrect.png added

comment:1 by Adrian Pop, 17 years ago

fixed in revision 3601.

by Adrian Pop, 17 years ago

Attachment: correct.png added

Correct output after bug was fixed.

comment:2 by Adrian Pop, 17 years ago

Correct output now after bug was fixed:

[{Image src='http://openmodelica.ida.liu.se:8080/cb/displayDocument/correct.png?attachment_id=40' alt= width='492' height='250' }]

Note: See TracTickets for help on using tickets.