Re: Numerical Convolution
- To: mathgroup at smc.vnet.net
- Subject: [mg116790] Re: Numerical Convolution
- From: DrMajorBob <btreat1 at austin.rr.com>
- Date: Mon, 28 Feb 2011 05:00:26 -0500 (EST)
These are the same: F[f1_, A1_, \[CapitalGamma]1_, \[Omega]v1_, f2_, A2_, \[CapitalGamma]2_, \[Omega]v2_, \[Omega]_] = Abs[\[Chi]R[f1, A1, \[CapitalGamma]1, \[Omega]v1, \[Omega]] + \[Chi]R[f2, A2, \[CapitalGamma]2, \[Omega]v2, \[Omega]]]^2; positive = FullSimplify[ ComplexExpand[ F[f1, A1, \[CapitalGamma]1, \[Omega]v1, f2, A2, \[CapitalGamma]2, \[Omega]v2, \[Omega]], TargetFunctions -> {Re, Im}], f1 > 0 && A1 > 0 && \[CapitalGamma]1 > 0 && \[Omega]v1 > 0 && f2 < 0 && A2 > 0 && \[CapitalGamma]2 > 0 && \[Omega]v2 > 0 && \[Omega] > 0]; negative = FullSimplify[ ComplexExpand[ F[f1, A1, \[CapitalGamma]1, \[Omega]v1, f2, A2, \[CapitalGamma]2, \[Omega]v2, \[Omega]], TargetFunctions -> {Re, Im}], f1 > 0 && A1 > 0 && \[CapitalGamma]1 > 0 && \[Omega]v1 > 0 && f2 < 0 && A2 > 0 && \[CapitalGamma]2 > 0 && \[Omega]v2 > 0 && \[Omega] < 0]; positive === negative True so we get an equivalent function (near the parameters from your example) WITHOUT imaginaries, with eff[f1_, A1_, \[CapitalGamma]1_, \[Omega]v1_, f2_, A2_, \[CapitalGamma]2_, \[Omega]v2_, \[Omega]_] = positive (f2 \[CapitalGamma]2 (A2 f2 \[CapitalGamma]2 (\[CapitalGamma]1^2 + (\ \[Omega] - \[Omega]v1)^2) + 2 Sqrt[A1 A2] f1 \[CapitalGamma]1 (\[CapitalGamma]1 \[CapitalGamma]2 + (\ \[Omega] - \[Omega]v1) (\[Omega] - \[Omega]v2))) + A1 f1^2 \[CapitalGamma]1^2 (\[CapitalGamma]2^2 + (\[Omega] - \ \[Omega]v2)^2))/((\[CapitalGamma]1^2 + (\[Omega] - \[Omega]v1)^2) (\ \[CapitalGamma]2^2 + (\[Omega] - \[Omega]v2)^2)) I also have have an approximation: NIntegrate[ eff[1, 20, 5, 1702, -1, 10, 3, 1692, x] PDF[NormalDistribution[0, 3], y - x], {x, 1650, 1800}, {y, 1701 - 35, 1701 + 35}] 269.03 The x limits were based on a look at the graph: Plot[eff[1, 20, 5, 1702, -1, 10, 3, 1692, x], {x, 1692 - 10^2, 1692 + 10^2}, PlotRange -> All] and locating the maximum: NMaximize[{eff[1, 20, 5, 1702, -1, 10, 3, 1692, x], 1650 < x < 1750}, x] {19.1435, {x -> 1700.97}} That's at most a start to the general problem, of course. Bobby On Sun, 27 Feb 2011 03:34:20 -0600, Dan O'Brien <obrie425 at umn.edu> wrote: > I'm attempting to write a function that can be used as the expression in > NonlinearModelFit. In general, the function is a convolution of a > gaussian and any arbitrary function. Here I have defined it using the > complex functions \[Chi]R > > \[Chi]R[f_, a_, \[CapitalGamma]_, \[Omega]v_, \[Omega]_] := > f (Sqrt[Abs[a]] Abs[\[CapitalGamma]])/(-(\[Omega] - \[Omega]v) - > I Abs[\[CapitalGamma]]) > > F[f1_, A1_, \[CapitalGamma]1_, \[Omega]v1_, f2_, > A2_, \[CapitalGamma]2_, \[Omega]v2_, \[Omega]_] := > Abs[\[Chi]R[f1, > A1, \[CapitalGamma]1, \[Omega]v1, \[Omega]] + \[Chi]R[f2, > A2, \[CapitalGamma]2, \[Omega]v2, \[Omega]]]^2 > > (*Cannot evaluate this integral*) > conv[f1_, A1_, \[CapitalGamma]1_, \[Omega]v1_, f2_, > A2_, \[CapitalGamma]2_, \[Omega]v2_, \[Omega]_] := > Convolve[PDF[NormalDistribution[0, 3], x], > F[f1, A1, \[CapitalGamma]1, \[Omega]v1, f2, > A2, \[CapitalGamma]2, \[Omega]v2, x], x, \[Omega]] > > conv[1, 20, 5, 1702, -1, 10, 3, 1692, \[Omega]](*I stop it after a \ > few minutes on my machine,windows xp sp3 Mathematica 8.0*) > > (*So my thought was to try to set up a numerical convolution in the \ > vicinity of my domain of interest.*) > > Nconv[f1_, A1_, \[CapitalGamma]1_, \[Omega]v1_, f2_, > A2_, \[CapitalGamma]2_, \[Omega]v2_] := > Interpolation[ > ParallelTable[{i, > NIntegrate[ > PDF[NormalDistribution[0, 3], x] F[f1, > A1, \[CapitalGamma]1, \[Omega]v1, f2, > A2, \[CapitalGamma]2, \[Omega]v2, > i - x], {x, -\[Infinity], \[Infinity]}]}, {i, 1620, 1740}]] > > (*So the interpolation function would be used to fit my data in \ > NonlinearModelFit.But this doesn't work to use as the model \ > expression and I'm not sure where to begin to make it work.Even to \ > plot it,it must be evaluated first and then used*) > > g = Nconv[1, 20, 5, 1702, -1, 10, 3, 1692] > > Plot[{g[\[Omega]], > F[1, 20, 5, 1702, -1, 10, 3, 1692, \[Omega]]}, {\[Omega], 1620, > 1740}, PlotRange -> All] > > Is there a better way to do this? Any help is very much appreciated. > > -Dan > > -- DrMajorBob at yahoo.com