:orphan:
# TSTrajectorySet
Sets a vector of state in the trajectory object
## Synopsis
```
#include "petscts.h"
PetscErrorCode TSTrajectorySet(TSTrajectory tj, TS ts, PetscInt stepnum, PetscReal time, Vec X)
```
Collective
## Input Parameters
- ***tj -*** the trajectory object
- ***ts -*** the time stepper object (optional)
- ***stepnum -*** the step number
- ***time -*** the current time
- ***X -*** the current solution
## Note
Usually one does not call this routine, it is called automatically during `TSSolve()`
## See Also
[](ch_ts), `TSTrajectorySetUp()`, `TSTrajectoryDestroy()`, `TSTrajectorySetType()`, `TSTrajectorySetVariableNames()`, `TSGetTrajectory()`, `TSTrajectoryGet()`, `TSTrajectoryGetVecs()`
## Level
developer
## Location
src/ts/trajectory/interface/traj.c
## Implementations
TSTrajectorySet_Basic in src/ts/trajectory/impls/basic/trajbasic.c
TSTrajectorySet_Memory in src/ts/trajectory/impls/memory/trajmemory.c
TSTrajectorySet_Singlefile in src/ts/trajectory/impls/singlefile/singlefile.c
TSTrajectorySet_Visualization in src/ts/trajectory/impls/visualization/trajvisualization.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/trajectory/interface/traj.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)