:orphan:
# TSSetMaxStepRejections
Sets the maximum number of step rejections before a time step fails 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSSetMaxStepRejections(TS ts, PetscInt rejects)
```
Not Collective


## Input Parameters

- ***ts -*** `TS` context
- ***rejects -*** maximum number of rejected steps, pass -1 for unlimited



## Options Database Key

- ***-ts_max_reject -*** Maximum number of step rejections before a step fails





## See Also
 [](ch_ts), `TS`, `SNES`, `TSGetSNESIterations()`, `TSGetKSPIterations()`, `TSSetMaxSNESFailures()`, `TSGetStepRejections()`, `TSGetSNESFailures()`, `TSSetErrorIfStepFails()`, `TSGetConvergedReason()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex42.c.html">src/ts/tutorials/ex42.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex8.c.html">src/ts/tutorials/ex8.c</A><BR>


---
[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)  
