Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#5674 closed defect (fixed)

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

Reported by: casella Owned by: perost
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 Changed 4 years ago by perost

  • Component changed from New Instantiation to Frontend
  • Status changed from new to accepted

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 Changed 4 years ago by perost

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:3 Changed 4 years ago by casella

Thank you Per for the quick fix!

comment:4 Changed 4 years ago by casella

  • Milestone changed from 1.15.0 to 1.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 Changed 4 years ago by casella

  • Component changed from Frontend to New Instantiation
Note: See TracTickets for help on using tickets.