Opened 5 years ago

Last modified 5 years ago

#5572 new defect

Delay operator in a for loop of an algorithm section

Reported by: adrien.guironnet@… Owned by: Lennart Ochel
Priority: high Milestone: Future
Component: Backend Version:
Keywords: Cc: alireza.masoom@…, ni.ding@…, Karim Adbdelhak, Andreas Heuermann

Description (last modified by Vitalij Ruge)

The following simple model using a delay operator in a for-loop inside an algorithm section is not handled by OpenModelica.

 model test3
     Real x=sin(377*time);
     Real z;
     parameter Real tau[:]={0.01,0.02};

  equation

  algorithm
     for k in 1: 2 loop
        z:=delay(x,tau[k]);

     end for;

    end test3;

original post:
https://stackoverflow.com/questions/56916012/error-due-to-delay-operator-in-algorithm-section

Change History (3)

comment:1 by Francesco Casella, 5 years ago

Is is possible to use equation instead of algorithm?

comment:2 by Vitalij Ruge, 5 years ago

Description: modified (diff)

comment:3 by Adrian Pop, 5 years ago

Cc: Karim Adbdelhak Andreas Heuermann added
Component: *unknown*Backend
Owner: changed from somebody to Lennart Ochel

The problem with this is that we fetch the delay expressions to be given to storeDelayedExpression but in our case the expressions are part of a for loop and contain iterators. Maybe the backend developers have an idea on how to fix this.

Note: See TracTickets for help on using tickets.