MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

using WorkingPrecision and AccuracyGoal to control the error of estim.

  • To: mathgroup at
  • Subject: [mg17068] using WorkingPrecision and AccuracyGoal to control the error of estim.
  • From: Jan Krupa <krupa at>
  • Date: Fri, 23 Apr 1999 02:32:08 -0400
  • Organization: NewsServer at NASK N.O.C.
  • Sender: owner-wri-mathgroup at

Probably this is a basic problem in general numeric computation
not only in Mathematica3.0.

Suppose I would like to find numerically, using the FindRoot built in
the root of the equation x^4-16=0. Let f[x]=x^2-16 and
"ex" the exact solution
"ax" the approximated solution obtained by FindRoot.

Is there an ability (rule) to choose proper WorkingPrecision,
(in some other function PrecisionGoal) and MaxIteration
to obtain the solution which fulfil the following condition:
cond1: er1=Abs[ex-ax]<epsilon  and
cond2: er2=Abs[f[ax]]<epsilon,
as an example put say epsilon=10^(-6).

Should I first to set AccuracyGoa->at least 6 and WorkingPrecision-> at
least 6 ?
Now FinRoot will of course only attempts to get the condition cond1 to
fulfilled (thanks to WorkingPrecision->6) but there is no option in
to control the cond2 (am I right?). Are there any rules how to choose
WorkingPrecision and AccuracyGoal  to achieve er1 and er2 < 10^-6


In[2]:=sol=FindRoot[f[x]==0,{x,1},WorkingPrecision->25, AccuracyGoal->6]



We see that we got much smaller er1 and er1 then 10^-6.

But how to set WorkingPrecision and AccuracyGoal
to solve the following (and to get er1<10^-6)



How can I ensure that er1 is really less then 10^-6 ? Should I write
own procedure with special stopping criteria?

What about the other numeric functions in MA?
e.g. NDSolve:

od1=NDSolve[{x'[t]==x[t],x[0]==1},x[t],{t,0,2},WorkingPrecision ->30,

How to set WorkingPrecision and AccuracyGoal
to solve the od1  and to get er1=Abs[xe[t]-xa[t]] < 10^-6?

Could someone please suggest book, article or url where could be found
description of the strategies how to obtain numerical solution
using all the mathematica3.0 (or more general book on numerical
function with given an arbitrary error or
how to estimate the error after calculation?

Thanks in advance


  • Prev by Date: Re: Areas via Rotation
  • Next by Date: Re: importing and using data
  • Previous by thread: Re: Basic Solid Modelling in Mathematica
  • Next by thread: Limit Problem