# TSGetCostIntegral
Returns the values of the integral term in the cost functions. It is valid to call the routine after a backward run. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSGetCostIntegral(TS ts, Vec *v)
```
Not Collective


## Input Parameter

- ***ts -*** the `TS` context obtained from `TSCreate()`



## Output Parameter

- ***v -*** the vector containing the integrals for each cost function





## See Also
 [](chapter_ts), `TS`, `TSAdjointSolve()`, ``TSSetCostIntegrand()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/sensitivity/tssen.c.html#TSGetCostIntegral">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)  
