# Not a number computing L2 and H1 errors

**URL:** https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040
**Category:** General Discussion
**Created:** [August 14, 2025, 7:20pm UTC](https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040 "2025-08-14T19:20:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![juanpaca](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/juanpaca/32/2807_2.png) [@juanpaca](https://community.freefem.org/u/juanpaca)
#### Post date: [August 14, 2025, 7:20pm UTC](https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040/1 "2025-08-14T19:20:02Z")

</div>

Dear FreeFem community, I hope you are well.

I am implementing a stabilized method for a reaction–diffusion model, which is

\sigma u - \epsilon \Delta u = f in \Omega, u = 0 on \partial \Omega. When I set \epsilon = 10^{-5} and \sigma = 1.0, and compute the L^2(\Omega) error, I get the following:

```auto
L2 error: -nan
H1 semi-norm error: -nan
H1 error: -nan

```

I get the same results for a standard Galerkin. I want to explore the error for \epsilon ranging from 10^{-3} to 10^{-6}. Do you know how to solve this?

---

<div class="post-metadata">

### Author: ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)
#### Post date: [August 14, 2025, 7:22pm UTC](https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040/2 "2025-08-14T19:22:55Z")

</div>

Your vector has NaN in it, so the norms are NaN.

---

<div class="post-metadata">

### Author: ![juanpaca](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/juanpaca/32/2807_2.png) [@juanpaca](https://community.freefem.org/u/juanpaca)
#### Post date: [August 14, 2025, 7:24pm UTC](https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040/3 "2025-08-14T19:24:45Z")

</div>

By vector you mean the vector of DoF’s of the solution u\_h?

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [August 25, 2025, 9:34am UTC](https://community.freefem.org/t/not-a-number-computing-l2-and-h1-errors/4040/4 "2025-08-25T09:34:09Z")

</div>

Yes, and try with greater ϵ=10^−5
