       tracking precision through ndsolve, findfit, regress, etc

• To: mathgroup at smc.vnet.net
• Subject: [mg61535] tracking precision through ndsolve, findfit, regress, etc
• From: Chris Chiasson <chris.chiasson at gmail.com>
• Date: Sat, 22 Oct 2005 00:35:19 -0400 (EDT)
• Sender: owner-wri-mathgroup at wolfram.com

```For anyone who may have noticed me asking a bunch of arbitrary
precision related questions recently, yes - I did just finally figure
out how to use precision to track "significant digits" through
calculations. Sorry I'm slow...

Anyway, I have a few questions:

If a distance is measured with a ruler to be 7 and 3/16" inches + or -
0.5/16" inches, how should the precision of the distance number be
set?

FindRoot and Regress (by default if the inputs don't require high
precision) both seem to return numbers that are "machine precision
floats". This means they do not carry through the (possibly low)
precision (or significance arithmetic or whatever... too many names)
of their inputs to their outputs.

For example:
xample=0.025`1
FindRoot[x==xample,{x,.4}]

The following is also encouraging:
Interpolation does know how to create InterpolatingFunctions that will
track significance *if* the interpolated data as well as the argument
to the InterpolatingFunction both have significance numbers to track:
data=Sort@Map[Random[Real,#]&,{{1,2},{3,4},{5,6},{7,8}},{2}]
data=SetPrecision[data,5]
Interpolation[data][Max[data[[All,1]]]/2]
Interpolation[data][Max[data[[All,1]]]/2]

Unfortunately, NDSolve doesn't seem to be able to create significance
tracking InterpolatingFunctions:
eqns=x'[t]==2`20 x[t]+4`6&&x==1`15
x/.DSolve[eqns,x,t][]
x/.NDSolve[eqns,x,{t,0,6}][]

Anyway, all of this has me thinking. If Mathematica doesn't have an
automated solution to the Regress, FindRoot, and NDSolve significance
tracking problems - is it possible to track significance at all
through "routines" like these?

Is there a way to know what precision (number of significant digits)
of answer satisfies the original equations which I am trying to solve?

BTW, if someone is wondering, my full "equations" through which I am
trying to carry significance are as follows in the two commands below:

myeqns[cNapRatio_,acCap_]=
Equal[Times[Power[Log,-1],Log[acCap[cNapRatio]]],
Plus[Times[0.6107999999999999999`0.9956786262173576,cNapRatio],
Times[-2.0360000000000000001`2.9999999999999996,
Plus[Times[-0.0061540230743798795`0.9978339382434933,
Power[acCap[cNapRatio],-2],
Power[Power[acCap[cNapRatio],2],Rational[1,2]]],
Times[Power[2,Rational[-1,2]],
Power[Plus[Times[2,cNapRatio],
Times[0.0410268204958658633`3.3010299956639817,
Power[acCap[cNapRatio],-2],
Power[Power[acCap[cNapRatio],2],Rational[1,2]]]],
Rational[1,2]],
Power[Plus[1,
Times[Power[2,Rational[-1,2]],
Power[Plus[Times[2,cNapRatio],
Times[0.0410268204958658633`3.3010299956639817,
Power[acCap[cNapRatio],-2],
Power[Power[acCap[cNapRatio],2],Rational[1,2]]]],
Rational[1,2]]]],-1]]]]]]
mysolns=
NDSolve[Evaluate[
And[D[myeqns[cNapRatio,acCap],cNapRatio],
acCap\[Equal](acCap/.FindRoot[
Evaluate[myeqns[0,acCap]],{acCap,0.6}])]],
acCap,{cNapRatio,0,0.5}] (*homotopic continuation - thanks Carl
Woll! - (yes I did figure out what that means)*)