0
$\begingroup$

I want to convolve two equation, then I want to find the parameters. But it doesn't give the answer and Takes too much time. What is the wrong with my code?

nlm = NonlinearModelFit[
   data, {Convolve[
     a*UnitStep[x - b]*c*Sqrt[x - b]*
       Divide[Pi*Divide[Sqrt[d], Sqrt[x - b]]*
         Exp[Pi*Divide[Sqrt[d], Sqrt[x - b]]], 
        Sinh[Pi*Divide[Sqrt[d], Sqrt[x - b]]]] + 
      a*d*Sum[Divide[4*Pi, n^3]*DiracDelta[x - b + d/n^2], {n, 1, 1}],
      VoigtDistribution, x, y], b < Min[data[[All, 1]]], 
    b < Min[data[[All, 1]]]}, {{a, 10}, {b, -1}, c, d}, x];
nlm["BestFitParameters"]
$\endgroup$
  • 2
    $\begingroup$ I noticed, that VoigtDistribution requieres 2 parameters but you provided none. $\endgroup$ – meneken17 Sep 24 '18 at 19:54
  • $\begingroup$ What does it mean, is it X and y?could you tell me how to use Voigt distribution function correctly $\endgroup$ – Tharaka Sep 25 '18 at 0:13
  • $\begingroup$ How do I enter those parameters with my code? I have around 600 experimental data. Could you please make it correct? $\endgroup$ – Tharaka Sep 25 '18 at 1:55
  • $\begingroup$ You've asked 8 questions (with several of them appearing to be about the same dataset and model), few responses from you, and no accepting of any answers. Please respond to the answers and/or comments to get this issue resolved. $\endgroup$ – JimB Nov 26 '18 at 16:25
0
$\begingroup$

I neither know the context of your calculation nor do I know properties of the Voigt distribution so I cannt help you choose those: According to the reference and the wikipedia-article it should be VoigtDistribution[sigma,delta] where sigma is the standard-error of the underlying gauss distributionand delta is the $\gamma$ of the unerdlying Lorentz distribution.

As VoigtDistribution[\sigma,\delta] gives you a distribution you have to use

PDF[VoigtDistribution[sigma,delta],x]

Secondly you should test around if your expression within the NonlinearModel fit evaluates and trace the error piece by piece.

$\endgroup$
  • 2
    $\begingroup$ Should one find the built-in Voigt function to be too slow, this might be of interest. $\endgroup$ – J. M. will be back soon Sep 28 '18 at 8:49
  • $\begingroup$ Thank you very much $\endgroup$ – Tharaka Nov 28 '18 at 19:27

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.