Re: NonlinearRegress and numerical functions...
- To: mathgroup at smc.vnet.net
- Subject: [mg20186] Re: [mg20132] NonlinearRegress and numerical functions...
- From: Larske Ragnarsson <loke at ic.chalmers.se>
- Date: Tue, 5 Oct 1999 04:04:17 -0400
- Organization: Chalmers University of Technology
- References: <7t8d2v$gei@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Thanks for the feedback!!! The simple problem I provided was only to illustrate the problem. I DO need to use NDSolve... and the solution is integrated over energy. I want to fit the parameters which are involved both in NDSolve and the integration which means that I DO have to solver it each time (at least to my knowledge...) Here is what I'm trying to solve: k0[T_,Ef0_]:=1.43 10^-12 E^-(Ef0/keV/T) k1[T_,Ef1_]:=1.43 10^-12 E^-(Ef1/keV/T) Pb0H2[t_, T_, Ef0_, Ef1_, H20_, Pb00_, Pb10_] := (Pb0[t] /. (NDSolve[{Pb0'[t] == -k0[T, Ef0] H2[t]Pb0[t], Pb1'[t] == -k1[T, Ef1] H2[t]Pb1[t], H2'[t] == -k0[T, Ef0]/tox H2[t] Pb0[t] - k1[T, Ef1]/tox H2[t] Pb1[t], Pb0[0] == Pb00, Pb1[0] == Pb10, H2[0] == H20}, {Pb0[t], Pb1[t], H2[t]}, {t,0,10000}, MaxSteps -> 100000])[[1]])/Pb00 Pb0H2p[t_, T_, Ef0_, Ef1_, H20_, Pb00_, Pb10_] := Pb0H2[t0, T, Ef0, Ef1, H20, Pb00, Pb10] /. {t0 -> t} Pb0H2DistDouble[t_, T_, Ef0_, sigma0_, Ef1_, sigma1_, H20_, Pb00_, Pb10_] := NIntegrate[(Pb0H2p[t, T, Eff0, Eff1, H20, Pb00, Pb10]* PDF[NormalDistribution[Ef0, sigma0], Eff0]* PDF[NormalDistribution[Ef1, sigma1], Eff1]), {Eff0, Ef0 - 5sigma0, Ef0 + 5sigma0}, {Eff1, Ef1 - 5sigma1, Ef1 + 5sigma1}, Method -> Trapezoidal, AccuracyGoal -> 2, PrecisionGoal -> 2] Then I try to use Pb0H2DistDouble in NonlinearRegress (with one or more variables...) In this case I chose only one to see if it worked, but I ultimately want to fit on at least three of the variables (Ef0,Ef1,H20): NonlinearRegress[fittingdata, Pb0H2DistSingle[t, T, 1.51, 0.14, 1.57, 0.15, H20, 1.4 10^16, 1.1 10^16], {t, T}, {H20,{10^23,10^24},10^21,10^25}] Thank you for any help Regards Larske