Hey all,
In order to fit a lot of intensity measurement results over time t, I would like to use the following function:
function=Integrate[g[s+t] *Exp[-((s)/w)^2], {s, - w, w}]
Here, g(s) is the theoretical given intensity profile, while the "convolution" with the exponential function is kind of smoothing it. Function g(s) is defined as following:
$Assumptions =
x \[Element] Reals && \[Phi]p \[Element]
Reals && \[Phi]r \[Element] Reals && de \[Element] Reals;
e1[x_, \[Phi]r_] := Exp[I (x + \[Phi]r)];
e2[x_, \[Phi]p_, \[CapitalDelta]e_] := (1 + \[CapitalDelta]e) Exp[
I ( x + \[Phi]p)];
Int = (e1[x, \[Phi]r] +
e2[x, \[Phi]p, de]) Conjugate[(e1[x, \[Phi]r] +
e2[x, \[Phi]p, de])];
res1 = ExpToTrig[Simplify[Int]];
res2 = Simplify[res1 /. x -> 0];
TrigReduce[res2];
\[Phi][t_, \[Phi]0_, n_] =
If[Abs[t] < 1, \[Phi]0 Sqrt[1 - (Abs[t])^n], 0];
\[Phi][a (t + dt), \[Phi]0, n];
g[t_] = (res2 /. \[Phi]p -> \[Phi][a (t + dt), \[Phi]0, n]);
However, integration of function f(t) takes several minutes. This might be acceptable. But when I plot the function for distinct values of all the variables, the plot is even not finished after half an hour. As I would like to fit houndreds of data sets, this is inacceptable.
I have also tried to use a sum instead of an integral, in order to speed up:
function=sum[g[t + s] *Exp[-(s/w)^2], {s, -w, w, 0.01} ]
I have also tried to use the Convolve function of mathematica:
function=Convolve[g[s], Exp[-(s^2)], s, t]
Both with no improvement.
Do you have an idea how to computate the symbolic function in order to plot it in reasonable short time to perform fits to a lot of data sets?
I would be very pleased to hear your ideas. Thanks, Ka Me