       Re: Fitting a inverse function from complicated integral

• To: mathgroup at smc.vnet.net
• Subject: [mg87231] Re: [mg87210] Fitting a inverse function from complicated integral
• From: Daniel Lichtblau <danl at wolfram.com>
• Date: Sat, 5 Apr 2008 04:20:57 -0500 (EST)
• References: <200804040757.CAA03920@smc.vnet.net>

```tibor dubaj wrote:
> Dear Group,
>
> I need to Fit this experimental data {x, OOT}:
>
> data = {
> {1, 444.6},
> {3, 455.15},
> {5, 464.81},
> {7, 467.79},
> {10, 469.01},
> {15, 480.28}}
>
> But there is a big problem with model equation:
>
> x = Integrate[A*Exp[-B/T], {T, 0, OOT}, Assumptions -> A > 0 && B > 0
> && OOT > 0]
>
> So, after integration:
>
> x = A (Exp[-B/OOT] OOT - B Gamma[0, B/OOT])
>
> I need to obtain a INVERSE function, i.e. OOT = f(x) and then find
> (e.g. via FindFit) best fitting parameters A, B.
>
> I have tried Series expansion, PadeApproximant etc., but every
> approximation of mentioned
> model contain A*Exp[-B/T], so I cannot find inverse function.
>
> Can Somebody help me with this problem?

Can be done by reversing data coordinates, specifying a function that
only works for numeric input (to disable symbolic processing), and
giving a large number of iterations.

data = {{1, 444.6}, {3, 455.15}, {5, 464.81}, {7, 467.79}, {10,
469.01}, {15, 480.28}};

func[a_?NumberQ, b_?NumberQ, oot_?NumberQ] :=
NIntegrate[a*Exp[-b/t], {t, 0, oot}]

ff = FindFit[Map[Reverse,data], func[a,b,oot], {a,b},
oot, MaxIterations->500]

Or could do:

xx[a_,b_,oot_] :=
Integrate[a*Exp[-b/t], {t,0,oot}, Assumptions->{a>0,b>0,oot>0}]

ff2 = FindFit[Map[Reverse,data], xx[a,b,oot], {a,b},
oot, MaxIterations->500]

Both give pretty much the same results:

In:= ff = FindFit[Map[Reverse,data], func[a,b,oot],
{a,b}, oot, MaxIterations->500]
Out= {a -> 1.99859*10^11, b -> 12547.7}

Here are the residuals:

gg = xx /. ff;

In:= (gg /. OOT -> data[[All, 2]]) - data[[All, 1]]
Out= {0.63067, 0.282454, 1.0629, 0.29016, -2.14352, 0.410461}

Daniel Lichtblau
Wolfram Research

```

• Prev by Date: Re: Re: Solve inconsistant actions?
• Next by Date: Re: Derivative of a Conjugate
• Previous by thread: Fitting a inverse function from complicated integral
• Next by thread: Re: Fitting a inverse function from complicated integral