# TSErrorWeightedNorm2
compute a weighted 2-norm of the difference between two state vectors 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSErrorWeightedNorm2(TS ts, Vec U, Vec Y, PetscReal *norm, PetscReal *norma, PetscReal *normr)
```
Collective


## Input Parameters

- ***ts -*** time stepping context
- ***U -*** state vector, usually ts->vec_sol
- ***Y -*** state vector to be compared to U



## Output Parameters

- ***norm -*** weighted norm, a value of 1.0 means that the error matches the tolerances
- ***norma -*** weighted norm based on the absolute tolerance, a value of 1.0 means that the error matches the tolerances
- ***normr -*** weighted norm based on the relative tolerance, a value of 1.0 means that the error matches the tolerances





## See Also
 [](chapter_ts), `TS`, `TSErrorWeightedNorm()`, `TSErrorWeightedNormInfinity()`

## Level
developer

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


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