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

ZeroDivisionError in Arrhenius.changeT0 called from Reaction.generateReverseRateCoefficient #34

Closed
rwest opened this issue Jun 8, 2011 · 2 comments

Comments

@rwest
Copy link
Member

rwest commented Jun 8, 2011

When I add pressure dependence to my (otherwise functioning) methylformate test case, it dies with the following:

========================================================================
Network Information
-------------------
Isomers:
    methylformate(1)                                     -368.115 kJ/mol
Reactant channels:
Product channels:
    CO(3) + CH4O(4)                                      -330.855 kJ/mol
    CHO2(5) + CH3(6)                                     -34.8517 kJ/mol
    C2H3O2(7) + H(8)                                       46.279 kJ/mol
    CHO(9) + CH3O(10)                                     41.2276 kJ/mol
    H(8) + C2H3O2(11)                                     42.8663 kJ/mol
    CO2(12) + CH4(13)                                    -487.574 kJ/mol
    C2H4O2(14)                                            27.7775 kJ/mol
Path reactions:
    CO(3) + CH4O(4) <=> methylformate(1)                 -107.597 kJ/mol
    CHO2(5) + CH3(6) <=> methylformate(1)                -34.4148 kJ/mol
    C2H3O2(7) + H(8) <=> methylformate(1)                 45.9413 kJ/mol
    CHO(9) + CH3O(10) <=> methylformate(1)                 39.762 kJ/mol
    H(8) + C2H3O2(11) <=> methylformate(1)                42.5453 kJ/mol
    CO2(12) + CH4(13) <=> methylformate(1)                -156.38 kJ/mol
    C2H4O2(14) <=> methylformate(1)                       95.9767 kJ/mol
========================================================================

Using 200 grains from -368.12 to 283.99 kJ/mol in steps of 3.28 kJ/mol
Calculating densities of states for Network #1...
Calculating phenomenological rate coefficients for Network #1...
Traceback (most recent call last):
  File "rmg.py", line 673, in <module>
    execute(args)
  File "rmg.py", line 275, in execute
    reactionModel.enlarge(spec, database)
  File "/Users/rwest/XCodeProjects/RMGpy/RMG-Py/rmgpy/rmg/model.py", line 929, in enlarge
    self.updateUnimolecularReactionNetworks(database)
  File "/Users/rwest/XCodeProjects/RMGpy/RMG-Py/rmgpy/rmg/model.py", line 1390, in updateUnimolecularReactionNetworks
    network.update(self, database)
  File "/Users/rwest/XCodeProjects/RMGpy/RMG-Py/rmgpy/rmg/model.py", line 497, in update
    K, p0 = self.calculateRateCoefficients(Tlist, Plist, Elist, method)
  File "/Users/rwest/XCodeProjects/RMGpy/RMG-Py/rmgpy/measure/network.py", line 465, in calculateRateCoefficients
    Kij, Gnj, Fim = self.calculateMicrocanonicalRates(Elist, densStates0, T)
  File "/Users/rwest/XCodeProjects/RMGpy/RMG-Py/rmgpy/measure/network.py", line 361, in calculateMicrocanonicalRates
    dummy, Gnj[reac,prod,:] = calculateMicrocanonicalRateCoefficient(rxn, Elist, None, densStates[prod,:], T)
  File "reaction.pyx", line 143, in rmgpy.measure.reaction.calculateMicrocanonicalRateCoefficient (build/pyrex/rmgpy/measure/reaction.c:2148)
  File "reaction.py", line 322, in rmgpy.reaction.Reaction.generateReverseRateCoefficient (build/pyrex/rmgpy/reaction.c:6740)
  File "reaction.py", line 349, in rmgpy.reaction.Reaction.generateReverseRateCoefficient (build/pyrex/rmgpy/reaction.c:6684)
  File "kinetics.py", line 320, in rmgpy.kinetics.Arrhenius.changeT0 (build/pyrex/rmgpy/kinetics.c:5276)
ZeroDivisionError: float division

The latter part of this stack trace is recreated by one of the unit tests:

======================================================================
ERROR: testGenerateReverseRateCoefficient (reactionTest.TestReaction)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/rwest/XCodeProjects/RMGpy/RMG-Py/unittest/reactionTest.py", line 236, in testGenerateReverseRateCoefficient
    reverseKinetics = self.reaction2.generateReverseRateCoefficient(Tlist)
  File "reaction.py", line 322, in rmgpy.reaction.Reaction.generateReverseRateCoefficient (build/pyrex/rmgpy/reaction.c:6740)
  File "reaction.py", line 349, in rmgpy.reaction.Reaction.generateReverseRateCoefficient (build/pyrex/rmgpy/reaction.c:6684)
  File "kinetics.py", line 320, in rmgpy.kinetics.Arrhenius.changeT0 (build/pyrex/rmgpy/kinetics.c:5276)
ZeroDivisionError: float division
@jwallen
Copy link
Contributor

jwallen commented Jun 10, 2011

Hm. I have not been able to reproduce this locally using the unit test. Interestingly, we inadvertently reproduced it on Connie's computer after she pulled in some changes. All we had to do to fix it was recompile everything (i.e. make clean; make). I'm not exactly sure why this fixes a supposed ZeroDivisionError.

@rwest
Copy link
Member Author

rwest commented Jun 11, 2011

OK, working for me too now (after a make clean; make). Sorry I didn't try that earlier. (although I had tried a make - I assumed it would clean what it needed).

@rwest rwest closed this as completed Jun 11, 2011
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

No branches or pull requests

2 participants