Replies: 3 comments 2 replies
-
@jprince58 Um:
Imagine how we feel. Some random person on the internet literally said "I did a calculation and it is different from what I expected". Good grief.
Well, yeah. If you don't tell us what you did, we do not what you did. |
Beta Was this translation helpful? Give feedback.
-
Fair. I'm not an expert on these kinds of forums, so I wasn't sure how to start the thread. This repo has all the associated files. https://github.com/jprince58/Bioaccumulation_Nanoparticles/tree/Quantitative_fit/N12 I wish I could just tell you, "run this code and you'll replicate the issue", but the scripts are set-up to run on only my machine, so you would need to change the directories referenced. The first thing that needs to be changed are lines 19 and 20 of "N12-Fit_Code", and should reference any directory one wants on the machine running the script, as long as it can hold files. The "direct_export_path" variable is where a document summarizing the most recent code execution lives. Additionally, lines 56 and 126 of the same script would need to be changed to reference the attached .csv file. Additonally, whatever directory the script is going to be run in will need a plain .txt file added named "counter_file_1", with a single number entry. This corresponds with lines 48-53 of "N12-Fit_Code". I'll just focus on the part of the code with the issue. It's the "N12-Fit_Code" script in the directory referenced. Lines 94-100 look as such: Starting at line 94
I suspect that the RSS which is calculated in line 95 of "N12-Fit_Code" is off because in the file "N12_exp_data_fitter", the RSS was calculated independently in line 94 (calculated with the same values as those passed along in "residual_calc" used in the minimize function) This can be seen most easily if N12-Fit_Code is ran with the following parameter set:
If you run the code with this parameter set, and you find the exported .docx file in the directory named in line 20, you should hopefully see something like this. The RSS typed out in the doc is that calculated using lmfit. The one in the figure itself is the one calculated in "N12_exp_data_fitter" line 94. Obviously they are different. Attached is the curve (more like set of curves) trying to be fit. tseng_fits_Fig2B_Cy5cipro_incubation_bump.csv I understand this probably isn't enough information. Please let me know any other information needed. |
Beta Was this translation helpful? Give feedback.
-
If you cannot make a minimal working example, we cannot help you. See https://stackoverflow.com/help/minimal-reproducible-example. |
Beta Was this translation helpful? Give feedback.
-
I'm using lmfit to do a curve-fitting to a PDE solved using a finite-difference method.
When i take the result from my fitting using result=lmfit.minimize(), the chi-squared value (pulled from result.chisqr), is different than what I am calculating if I do the chi-squared calculation myself.
Not sure what is going on. Can link the github repo containing the scripts as necessary.
Beta Was this translation helpful? Give feedback.
All reactions