Opened 6 years ago

Closed 6 years ago

#5031 closed defect (fixed)

Conditional equations should also be allowed when depending from conditions on iterators

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

Description

Please check Modelica.Electrical.QuasiStationary.Machines.Examples.TransformerTestbench. The NF fails with

[Modelica trunk/Electrical/QuasiStationary/MultiPhase.mo:672:11-672:68:writable]
Error: connect may not be used inside if-equations with non-parametric conditions
(found connect(deltaS.plugToPins_n.pin_n[j], deltaS.plugToPins_p.pin_p[j + 1])).

The offending code reads

      for j in 1:m loop
        if j < m then
          connect(plugToPins_n.pin_n[j], plugToPins_p.pin_p[j + 1]);
        else
          connect(plugToPins_n.pin_n[j], plugToPins_p.pin_p[1]);
        end if;
      end for;

I'm not sure if the specification covers this case explicitly, but obviously there is no reason to reject these equations, as the conditions are parametric once the loops are unrolled.

Change History (1)

comment:1 by Per Östlund, 6 years ago

Resolution: fixed
Status: newclosed

Fixed in b9d1619. The model now fails due to some Complex issues instead.

Note: See TracTickets for help on using tickets.