Skip to content
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

Merged
merged 3 commits into from Jun 23, 2017
Merged

Changed Fourier Fitting in Cantherm #1006

merged 3 commits into from Jun 23, 2017

Conversation

laitcl
Copy link

@laitcl laitcl commented Apr 25, 2017

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.

@mention-bot
Copy link

@laitcl, thanks for your PR! By analyzing the history of the files in this pull request, we identified @jwallen and @nyee to be potential reviewers.

x *= 0.001

self.fourier = ([x[1:6], x[7:12]], "kJ/mol")
while NegativeBarrier and numterms<18:
Copy link
Contributor

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
Copy link
Contributor

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.

laitcl and others added 2 commits June 23, 2017 13:06
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.
@nyee nyee merged commit 8a9e658 into master Jun 23, 2017
@mliu49 mliu49 deleted the torsion_Lai branch June 23, 2017 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants