:orphan:
# TSSetComputeExactError
Set the function used to automatically compute the exact error for the timestepping.
## Synopsis
```
#include "petscts.h"
PetscErrorCode TSSetComputeExactError(TS ts, PetscErrorCode (*exactError)(TS, Vec, Vec))
```
Logically collective
## Input Parameters
- ***ts -*** time stepping context
- ***exactError -*** The function which computes the solution error
## Calling sequence of `exactError`
```none
PetscErrorCode exactError(TS ts, Vec u)
```
- ***ts -*** The timestepping context
- ***u -*** The approximate solution vector
- ***e -*** The vector in which the error is stored
## See Also
[](ch_ts), `TS`, `TSGetComputeExactError()`, `TSComputeExactError()`
## Level
advanced
## Location
src/ts/interface/ts.c
## Examples
src/ts/tutorials/ex77.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/ts.c)
[Index of all TS routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)