# TSSetType
Sets the method to be used as the timestepping solver. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSSetType(TS ts, TSType type)
```
Collective on ts


## Input Parameters

- ***ts   -*** The `TS` context
- ***type -*** A known method



## Options Database Key

- ***-ts_type <type> -*** Sets the method; use -help for a list of available methods (for instance, euler)





## Notes
See "petsc/include/petscts.h" for available methods (for instance)

- ***TSEULER -*** Euler
- ***TSSUNDIALS -*** SUNDIALS interface
- ***TSBEULER -*** Backward Euler
- ***TSPSEUDO -*** Pseudo-timestepping


Normally, it is best to use the `TSSetFromOptions()` command and
then set the `TS` type from the options database rather than by using
this routine.  Using the options database provides the user with
maximum flexibility in evaluating the many different solvers.
The TSSetType() routine is provided for those situations where it
is necessary to set the timestepping solver independently of the
command line or options database.  This might be the case, for example,
when the choice of solver changes during the execution of the
program, and the user's application is taking responsibility for
choosing the appropriate method.  In other words, this routine is
not for beginners.


## See Also
 [](chapter_ts), `TS`, `TSSolve()`, `TSCreate()`, `TSSetFromOptions()`, `TSDestroy()`, `TSType`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex1.c.html">src/ts/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex10.c.html">src/ts/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11.c.html">src/ts/tutorials/ex11.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11_sa.c.html">src/ts/tutorials/ex11_sa.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex12.c.html">src/ts/tutorials/ex12.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex13.c.html">src/ts/tutorials/ex13.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex14.c.html">src/ts/tutorials/ex14.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex15.c.html">src/ts/tutorials/ex15.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex16.c.html">src/ts/tutorials/ex16.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex16fwd.c.html">src/ts/tutorials/ex16fwd.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex17.c.html">src/ts/tutorials/ex17.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/tsreg.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)  
