Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5674 closed defect (fixed)

The NF does not count variables correctly when conditional components are involved

Reported by: Francesco Casella Owned by: Per Östlund
Priority: high Milestone: 1.16.0
Component: New Instantiation Version:
Keywords: Cc:

Description

Consider the following test model

model Test
  extends Modelica.Blocks.Interfaces.SO;
  parameter Boolean use_u = true;
  Modelica.Blocks.Interfaces.RealInput u if use_u;
protected
  Modelica.Blocks.Interfaces.RealInput u_internal;
equation
  y = u_internal;
  connect(u, u_internal) "Automatically removed if u is disabled";
  if not use_u then
    u_internal = 0;
  end if;
end Test;

The model is balanced and works correctly. However, if I check it I get:

Class Test has 2 equation(s) and 1 variable(s).

I understand the reason is that the NF ignores the fact that u_internal is protected and thus incorrectly removes it from the set of unknown variables.

Change History (5)

comment:1 by Per Östlund, 5 years ago

Component: New InstantiationFrontend
Status: newaccepted

Maybe fixed in #503.

This isn't actually a NF issue, but an issue with CheckModel which operates on the DAE after the NF is done. You get the same result when using the OF in fact.

comment:2 by Per Östlund, 5 years ago

Resolution: fixed
Status: acceptedclosed

comment:3 by Francesco Casella, 5 years ago

Thank you Per for the quick fix!

comment:4 by Francesco Casella, 5 years ago

Milestone: 1.15.01.16.0

Release 1.15.0 was scrapped, because replaceable support eventually turned out to be more easily implemented in 1.16.0. Hence, all 1.15.0 tickets are rescheduled to 1.16.0

comment:5 by Francesco Casella, 5 years ago

Component: FrontendNew Instantiation
Note: See TracTickets for help on using tickets.