Message Boards Message Boards

0
|
2162 Views
|
8 Replies
|
1 Total Likes
View groups...
Share
Share this post:

"Encountered a gradient that is effectively zero..." message with FindFit

Posted 10 months ago

Have a good day. What I want to do is to find the parameters to fit the following data set (Nilson123) to the y function. But I get the message "Encountered a gradient that is effectively zero.The result returned may not be a minimum; it may be a maximum or a saddle point" when I run the FindFit function. I am in need of your help for the solution of this problem.

Thanks so much!
Osman

POSTED BY: Osman Ala
8 Replies
Posted 10 months ago

OK. I see you've added those values.

POSTED BY: Jim Baldwin
Posted 10 months ago

From the "code" you gave, I don't see what those values are. Without providing code in an easily copyable form, I don't see the any of us can give you much help.

POSTED BY: Jim Baldwin
Posted 10 months ago
k=7.6675*10^14,   
η =6.34963*10^-12,   
α0 = 0,   
α1=1.26993*10^-11,   
α2=1.90489*10^-11,   
α3 =2.3282*10^-11,   
α4=2.64568*10^-11,   
P0 = 1.0,   
P2 =1/2 (-1 + 3 Cos[θ^2),   
P4 = 1/8 (3 - 30 Cos[θ]^2 + 35 Cos[θ]^4),   
Exp1= Exp[ i * η * Log[(Csc[θ]/2])^2] ],   
Exp2 = Exp[ i * η * Log[(Csc[[Pi]/2 - θ/2])^2] ]
POSTED BY: Osman Ala
Posted 10 months ago

η and k are constants; Exp1, Exp2, α0, α2, P0 are functions of θ and θ is the variable.They are all declared before FindFit. I think there is no problem with them because when I replaced in the constants 0.61, 1.99 and 0.026 with δ0, δ2 and δ4 respectively in y function and run the Plot[y, {θ,0.3,1.8}] it works.

POSTED BY: Osman Ala
Posted 10 months ago

I have noticed that I have forgotten the unit conversion. So I have put a 10^28 coefficient in front of y then the script works and the parameter output is {δ0->1.23497, δ2->0.381176, δ4->0.569623}. But this time another error appears : "The step size in the search has become less than the tolerance prescribed by the PrecisionGoal option, but the gradient il larger than the tolerance specified by the AccuracyGoal option. There is a possibility that the method has stalled at a point that isn not a local minimum."

POSTED BY: Osman Ala
Posted 10 months ago

What are the values of the constants $\eta$, $\theta$, $k$, Exp1, Exp2, $\alpha_0$, $\alpha_2$, $P_0$, and $\alpha_0$?

POSTED BY: Jim Baldwin
Posted 10 months ago

Thank you Gianluca. It seems you are right. I will try one more free parameter as a coefficient in front of the function. I hope it will work.

POSTED BY: Osman Ala

From a cursory look at your model y, it seems that it only takes extremely small numerical values, and its gradient is also very small. It has no chance to decently fit your data.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract