# Plotting univariate function to compare against simulation results

**URL:** https://discourse.paraview.org/t/plotting-univariate-function-to-compare-against-simulation-results/12085
**Category:** Tips and Tricks
**Created:** [May 13, 2023, 4:13pm UTC](https://discourse.paraview.org/t/plotting-univariate-function-to-compare-against-simulation-results/12085 "2023-05-13T16:13:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![GregVernon](https://discourse.paraview.org/user_avatar/discourse.paraview.org/gregvernon/32/1494_2.png) [@GregVernon](https://discourse.paraview.org/u/GregVernon)
#### Post date: [May 13, 2023, 4:13pm UTC](https://discourse.paraview.org/t/plotting-univariate-function-to-compare-against-simulation-results/12085/1 "2023-05-13T16:13:59Z")

</div>

I was wondering today how to plot a known shear-stress profile against computed results. Came up with a solution, thought I’d share.

Let’s say I have the following data that I’ve created via `PlotOverLine` filters from a simulation solution:

 ![image](https://discourse.paraview.org/uploads/default/original/2X/5/52824fbbf6ee486a71df0eca01bde2ec5ed5882b.png)

And I want to create the actual function f(x) = \left(\frac{3}{2}\right)\left(\frac{-1e^{-6}}{1}\right)\left( 1 -\frac{x^2}{0.5^2}\right) and plot it on the same chart.

It seems like the _easiest_ way is to:

1. Apply a `Calculator` filter to the `PlotOverLine` filter
  - Use the `arc_length` variable as the independent variable, this variable is generated by the `PlotOverLine` filter

2. Apply a `PlotData` filter to the `Calculator`
  - The `Series Parameters` data array to plot has the same name as specified in the `Calculator` filter’s `Result Array Name` field.

Note that since `arc_length` is in the range `[0, 1]` and I know that I need `x = [-0.5, 0.5]` I had to shift my function in the `Calculator` filter:

```auto
( 1.5 ) * ( -1e-6 ) * ( 1 - ( ( ( arc_length - 0.5 )^2 ) / ( 0.5^2 ) ) )

```

![image](https://discourse.paraview.org/uploads/default/original/2X/2/220109841cbce7acf50358bd0194a2734be8cfc7.png)

 ![image](https://discourse.paraview.org/uploads/default/original/2X/b/b1e46a7a1222d40da0b787fabdd2fc1496ae013f.png)
