Go to the source code of this file.
Functions | |
TEST (EquilibriumConstantInterpolatorTest, constructor_except) | |
exception tests for constructor More... | |
TEST (EquilibriumConstantInterpolatorTest, constructor) | |
TEST (EquilibriumConstantInterpolatorTest, linear) | |
TEST (EquilibriumConstantInterpolatorTest, fourthOrder) | |
TEST (EquilibriumConstantInterpolatorTest, maierKelly) | |
TEST (EquilibriumConstantInterpolatorTest, linearNullValues) | |
TEST (EquilibriumConstantInterpolatorTest, fourthOrderNullValues) | |
TEST (EquilibriumConstantInterpolatorTest, fourthOrderUserDefinedNullValues) | |
TEST (EquilibriumConstantInterpolatorTest, piecewiselinear) | |
Piecewise-linear. More... | |
TEST (EquilibriumConstantInterpolatorTest, piecewiselinear_oneval) | |
Piecewise-linear with just one value. More... | |
TEST (EquilibriumConstantInterpolatorTest, piecewiselinear_500) | |
Piecewise-linear with 500 values. More... | |
TEST (EquilibriumConstantInterpolatorTest, piecewiselinear_except) | |
Piecewise-linear exception due to badly ordered T values. More... | |
Variables | |
const double | tol = 1.0e-6 |
TEST | ( | EquilibriumConstantInterpolatorTest | , |
constructor_except | |||
) |
exception tests for constructor
Definition at line 17 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
constructor | |||
) |
Definition at line 65 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
linear | |||
) |
Definition at line 86 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
fourthOrder | |||
) |
Compare with values calculated using scipy.optimize.curve_fit
from scipy.optimize import curve_fit
def logk(T, a0, a1, a2, a3, a4): return a0 + a1 * T + a2 * T**2 + a3 * T**3 + a4 * T**4
T = [0.0, 25.0, 60.0, 100.0, 150.0, 200.0, 250.0, 300.0] k = [-6.5570, -6.3660, -6.3325, -6.4330, -6.7420, -7.1880, -7.7630, -8.4650]
popt, pcov = curve_fit(logk, T, k)
print(logk(T[1], *popt)) print(logk(T[2], *popt)) print(logk(T[3], *popt)) print(logk(T[4], *popt)) print(logk(T[5], *popt)) print(logk(125, *popt))
Definition at line 130 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
maierKelly | |||
) |
Compare with values calculated using scipy.optimize.curve_fit
from scipy.optimize import curve_fit import numpy as np
def logk(T, a0, a1, a2, a3, a4): return a0 * np.log(T) + a1 + a2 * T + a3 / T + a4 / T**2
T = [0.01, 25.0, 60.0, 100.0, 150.0, 200.0, 250.0, 300.0] k = [0.2081, 0.0579, -0.2746, -0.7311, -1.3659, -2.0618, -2.8403, -3.7681]
popt, pcov = curve_fit(logk, T, k)
print(logk(T[1], *popt)) print(logk(T[2], *popt)) print(logk(T[3], *popt)) print(logk(T[4], *popt)) print(logk(T[5], *popt))
Definition at line 172 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
linearNullValues | |||
) |
Definition at line 214 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
fourthOrderNullValues | |||
) |
Definition at line 233 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
fourthOrderUserDefinedNullValues | |||
) |
Definition at line 260 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
piecewiselinear | |||
) |
Piecewise-linear.
Definition at line 288 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
piecewiselinear_oneval | |||
) |
Piecewise-linear with just one value.
Definition at line 327 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
piecewiselinear_500 | |||
) |
Piecewise-linear with 500 values.
Definition at line 343 of file EquilibriumConstantInterpolatorTest.C.
TEST | ( | EquilibriumConstantInterpolatorTest | , |
piecewiselinear_except | |||
) |
Piecewise-linear exception due to badly ordered T values.
Definition at line 368 of file EquilibriumConstantInterpolatorTest.C.
const double tol = 1.0e-6 |
Definition at line 14 of file EquilibriumConstantInterpolatorTest.C.
Referenced by TEST().