Opened 11 years ago
Last modified 6 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 , 6 years ago
| Cc: | added |
|---|
comment:2 by , 6 years ago
| Cc: | added; removed |
|---|---|
| Owner: | changed from to |
| Status: | new → assigned |
comment:3 by , 6 years ago
comment:4 by , 6 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.

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;