-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed Fourier Fitting in Cantherm #1006
Conversation
rmgpy/statmech/torsion.pyx
Outdated
x *= 0.001 | ||
|
||
self.fourier = ([x[1:6], x[7:12]], "kJ/mol") | ||
while NegativeBarrier and numterms<18: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you chose 18? I'm not exactly sure what value should be used, but 18 seems a bit high to me.
for k in range(fourier.shape[1]): | ||
V0 -= fourier[0,k] * (k+1) * (k+1) | ||
if V0 < 0: | ||
NegativeBarrier=True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should have a warning here that tells the user that it got a NegativeBarrier from a fit of n terms and that it is going to try a fit of m terms
and additionally a warning if numterms reaches the maximum value to tell the user that attempts to avoid having a NegativeBarrier have failed and that an nmax term fourier series is being used.
Modified funtion in torsion.pyx, Function name FitFourierPotentialToData; new function now begins with twelve fourier parameters, and adds two fitting parameters every single time a negative barrier height is found to avoid errors.
Previously it was set at a flat 18, but now it determines the number of points in the data, and uses 2/3 the number of terms.
Modified funtion in torsion.pyx, Function name
FitFourierPotentialToData; new function now begins with twelve fourier
parameters, and adds two fitting parameters every single time a negative barrier
height is found to avoid errors.