|
[Sponsors] |
June 19, 2005, 01:51 |
Error calculation
|
#1 |
Guest
Posts: n/a
|
I have both data files, i.e. solution by numerical scheme and exact analytical solution, I want to compute L^2 error and L^\infty error, Can sombody suggest me, How to calculate there errors as, I am bit confused? regards Ritesh
|
|
June 21, 2005, 22:13 |
Re: Error calculation
|
#2 |
Guest
Posts: n/a
|
L^\infty error is easy to calculate as it is the maximum error of all your errors. This means that if you have a number of points it would be max[ue_{i}-un_{i)].
L^2 error is little bit tricky it depends in what format you have your data. The L^2 error is defined \sqrt(\int_{domain} (ue-un)^2)). This means that you have to intergrate your error over the domain. If you have the data in element format, you could perform the integration in each element (through numerical integration) and add it. Simplest way in FEM is to do sqrt((ue-un)M(ue-un)), where (ue-un) is the vector of errors and M is the Mass matrix. However if you have it pointwise you should use some form of Gaussian quadrature to do the integration, I guess with interpolations of your errors onto the required Gauss points. I think also some post processing packages do integration too, maybe that would be easier. Regards, Cezary |
|
June 23, 2005, 13:39 |
Re: Error calculation
|
#3 |
Guest
Posts: n/a
|
Dear Ritesh,
The L_infty error is just the maximum of all the errors. Since you are having discrete data, an easy way of calculating the L2 error is L2 error = sqrt( \sum(abs(e_i))**2 / N ) where e_i are the individual errors and N is the number of values at hand. Note that abs()is not really necessary as the square of any value would be positive but the abs() is just to be liitle consistent with the definiton of norms. Note that these are the discrete norms and hence the summation. Since these errors are necessarily reported as a part of comparison of different methods(say), as long as the definition is consistent enough it can always be adopted. Hope this helps. Ganesh |
|
|
|