Timeline for ParametricNDSolveValue::nlnum error in conjuction with NonlinearModelFit
Current License: CC BY-SA 4.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 13, 2018 at 16:14 | comment | added | Kaquel | I have found a few things that help. I found this thread - in particular the answer at the very bottom from Wolfram: mathematica.stackexchange.com/questions/32455/… Comparing their solution to mine, I noticed they gave Mathematica some conditions in the FindFit function. In particular, tau_r>0 seems to help a lot. I am now able to give a starting value of tau_r=15000, and get a fit value of 16999.9. (The "true" value is 17500.) | |
Jun 13, 2018 at 16:03 | comment | added | Kaquel | @JimB thanks for the suggestion. I have since tried adding various measurement errors between 1-10% and find similar results. | |
Jun 4, 2018 at 20:48 | comment | added | JimB |
@Kaquel The sszero as you've probably guessed is about the sum of squares being essentially zero. It doesn't look like your "data" has any measurement error but only a bit of round-off error. I have to believe that any "real" data won't have this minimal amount of error. Might you consider adding a bit more random error in the simulated data?
|
|
Jun 4, 2018 at 15:28 | comment | added | Kaquel | Thanks for the response! It seems we are definitely getting closer. I fixed the error in the original post, but to fix your code just change any remaining "Ib" to "Ibn" or set "Ib=12.5". I am actually able to get quite a good looking fit by fixing this mistake and giving the fit a starting point for tau_r: {tau_r, 17500}. (Note this is the actual tau_r I used when making the test data.) However, weirdly Mathematica throws a FindFit::sszero error. edit: nevermind, the fitting algorithm is just giving up and setting tau_r to whatever I choose originally, not actually fitting. Hence error. | |
Jun 4, 2018 at 14:27 | history | answered | Michael Seifert | CC BY-SA 4.0 |