# TSTrajectoryGetVecs
Reconstructs the vector of state and its time derivative using information from the `TSTrajectory` and, possibly, from the `TS` 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSTrajectoryGetVecs(TSTrajectory tj, TS ts, PetscInt stepnum, PetscReal *time, Vec U, Vec Udot)
```
Collective on ts


## Input Parameters

- ***tj      -*** the trajectory object
- ***ts      -*** the time stepper object (optional)
- ***stepnum -*** the requested step number



## Input/Output Parameter


## Output Parameters

- ***time -*** On input time for the step if step number is `PETSC_DECIDE`, on output the time associated with the step number
- ***U    -*** state vector (can be NULL)
- ***Udot -*** time derivative of state vector (can be NULL)





## Notes
If the step number is `PETSC_DECIDE`, the time argument is used to inquire the trajectory.
If the requested time does not match any in the trajectory, Lagrangian interpolations are returned.


## See Also
 [](chapter_ts), `TS`, `TSTrajectory`, `TSTrajectorySetUp()`, `TSTrajectoryDestroy()`, `TSTrajectorySetType()`, `TSTrajectorySetVariableNames()`, `TSGetTrajectory()`, `TSTrajectorySet()`, `TSTrajectoryGet()`

## Level
developer

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


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