fixed discrepancy with Baker's eq 17.

This commit is contained in:
Stephen Mardson McQuay 2010-04-09 15:03:16 -06:00
parent 3efe335563
commit 79880acad4

View File

@ -149,12 +149,12 @@ def get_error_cubic(phi, R, S):
# basing this on eq 17
B.append(
[
phi1 * phi2, # a
phi1 * phi3, # b
phi2 * phi1, # c
phi2 * phi3, # d
phi3 * phi1, # e
phi3 * phi2, # f
phi1 * phi2 * phi2, # a
phi1 * phi3 * phi3, # b
phi2 * phi1 * phi1, # c
phi2 * phi3 * phi3, # d
phi3 * phi1 * phi1, # e
phi3 * phi2 * phi2, # f
phi1 * phi2 * phi3, # g
]
)
@ -173,12 +173,12 @@ def get_error_cubic(phi, R, S):
print >> sys.stderr, "warning: run_baker: linear calculation went bad, resorting to np.linalg.pinv", e
(a, b, c, d, e, f, g) = np.dot(np.linalg.pinv(A), b)
error_term = a * phi[0] * phi[1]\
+ b * phi[0] * phi[2]\
+ c * phi[1] * phi[0]\
+ d * phi[1] * phi[2]\
+ e * phi[2] * phi[0]\
+ f * phi[2] * phi[1]\
error_term = a * phi[0] * phi[1] * phi[1]\
+ b * phi[0] * phi[2] * phi[2]\
+ c * phi[1] * phi[0] * phi[0]\
+ d * phi[1] * phi[2] * phi[2]\
+ e * phi[2] * phi[0] * phi[0]\
+ f * phi[2] * phi[1] * phi[1]\
+ g * phi[0] * phi[1] * phi[2]\
return error_term, a, b, c