# L2 vs. L2 error in Differential Equations Benchmarks

**URL:** <https://discourse.julialang.org/t/l2-vs-l2-error-in-differential-equations-benchmarks/30039>\
**Category:** New to Julia\
**Created:** [October 18, 2019, 1:10am UTC](https://discourse.julialang.org/t/l2-vs-l2-error-in-differential-equations-benchmarks/30039 "2019-10-18T01:10:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nirvik](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@Nirvik](https://discourse.julialang.org/u/Nirvik)\
**Post date:** [October 18, 2019, 1:10am UTC](https://discourse.julialang.org/t/l2-vs-l2-error-in-differential-equations-benchmarks/30039/1 "2019-10-18T01:10:34Z")

</div>

How exactly is the L2 error calculated in Differential Equations WorkPrecisionSet? Not much is mentioned about it in the manual. I understand the l2 error calculates the error at every time step taken by the integrator Then how many points in the tspan is used for L2 error calculation?  
Thanks

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 18, 2019, 10:19am UTC](https://discourse.julialang.org/t/l2-vs-l2-error-in-differential-equations-benchmarks/30039/2 "2019-10-18T10:19:27Z")

</div>

It approximates it using 100 evenly spaced points:

[https://github.com/JuliaDiffEq/DiffEqBase.jl/blob/master/src/solutions/ode\_solutions.jl#L75-L79](https://github.com/JuliaDiffEq/DiffEqBase.jl/blob/master/src/solutions/ode_solutions.jl#L75-L79)

---

<div class="post-metadata">

**Author:** ![Nirvik](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@Nirvik](https://discourse.julialang.org/u/Nirvik)\
**Post date:** [October 18, 2019, 4:47pm UTC](https://discourse.julialang.org/t/l2-vs-l2-error-in-differential-equations-benchmarks/30039/3 "2019-10-18T16:47:54Z")

</div>

Thanks for the clarification.  
Since the L2 norm is used here as a measure of global error shouldn’t the number of equally spaced time points depend on the scale of the ‘tspan’?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [October 18, 2019, 6:32pm UTC](https://discourse.julialang.org/t/l2-vs-l2-error-in-differential-equations-benchmarks/30039/4 "2019-10-18T18:32:41Z")

</div>

> [@Nirvik](#):
>
> Since the L2 norm is used here as a measure of global error shouldn’t the number of equally spaced time points depend on the scale of the ‘tspan’?

There really isn’t a good general way to do that
