:orphan:
# TSForwardSetSensitivities
Sets the initial value of the trajectory sensitivities of solution w.r.t. the problem parameters and initial values.
## Synopsis
```
#include "petscts.h"
PetscErrorCode TSForwardSetSensitivities(TS ts, PetscInt nump, Mat Smat)
```
Logically Collective
## Input Parameters
- ***ts -*** the `TS` context obtained from `TSCreate()`
- ***nump -*** number of parameters
- ***Smat -*** sensitivities with respect to the parameters, the number of entries in these vectors is the same as the number of parameters
## Notes
Forward sensitivity is also called 'trajectory sensitivity' in some fields such as power systems.
This function turns on a flag to trigger `TSSolve()` to compute forward sensitivities automatically.
You must call this function before `TSSolve()`.
The entries in the sensitivity matrix must be correctly initialized with the values S = dy/dp|startingtime.
## See Also
[](ch_ts), `TSForwardGetSensitivities()`, `TSForwardSetIntegralGradients()`, `TSForwardGetIntegralGradients()`, `TSForwardStep()`
## Level
beginner
## Location
src/ts/interface/sensitivity/tssen.c
## Examples
src/ts/tutorials/ex16fwd.c
src/ts/tutorials/ex20fwd.c
src/ts/tutorials/ex23fwdadj.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/sensitivity/tssen.c)
[Index of all Sensitivity routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)