Opened 15 years ago

Last modified 14 years ago

#1234 closed defect (fixed)

Biochem model gives lookup error message but succeeds with instantiation

Reported by: Peter Aronsson Owned by: Peter Aronsson
Priority: critical Milestone: Red October
Component: Version:
Keywords: Cc: Peter Aronsson, Adrian Pop, AlexeyLebedev

Description

The attached model gives the following message:

"Error: Variable PN.n1 not found in scope BioChem.Examples.centralMetabolism.cytosol
Error: Variable cytosol.V not found in scope BioChem.Examples.centralMetabolism.extra_cellular

But it succeeds with instantiation.

Attachments (4)

extra_cellularTotal.mo (113.1 KB ) - added by Peter Aronsson 15 years ago.
ContainerTotal.mo (107.5 KB ) - added by Peter Aronsson 15 years ago.
More examples with similar error.
CytosolTotal.mo (72.8 KB ) - added by Peter Aronsson 15 years ago.
More examples with similar error.
ContainerSimple.mo (23.9 KB ) - added by AlexeyLebedev 14 years ago.
A simplified version of ContainerTotal.mo with the same problem

Download all attachments as: .zip

Change History (9)

by Peter Aronsson, 15 years ago

Attachment: extra_cellularTotal.mo added

by Peter Aronsson, 15 years ago

Attachment: CytosolTotal.mo added

More examples with similar error.

comment:1 by Peter Aronsson, 15 years ago

Added two more examples with similar problems, but these fail to instantiate.

comment:3 by AlexeyLebedev, 14 years ago

All three models are incorrect: they contain components whose names coincide with their types' names. In extra_cellularTotal.mo, it is cytosol in Biochem.Examples.centralMetabolism.extra_cellular; in cytosolTotal.mo, it is Endoplasmic_Reticulum in Biochem.Examples.CaOscillations.Cytosol; in ConatainerTotal.mo, these are Nucleus and Cytoplasm in BioChem.Examples.CircadianOscillator.Container . Modelica specifications forbid this (section 4.2).

If one fixes the names, no error messages are produced anymore. However, the files cytosolTotal.mo and ConatainerTotal.mo still fail to instantiate.

comment:4 by AlexeyLebedev, 14 years ago

The file cytosolTotal.mo can be instantiated if one removes the lines
{{{ import BioChem.Math.*;

import BioChem.Constants.*;}}}

in Biochem.Examples.CaOscillations.Cytosol; ContainerTotal.mo can be instantiated if one removes the same lines in BioChem.Examples.CircadianOscillator.Container .

Don't know why it happens, though.

by AlexeyLebedev, 14 years ago

Attachment: ContainerSimple.mo added

A simplified version of ContainerTotal.mo with the same problem

comment:5 by Adrian Pop, 14 years ago

Found the problem: InstExtends.getLocalIdentElement did not handle Absyn.UNQUAL_IMPORT.
I'll push a fix as soon as I run the testsuite.

comment:6 by Adrian Pop, 14 years ago

Fixed in revision 6298 (see SCM Commits).

Note: See TracTickets for help on using tickets.