petsc-3.7.1 2016-05-15
Report Typos and Errors

# TSAdjointSolve

Solves the discrete ajoint problem for an ODE/DAE

### Synopsis

    #include "petscts.h"
    PetscErrorCode TSAdjointSolve(TS ts)

Collective on TS Many br

### Input Parameter

ts -the TS context obtained from TSCreate() Many br

### Options Database

-ts_adjoint_view_solution <viewerinfo> -views the first gradient with respect to the initial conditions Many br

Many br

### Notes

This must be called after a call to TSSolve() that solves the forward problem Many br

By default this will integrate back to the initial time, one can use TSAdjointSetSteps() to step back to a later time Many br

### Keywords

TS, timestep, solve

### See Also

TSCreate(), TSSetCostGradients(), TSSetSolution(), TSAdjointStep()

Level:intermediate
Location:src/ts/interface/ts.c
Index of all TS routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ts/examples/tutorials/ex16adj.c.html
src/ts/examples/tutorials/ex16opt_p.c.html
src/ts/examples/tutorials/ex16opt_ic.c.html
src/ts/examples/tutorials/ex20adj.c.html
src/ts/examples/tutorials/ex20opt_p.c.html
src/ts/examples/tutorials/ex20opt_ic.c.html