I’m attempting to fit a model to my numerical dataset. Unfortunately, the model contains rather complicated integral that cannot be solved analytically, but it can be solved numerically. Since the fitting is a numerical calculation, Mathematica should be able to find values for my fit parameters? My attempts have been unsuccessful. I either get errors saying it can’t do the numerical integration because some of the parameters are not numbers, or I get the cell evaluating for days with no results (presumably because it’s trying to find an analytical solution during each iteration of the fit). My Mathematica knowledge is limited to just the basics. I’ve tried a few combinations of Integrate/NIntegrate and FindFit without any luck.
I’m sure someone out there can help me.
Here are some details:
Data is intensity values in 2-D: {x, y, intensity}.
model = S0*Integrate[Exp[(-\[Gamma])*(Sin^2)[\[Theta]]]/(1+(a*(x-x0)*Cos[\[Theta]] + b*(y-y0)*Sin[\[Theta]]*Cos[\[Phi]])^2),{\[Theta], -(Pi/2),Pi/2}, {\[Phi], 0, 2*Pi}]
The parameters to fit are S0, gamma, a, b, x0, y0. Theta and Phi will be integrated out of the model… assuming the numerical integration will be done. All parameters and variables are real numbers. S0, gamma, a, and b, are all positive numbers.
Do you have any ideas on how to execute this fit?