[petsc-users] Questions about TSAdjoint for time dependent parameters

Sajid Ali sajidsyed2021 at u.northwestern.edu
Thu Mar 12 20:31:43 CDT 2020


Hi Hong,

For the optimal control example, the cost function has an integral term
which necessitates the setup of a sub-TS quadrature. The Jacobian with
respect to parameter, (henceforth denoted by Jacp) has dimensions that
depend upon the number of steps that the TS integrates for.

I'm trying to implement a simpler case where the cost function doesn't have
an integral term but the parameters are still time dependent. For this, I
modified the standard Van der Pol example (ex20adj.c) to make mu a time
dependent parameter (though it has the same value at all points in time and
I also made the initial conditions & params independent).

Since the structure of Jacp doesn't depend on time (i.e. it is the same at
all points in time, the structure being identical to the time-independent
case), is it necessary that I create a Jacp matrix size whose dimensions
are [dimensions of time-independent Jacp] * -ts_max_steps ? Keeping Jacp
dimensions the same as dimensions of time-independent Jacp causes the
program to crash (possibly due to the fact that Jacp and adjoint vector
can't be multiplied). Ideally, it would be nice to have a Jacp analog of
TSRHSJacobianSetReuse whereby I specify the Jacp routine once and TS knows
how to reuse that at all times. Is this possible with the current
petsc-master ?

Another question I have is regarding exclusive calculation of one adjoint.
If I'm not interested in adjoint with respect to initial conditions, can I
ask TSAdjoing to not calculate that ? Setting the initialization for
adjoint vector with respect to initial conditions to be NULL in
TSSetCostGradients doesn't work.

Thank You,
Sajid Ali | PhD Candidate
Applied Physics
Northwestern University
s-sajid-ali.github.io
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200312/9af68815/attachment.html>


More information about the petsc-users mailing list