# TSAdjointMonitor
Runs all user-provided adjoint monitor routines set using `TSAdjointMonitorSet()` 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSAdjointMonitor(TS ts, PetscInt step, PetscReal ptime, Vec u, PetscInt numcost, Vec *lambda, Vec *mu)
```
Collective on ts


## Input Parameters

- ***ts -*** time stepping context obtained from `TSCreate()`
- ***step -*** step number that has just completed
- ***ptime -*** model time of the state
- ***u -*** state at the current model time
- ***numcost -*** number of cost functions (dimension of lambda  or mu)
- ***lambda -*** vectors containing the gradients of the cost functions with respect to the ODE/DAE solution variables
- ***mu -*** vectors containing the gradients of the cost functions with respect to the problem parameters





## Note
`TSAdjointMonitor()` is typically used automatically within the time stepping implementations.
Users would almost never call this routine directly.


## See Also
 `TSAdjointMonitorSet()`, `TSAdjointSolve()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/sensitivity/tssen.c.html#TSAdjointMonitor">src/ts/interface/sensitivity/tssen.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/sensitivity/tssen.c)


[Index of all Sensitivity routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
