Minimal example for time varying control

Asked by Peter Maday

I was wondering if there was a minimal example for a time varying control problem?

As far as I can tell using time varying control variables is possible, however a little bit more involved at the moment than in static cases. Based on the "wetting_and_drying.py" example (https://code.launchpad.net/~libadjoint/dolfin-adjoint/applications) it seems to me that it can essentially be accomplished using a vector of control variables for each timestep with some juggling around inside the forward loop to make sure the control variables' effect is temporally localized. Is this the suggested example to study, or maybe there is a simpler one with less complexity?

Thanks a lot!

Question information

Language:
English Edit question
Status:
Solved
For:
dolfin-adjoint Edit question
Assignee:
No assignee Edit question
Solved by:
Simon Funke
Solved:
Last query:
Last reply:
Revision history for this message
Nico Schlömer (nschloe) said :
#1

I'd also be very much interested in this.

Revision history for this message
Best Simon Funke (simon-funke) said :
#2

Hi Peter and Nico,

I wrote a (relatively) small example for a time-dependent control optimisation. You can get it here:

https://gist.github.com/funsim/6775785

The way it works is that I create a list of control variables, for each timestep one. In the timeloop I then update the form such that it uses the correct control variable of that timestep.

Hope this helps,

Simon

Revision history for this message
Peter Maday (madapeti) said :
#3

Thanks Simon Funke, that solved my question.