Opened 10 years ago

Last modified 5 years ago

#2969 assigned defect

differentiate delay expr

Reported by: Willi Braun Owned by: Andreas Heuermann
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: Cc: Karim Adbdelhak

Description

Differentiation of delay expression is not implementet, yet.
All delay expression get an index in BackendDAECreate,
but we don't know the next index while differentiation.

Change History (4)

comment:1 by Andreas Heuermann, 5 years ago

Cc: Andreas Heuermann added

comment:2 by Andreas Heuermann, 5 years ago

Cc: Karim Adbdelhak added; Andreas Heuermann removed
Owner: changed from Willi Braun to Andreas Heuermann
Status: newassigned

comment:3 by Andreas Heuermann, 5 years ago

Example for failing model:

model miniDelay
  Real x(start=0, fixed=true);
  Real entryTime;
equation
  entryTime = delay(time, 0.1, 0.1);
  der(x) = entryTime;

annotation(
    __OpenModelica_commandLineOptions = "-d=newInst --generateSymbolicJacobian");

end miniDelay;

comment:4 by Andreas Heuermann, 5 years ago

If the delay operator is only depending on time (like in miniDelay) we could simply set the derivative to zero. Only if the operator depends on states we need to actually compute a derivative.

model stateDelay
  Real x,y(start=0, fixed=true);
equation
  x = sin(time)+y;
  der(y) = delay(x, 0.1, 0.1);
end stateDelay;

Problem in this case: We need to store the values of the expression for each seed. Maybe a simple solution would be to use differential quotients to approximate the derivative in stead of storing values for all directional derivates for the Jacobian.

Last edited 5 years ago by Andreas Heuermann (previous) (diff)
Note: See TracTickets for help on using tickets.