This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Modify Reduced Functional during optimization

0 votes

Hi!

Is there a way of modify the reduced functional during an optimization? I am asking because I want to use the scheme of updating coefficients in an multi objective optimization. This way, the parts that compound the multi objective functional do not become very different from each other (numerically).

Thanks!

asked May 23, 2016 by C. Okubo FEniCS Novice (470 points)

1 Answer

0 votes

I believe I found!

For a Functional with respective Reduced Functional:

J = Functional(w_e * Energy_dissipation(u, rho) + \
  (en_coeff(u, rho)/vort_coeff(u, rho)) * w_v * Vorticity(u,rho) + \
  (en_coeff(u, rho)/torq_coeff(u, rho)) * w_t * Torque(u,rho))

  m = Control(rho)                                        # Control
  Jhat = ReducedFunctional(J, m, eval_cb_post = eval_cb)  # Reduced Functional

I am defining the following coefficients:

def en_coeff(u, rho):
    (u_tape,p_tape) = split(DolfinAdjointVariable(w).tape_value())
    return assemble(Energy_dissipation(u_tape, rho))

def vort_coeff(u, rho):
    (u_tape,p_tape) = split(DolfinAdjointVariable(w).tape_value())
    return assemble(Vorticity(u_tape, rho))

def torq_coeff(u, rho):
    (u_tape,p_tape) = split(DolfinAdjointVariable(w).tape_value())
    return assemble(Torque(u_tape, rho))

Code is still a little messy, sorry about that. Could anyone confirm that this really changes during the optimization?

answered May 23, 2016 by C. Okubo FEniCS Novice (470 points)

Forget....it doesn't seem to be working..

...