question regarding gradient calculation in optimization demo.

Asked by Douglas Brinkerhoff

I've been studying the optimization demo, and I have a question about the derivation of one of its steps. I'm curious as to how the gradient is calculated. In general, to calculate an objective function gradient from an adjoint, one would have some sort of multiplication of the residual derivative by the adjoint solution. This demo seems to approach this step differently, generating a linear form for the gradient, including spatial derivatives of the adjoint and solution vectors, and assembling over a function space :

# Update of parameter
gradient = -inner(grad(z), w0*grad(u))*dx

where z is the solution of the adjoint problem, u is the solution of the forward problem, and w0 is a test function.

My question is, where does this expression come from, and how is it derived?

Perhaps not specifically relevant to a support forum, but I figured that the authors of the demo could probably offer more insight than other sources.

Thanks,
Doug.

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Marie Rognes (meg-simula) said :
#1

I'm guessing now, but I think this demo implements a Landweber algorithm for steepest decent and relates to Chapter 32 (Automatic calibration of depositional models) in the FEniCS book, see that reference for details.

Revision history for this message
Praveen C (cpraveen) said :
#2

Here is one way to do it. The pde is

-div(p*grad(u)) = 1
u = 0 on boundary

Change p --> p + dp, then u --> u + du

Derive a linear equation for du (linear in perturbations dp and du). On boundary du = 0.

dJ = 2*(u-u0)*du*dx + v*(linear pde for du)*dx

Do some integration by parts to get adjoint pde. Whatever is left is the gradient and should contain dp but not du. Note that p is taken to be piecewise constant. That should give you the explanation.

Revision history for this message
Martin Sandve Alnæs (martinal) said :
#3

On 14 June 2011 18:41, Marie Rognes
<email address hidden> wrote:
> Question #161340 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/161340
>
>    Status: Open => Answered
>
> Marie Rognes proposed the following answer:
>
> I'm guessing now, but I think this demo implements a Landweber algorithm for steepest decent and relates to Chapter 32 (Automatic calibration of depositional models) in the FEniCS book, see that reference for details.
>

That's correct.

For the record, note that instead of
  adjoint = (inner(grad(w1), p*grad(v1))*dx, -2*v1*(u - u0)*dx)
you can do
  adjoint = (adjoint(problem[0]), -derivative(J, u, v1))

and instead of
  gradient = -inner(grad(z), w0*grad(u))*dx
you can do
  gradient = -replace(problem[0], { v1: z, w1: u, p: w0 })

to get a more generic code.

Martin

Can you help with this problem?

Provide an answer of your own, or ask Douglas Brinkerhoff for more information if necessary.

To post a message you must log in.