Here I have a piecewise function g:

f[x_] = Sqrt[0.5/(-x + 0.255)]*Exp[-Sqrt[-0.5*x + 2]] (*I use it in the piecewise function g below*);
g[y_] = Piecewise[{{f[y], 0.0 < y < 0.255}, {f[0], y <= 0.0}, {0.17, y >= 0.255}}]

Then I want to build a convolution function cf which has four arguments t, a, b and c:

cf[t_,a_,b_,c_] = Convolve[g[y], Exp[-1*a*(t - y)^2 + b], y, t] + c

So I use this convolution function to fit my data (you can download it at Google Drive) by using FindFitfunction:

FindFit[data, cf[t,a,b,c], {a,b,c}, t]

Unfortunately, it took so much time to get a result that I suspect there is something wrong in my code.

Any comment would be much appreciated.

  • $\begingroup$ The way it is defined the cf function seems to depend only on a,b,c and x. Is this correct ? $\endgroup$ – Lotus Mar 23 '18 at 6:47
  • $\begingroup$ In the definition g[y] I see a parameter x on the rigthhand side? Is this ok? $\endgroup$ – Ulrich Neumann Mar 23 '18 at 7:30
  • $\begingroup$ @UlrichNeumann Yes you are right. Sorry. $\endgroup$ – user57085 Mar 23 '18 at 7:51
  • $\begingroup$ @Lotus Do you mean there is an argument y in the cf function? $\endgroup$ – user57085 Mar 23 '18 at 7:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.