CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Error calculation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2005, 01:51
Default Error calculation
  #1
Ritesh
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
  Reply With Quote

Old   June 21, 2005, 22:13
Default Re: Error calculation
  #2
Cezary
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
  Reply With Quote

Old   June 23, 2005, 13:39
Default Re: Error calculation
  #3
ganesh
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
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 21:13.