# Calculate mangitude (of vector) in programmable filter

**URL:** https://discourse.paraview.org/t/calculate-mangitude-of-vector-in-programmable-filter/7884
**Category:** Development
**Tags:** python
**Created:** [August 28, 2021, 12:30pm UTC](https://discourse.paraview.org/t/calculate-mangitude-of-vector-in-programmable-filter/7884 "2021-08-28T12:30:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![massisenergy](https://discourse.paraview.org/user_avatar/discourse.paraview.org/massisenergy/32/6229_2.png) [@massisenergy](https://discourse.paraview.org/u/massisenergy)
#### Post date: [August 28, 2021, 12:30pm UTC](https://discourse.paraview.org/t/calculate-mangitude-of-vector-in-programmable-filter/7884/1 "2021-08-28T12:30:37Z")

</div>

I would like to calculate magnitude of a vector in the `programmable filter`. It’s possible to use the expression `mag(U)` in the `python calculator` filter but there is one drawback. However, `python calculator` can only take one vector at a time. I have two vectors (U, shearStress), the magnitude of which I want to calculate individually, with a single filter (in the `programmable filter`) as `python calculator` or `calculator` can’t do that.

Can someone please let me know what should be **the expression to calculate a vector magnitude**?

Without this, my workflow fails. I can access the vectors like this: [Vectors in Programmable Filter](https://discourse.paraview.org/t/vectors-in-programmable-filter/7645). I use programmable filter for exporting dataset at multiple timepoints: [Reveal underlying codes when executing commands in the paraView GUI](https://discourse.paraview.org/t/reveal-underlying-codes-when-executing-commands-in-the-paraview-gui/7878/6).
