Re: [Q] Nonlinear Fitting in symbolic Integration ..?
- To: mathgroup at smc.vnet.net
- Subject: [mg82942] Re: [Q] Nonlinear Fitting in symbolic Integration ..?
- From: Peter Pein <petsie at dordos.net>
- Date: Sun, 4 Nov 2007 06:09:06 -0500 (EST)
- References: <fgc9f7$8g1$1@smc.vnet.net>
hwoarang schrieb: > Dear Mathgroup, > > I have experiment data and am trying to fit data to convoluted equation. > The equation contains UnitStep and symbolic Integrate function. > I think that these functions have some compolited problems according to searching > about related problems in archives. > But still, I have no idea whether the problem is in UnitStep, symbolic Integrate or NonlinearRegress.. -_-. > Does anybody out there have any ideas for this ? > Any help would be appreciated. > > I pasted math code. > > Sincerely, yours > Hwoarang. > > Math Code : > ----------------------------------------------------------------------------- > Remove["Global`*"]; > << "Statistics`NonlinearFit`" > k0 = 1; k1 =. ; k2 =. ; tau1 =. ; tau2 =. ; > response[t_, x_] := (UnitStep[t - x]*{k2*(1 - E^(-((t - x)/tau2))) + > (k1*(1 - E^(-((t - x)/tau1))))/E^((t - x)/tau2)})/E^(x^2/(2*0.1^2)) > convol[t_] = Integrate[(k0*response[t, x])/(2*Pi*0.1^0.5), {x, -1, 0}, > Assumptions -> {{t, k1, k2, tau1, tau2} ¡ô Reals && t > 0 && tau1 > 0 && > tau2 > 0 && k1 > 0 && k2 > 0}, GenerateConditions -> False] + > Integrate[(k0*response[t, x])/(2*Pi*0.1^0.5), {x, 0, 20}, > Assumptions -> {{t, k1, k2, tau1, tau2} ¡ô Reals && t > 0 && tau1 > 0 && > tau2 > 0 && k1 > 0 && k2 > 0}, GenerateConditions -> False] > dat = Import["Reflsmooth.txt", "Table"]; > ListPlot[dat]; > NonlinearRegress[dat, convol, t, {{k1, 0.4, 0.35, 0.45}, > {k2, 0.04, 0.035, 0.045}, {tau1, 0.35, 0.3, 0.4}, {tau2, 0.25, 0.2, 0.3}}, > ShowProgress -> True] > > -------------------------------------------------------------------------- > Jiwan Kim, Ph. D. Candidate, > Dept. of Physics and Center for Nanospinics of Spintronic Materials, > KAIST 373-1, Guseong-dong, Yuseong-gu, Daejeon, 305-701, Republic of Korea > Tel: +82-42-869-8163 > Cel: +82-16-870-7419 > Fax: +82-42-869-8162 > E-mail: hwoarang at kaist.ac.kr > > Hi, there are some details I do not understand: 1.) Why is response[] defined to return a list with one element? I would replace the curly braces with parentheses. Maybe NonlinearRegress doesn't like lists in models... 2.) Why do you add the integrals from -1 to 0 and from 0 to 20 instead of integrating from -1 to 20? (Or my eyes become old and I overlooked a difference in the integrands). We do not know the content of Reflsmooth.txt; so any help beyond the integrals is nearly impossible. But it might help to add the Option WorkingPrecision->20 (or higher) to the call of NonlinearRegress. HTH, Peter