ReactionMechanismGenerator / RMG-Java

The Java version of RMG: Reaction Mechanism Generator
http://rmg.sourceforge.net/
MIT License
29 stars 36 forks source link

Fame gives NaN in Chebyshev fits #73

Closed rwest closed 14 years ago

rwest commented 14 years ago

This seems to occur at high temperatures.

End of the RMG log file:

PDepNetwork #4 (C6H13O6J): 1891 included and 488 nonincluded net reactions. SPC(84)(+m)=SPC(83)(+m) 1.0E0 0.0 0.0 !NetReaction from PDepNetwork #4 (C6H13O6J) High-P Limit Reverse: intra_H_migration estimate: (Average:)Others-R2H_S O_rad_out Cs_H_out_H/(NonDeC/Cs)
TCHEB / 500.0 5000.0 / PCHEB / 0.9869232667160128 246.7308166790032 / CHEB / 4 4 / CHEB / NaN NaN NaN NaN / CHEB / NaN NaN NaN NaN / CHEB / NaN NaN NaN NaN / CHEB / NaN NaN NaN NaN /

Has bad rate probably due to Ea<DH Exception in thread "main" jing.rxn.NegativeRateException: water(3)(+m)=OH(6)+H(4)(+m) 1.0E0 0.0 0.0 !NetReaction from PDepNetwork #1 (water) High-P Limit Reverse: ReactionLibrary: Glarborg_C3 TCHEB / 500.0 5000.0 / PCHEB / 0.9869232667160128 246.7308166790032 / CHEB / 4 4 / CHEB / NaN NaN NaN NaN / CHEB / NaN NaN NaN NaN / CHEB / NaN NaN NaN NaN / CHEB / NaN NaN NaN NaN /

: NaN at jing.rxnSys.JDAS.getEdgeReactionString(JDAS.java:770) at jing.rxnSys.JDAS.getAutoEdgeReactionInfo(JDAS.java:840) at jing.rxnSys.JDASSL.solve(JDASSL.java:200) at jing.rxnSys.ReactionSystem.solveReactionSystem(ReactionSystem.java:1500) at jing.rxnSys.ReactionModelGenerator.modelGeneration(ReactionModelGenerator.java:1360) at RMG.main(RMG.java:57)

End of the fame.log file:

Applying method at 2523.0119773437686 K, 1.2338607727484543 bar... Warning: Invalid collision efficiency +Inf calculated at 2523.0119773437686 K. Applying method at 2523.0119773437686 K, 5.497231770466294 bar... Warning: Invalid collision efficiency +Inf calculated at 2523.0119773437686 K. Applying method at 2523.0119773437686 K, 45.47743490516757 bar... Warning: Invalid collision efficiency +Inf calculated at 2523.0119773437686 K. Applying method at 2523.0119773437686 K, 202.61605322221158 bar... Warning: Invalid collision efficiency +Inf calculated at 2523.0119773437686 K. Applying method at 4493.071882363963 K, 1.2338607727484543 bar... Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Applying method at 4493.071882363963 K, 5.497231770466294 bar... Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Applying method at 4493.071882363963 K, 45.47743490516757 bar... Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Applying method at 4493.071882363963 K, 202.61605322221158 bar... Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Warning: Invalid collision efficiency +Inf calculated at 4493.071882363963 K. Fitting Chebyshev interpolation model... Writing results...

rwest commented 14 years ago

RMG-Java doesn't pass to Fame the endpoints of the Chebyshev fit, just the grid points (which don't go all the way to the end). Fame thus doesn't know how to scale T and P and does so incorrectly using the max and min grid points. This leads to a reduced P or T that is 1.000 (instead of 0.8 or something). Numerical errors can cause this to be something like 1.00000000000004 which then leads to a NaN in the fit calculation.

jwallen commented 14 years ago

PDep: Fixed bug in Chebyshev polynomial fitting in FAME.

FAME was not using the correct minimum and maximum values in the range, as the Gauss-Chebyshev grid points are placed such that the endpoints of Tlist and Plist are not the same as the valid range (Tmin, Tmax) and (Pmin, Pmax). In order to do this correctly, I modified RMG to pass the correct minimum and maximum temperatures and pressures to FAME, and modified FAME to use these for the Chebyshev polynomial fitting.

This was noticed due to a roundoff error observed when FAME tried to use the minimum and maximum temperatures/pressures from the grid as the Chebyshev endpoints, due to chebyshev polynomials being stricly undefined outside of the range [-1, 1]. This commit avoids this issue because the grid endpoints are sufficiently far from +1 and -1 so that roundoff can't hurt anything.

Closed by e12a32f8a1c590973f4350e1d827c35fee5f40d4.

rwest commented 14 years ago

Excellent. Thanks Josh. Rebase to 3.2.x?