Hi Josh,

In the FormFunctionAndGradient() function, the gradient you compute and provide 
TAO must be the gradient of the objective function with respect to the 
optimization variables. If your optimization variables are u, and your 
objective function is J(u), then FormFunctionGradient would need to compute 
J(u) and dJ/du.

I’m not entirely sure if I understand your problem correctly, but it seems that 
your minimal energy problem reduces to the solution of equation (1). Is this 
correct?

TAO is not the right package to solve time-dependent PDEs like (1) directly. 
You would want to use TS for that. However, TAO can be used to solve the 
original energy minimization problem. A good example of this is the canonical 
obstacle problem that aims to minimize the Dirichlet energy function subject to 
a constraint that represents the obstacle. That problem reduces to the solution 
of the Laplace equation with the appropriate boundary conditions matching the 
obstacle, which would be discretized and solved as a stand-alone PDE. However, 
the same problem can also be solved as an optimization problem where the 
objective function is the Dirichlet energy function, and the associated 
gradient is related to the stiffness matrix associated with the Laplace 
equation. The two formulations are mathematically equivalent. If I’m 
interpreting your problem correctly, you should be able to take a similar 
approach, but you would need to derive the gradient of your energy function and 
see how you can construct it in relation to equation (1).

——
Alp Dener
Argonne National Laboratory
http://www.mcs.anl.gov/person/alp-dener










On Sep 11, 2018, at 3:51 PM, Josh L 
<[email protected]<mailto:[email protected]>> wrote:

Hi,

I am using PETSc TAO to solve the following equation obtained from minimizing 
certain energy and constitutive model:

u_xx - u - u_t =0    (1)

For simplicity, the coefficients are neglected.
In the routine to form function value and gradient, I use (1) to form my 
gradient vector, and my energy definition to calculate function value.Is it 
correct?

I only found one tao example that solves time dependent problem, but it is 
using TS which I am not using.


Thanks,
Josh


Reply via email to