# Accuracy of the results

Hello Everyone!

I wanted to know how to check the accuracy of the results of NGSolve. I have been playing with `maxh` and the `order` of the approximation (as in fees). Is there any optimal value of maxh and the order? The problem that I am solving is linear and planar. How to check if the solution is converging to the true solution in NGSolve? Please help.

``````geo = geom2d.SplineGeometry()
p1,p2,p3,p4,p5,p6,p7,p8 = [geo.AppendPoint(x,y) for x,y in [(-5,-2.5),(5,-2.5),(5,0),(4,0),(4,-2),(-4,-2),(-4,0),(-5,0)] ]
origin = geo.AppendPoint(0,0)
order = 5

geo.Append (["line", p4, origin],bc="bc1",leftdomain=1,rightdomain=0)
geo.Append (["line", origin, p7],bc="bc2",leftdomain=1,rightdomain=0)

geo.Append (["line", p1, p2],leftdomain=2,rightdomain=0)
geo.Append (["line", p2, p3],leftdomain=2,rightdomain=0)
geo.Append (["line", p3, p4],leftdomain=2,rightdomain=0)
geo.Append (["line", p4, p5],leftdomain=2,rightdomain=1)
geo.Append (["line", p5, p6],leftdomain=2,rightdomain=1)
geo.Append (["line", p6, p7],leftdomain=2,rightdomain=1)
geo.Append (["line", p7, p8],leftdomain=2,rightdomain=0)
geo.Append (["line", p8, p1],leftdomain=2,rightdomain=0)

geo.SetMaterial(1, "inner")
geo.SetMaterial(2, "pmlregion")

mesh=Mesh(geo.GenerateMesh (maxh=5))
mesh.SetPML(pml.Cartesian((-4,-2),(-4,0),1j),"pmlregion")
mesh.Curve(order)
Draw(mesh)

fes = H1(mesh, order=2, complex=True)
u, v = fes.TnT()
``````

A minimal working code is attached above. The solution is assumed to be time harmonic.

Thank you.