# Order of convergence with no exact solution given

**URL:** <https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750>\
**Category:** General Discussion\
**Created:** [October 12, 2023, 8:08am UTC](https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750 "2023-10-12T08:08:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AbuAzzan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/abuazzan/32/1645_2.png) [@AbuAzzan](https://community.freefem.org/u/AbuAzzan)\
**Post date:** [October 12, 2023, 8:08am UTC](https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750/1 "2023-10-12T08:08:41Z")

</div>

Hi all Freefem developers and users  
I am concerned with calculating the order of convergence when no exact solution of an elliptic PDE is given. One way to determine its value at a grid point x is by

ϑ\_{i}=((log|u(x;_{h_{i}})-u\_{x;h\_{i}/2})|-log|u(x;_{h_{i}/2)}-u(x;_{h_{i}/4})|)/(log2))

where h\_{i}, h\_{i}/2, h\_{i}/4 are 3 consecutive meshes for the problem’s domain, which I did it well.

However, I am interested to calculate this order of convergence for all grid points to make it globally. Is there a way to do that in Freefem?

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [October 12, 2023, 11:14am UTC](https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750/2 "2023-10-12T11:14:23Z")

</div>

There might be a better way but does this help,

```auto
mesh Th=square(10,10);
mesh Th2=square(5,5);
fespace Vh(Th,P1);
fespace Vh2(Th2,P1);
Vh u=x;
Vh2 u2=x;

real v=int2d(Th)(u-u2(x,y));
cout<<v<<endl; cout.flush;

```

---

<div class="post-metadata">

**Author:** ![AbuAzzan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/abuazzan/32/1645_2.png) [@AbuAzzan](https://community.freefem.org/u/AbuAzzan)\
**Post date:** [October 14, 2023, 8:35am UTC](https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750/3 "2023-10-14T08:35:51Z")

</div>

Thank you Marchywka for your appreciated help.  
I modified my code with your suggestion (if I am not mistaken with that), but it did not work unfortunately. Could you check the code please, and try to possibly modify it?  
Keep in mind I am deliberately using the GMSH software for a technical meshing reason.  
[Schwarz alternating method\_nonlinear elliptic problem\_error analysis\_updated approach\_an example with GMSH.edp](https://community.freefem.org/uploads/short-url/lYmRr2DAi4pT6jEStETq6QaMhw3.edp) (10.1 KB)

---

<div class="post-metadata">

**Author:** ![AbuAzzan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/abuazzan/32/1645_2.png) [@AbuAzzan](https://community.freefem.org/u/AbuAzzan)\
**Post date:** [October 24, 2023, 5:38pm UTC](https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750/4 "2023-10-24T17:38:31Z")

</div>

Hi Marchywka,  
As I am engrossed with this problem, I am just asking if there is any further replies in this regards. I appreciate that.

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [October 24, 2023, 6:41pm UTC](https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750/5 "2023-10-24T18:41:54Z")

</div>

Sorry, IIRC I looked at your code and it looked like L-infinity or max and I wanted  
to get some papers looked up but I’ve been tied up on something unrelated.

---

<div class="post-metadata">

**Author:** ![AbuAzzan](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/abuazzan/32/1645_2.png) [@AbuAzzan](https://community.freefem.org/u/AbuAzzan)\
**Post date:** [November 9, 2023, 7:37am UTC](https://community.freefem.org/t/order-of-convergence-with-no-exact-solution-given/2750/6 "2023-11-09T07:37:08Z")

</div>

I have been trying to solve this problem but there is no progress. Could some one help me .  
With appreciation
