:orphan:
# TSComputeCostIntegrand
Evaluates the integral function in the cost functions. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSComputeCostIntegrand(TS ts, PetscReal t, Vec U, Vec Q)
```

## Input Parameters

- ***ts -*** the `TS` context
- ***t -*** current time
- ***U -*** state vector, i.e. current solution



## Output Parameter

- ***Q -*** vector of size numcost to hold the outputs





## Note
Most users should not need to explicitly call this routine, as it
is used internally within the sensitivity analysis context.


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

## Level
deprecated

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/sensitivity/tssen.c.html#TSComputeCostIntegrand">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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
