# TSSetConvergedReason
Sets the reason for handling the convergence of `TSSolve()`. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSSetConvergedReason(TS ts, TSConvergedReason reason)
```
Logically Collective; reason must contain common value


## Input Parameters

- ***ts -*** the `TS` context
- ***reason -*** negative value indicates diverged, positive value converged, see `TSConvergedReason` or the
manual pages for the individual convergence tests for complete lists





## Note
Can only be called while `TSSolve()` is active.


## See Also
 [](chapter_ts), `TS`, `TSSolve()`, `TSConvergedReason`

## Level
advanced

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


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
