strategy for refined accuracy Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » strategy for refined accuracy « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Benjamin Kaplan (kaplan)
New member
Username: kaplan

Post Number: 1
Registered: 08-2003
Posted on Wednesday, August 13, 2003 - 07:00 pm:   

Dear users of FlexPDE,
I run a program concerning a quite simple stedy-state diffusion problem (on Pentium IV 2,4GHZ; 512Mo RAM). In order to check the accuracy of my program I compare the result with an analytical solution. But when, I want to have very precise values by decreasing the "errlim" parameter at 1e-10, the program continue to stop at a grid where the "RMS error" is still 1e-9, and the "Max error" is about 1e-8. So, at this point the relative error with the analytical solution is still high (more than 5% !). What is the strategy to increase the accuracy of the result until a reasonnable error toward the analytical solution ? I have tried to optimize the dimension of the described region, to decrease the "changelim" value...but nothing change and the program stop again at the fifth regriding !
Thank you, if someone have an experience in this domain...
Best regards.
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Member
Username: rgnelson

Post Number: 12
Registered: 06-2003
Posted on Wednesday, August 13, 2003 - 09:02 pm:   

It is unlikely that you will ever achieve 1e-10 accuracy. Roundoff error increases as the number of nodes grows, and the hardware precision is only 16 digits.

If FlexPDE is reporting 1e-8 and you are still 5 percent off, there is something else wrong.

Possibilities:
a) you have incorrectly posed the problem or the boundary conditions.
b) the value where you observe 5% error is very small compared to the total range of values in the system. FlexPDE scales errors to the obsered range of values. So the percentage error where the solution appears to be negligible may be very high. Recast your equations so the variable of interest is dominant.
c) you have declared a variable range which is much larger than the actual values. This degrades the validity of the error measure in the same way as (b). Declare a RANGE which is the threshhold of negligibility, not the maximum ever seen.
d) the analytic solution pertains to a different system than yours.
e) you have a singularity in the system, which cannot be well modeled by piecewise polynomials.
Recast the equations in terms of a variable which is better behaved.

Top of pagePrevious messageNext messageBottom of page Link to this message

Benjamin Kaplan (kaplan)
New member
Username: kaplan

Post Number: 2
Registered: 08-2003
Posted on Thursday, August 14, 2003 - 07:13 am:   

Thank you very much indeed for the commentary about the accuracy of my simple problem. May be I have been a little ambiguous about the error larger than 5%.(So I join my script at the end... to be very precise myself, for those who may help).
In fact, there is more than 5% of error on the INTEGRATION of the "disk_flux", on the radius (=1) of the finite disk where the diffusion take place. There is effectively as you suggest in your commentary a singularity when (R=1;Z=0)at the connection between the disk and an insulator surface. May be the origin of this error came from this.
Best regards.
Benjamin.

Here is my little program:

TITLE 'Finite_Disk'
SELECT
changelim=0.1
ERRLIM=1E-11
gridlimit=20
COORDINATES
ycylinder(R,Z)
VARIABLES
TOC(range=0,1)
DEFINITIONS
RMAX =30
ZMAX = 30
FLUX = dZ(TOC)
ZETA=38.923100
CONSTANT_A=1.000000e-3
CONSTANT_B=0.500000
CONSTANT_C=0.000000
ENERGY=-0.200000
V_A=CONSTANT_A*TOC*exp(-CONSTANT_B*ZETA*(ENERGY-CONSTANT_C))
V_B=CONSTANT_A*(1-TOC)*exp((1-CONSTANT_B)*ZETA*(ENERGY-CONSTANT_C))
DISK_FLUX =FLUX*PI*2*R
INITIAL VALUES
TOC=1.000000
EQUATIONS
(1/R)*dR(TOC)+dZZ(TOC)+dRR(TOC)= 0

CONSTRAINTS
BOUNDARIES
region 1
start (0,0)
natural(TOC)=-V_A+V_B
line to (1,0)
natural(TOC)=0
line to (RMAX,0)
value(TOC)=1
line to (RMAX,ZMAX)
value(TOC)=1
line to (0,ZMAX)
natural(TOC)=0
line to finish

region 2
start (0,0)
line to (2,0) to (2,ZMAX/5) to (0,ZMAX/5) to finish

region 3
start (0,0)
line to (1.1,0) to (1.1,0.1*ZMAX) to (0,0.1*ZMAX) to finish

region 4
start (0,0)
line to (1,0) to (1,ZMAX/100) to (0,ZMAX/100) to finish

region 5
start (0.98,0)
line to (1.02,0) to (1.02,0.02) to (0.98,0.02) to finish


PLOTS
grid(R,Z)
contour(TOC) zoom(0,0,1+0.2*ZMAX,ZMAX/5)
elevation(TOC) from (0,0) to (10,0)
elevation(FLUX) from (0,0) to (2,ZMAX/5)
elevation(DISK_FLUX) from (0,0) to (1,0) zoom(0,0,0.25,1)
elevation(DISK_FLUX) from (0,0) to (2,0)
End
HISTORIES
END

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration