Opened 11 years ago

Closed 11 years ago

#2230 closed defect (fixed)

model does not build - a discrete initialization generation bug ?

Reported by: Pavol Privitzer Owned by: Mahder Alemseged Gebremedhin
Priority: blocker Milestone: 1.9.0
Component: Code Generation Version: trunk
Keywords: Cc:

Description

Attached model does not build/simulate.
Build error (1 sample):
<<<
Dilution.c: In function 'eqFunction_83':

Dilution.c:1310: error: incompatible types when assigning to type 'modelica_real' from type 'real_array'

The problem bubbles also into C# generation, so the problem is somewhere in the SimCode or backend (??).
The attempted generated equations are from functionInitialEquations(), where seemingly unnecessary assignments of values to pre-values are generated.
The values are already set by the runtime, so the assignments are overshooting.
They are also using inappropriate ASUBs (with temporary arrays creation) instead direct crefs.
I'd recommend to filter them out completely to reduce bloating the generated code.

Attachments (1)

Dilution.mo (1.0 KB ) - added by Pavol Privitzer 11 years ago.
after fix, it should be able to simulate till stopTime=50

Download all attachments as: .zip

Change History (6)

by Pavol Privitzer, 11 years ago

Attachment: Dilution.mo added

after fix, it should be able to simulate till stopTime=50

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

Owner: changed from Martin Sjölund to sameguywhofixes#2217
Status: newassigned

comment:2 by Adrian Pop, 11 years ago

Owner: changed from sameguywhofixes#2217 to Mahder Alemseged Gebremedhin

comment:3 by Willi Braun, 11 years ago

seem to be connected to #2217.

My guess is that the generation of pre variables while the symbolic initialization is wrong, but it's just a guess.

comment:4 by Willi Braun, 11 years ago

Fixed in r16374.

comment:5 by Willi Braun, 11 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.