def test_ideal_mix(): kT = 1.0 xHS = np.array([.5,.5]) Fmix, Smix = hsmix.ideal_mix( kT, xHS ) assert Smix == np.log(2), 'Smix of 50/50 mix should equal log(2)' Fmix, Smix = hsmix.ideal_mix( kT, np.array([0.0,1.0]) ) assert Smix==0, 'Purely 1 component yields Smix=0'
def eval_ideal_mix_energy(self, T, X_a): kT = KT300 * T / 300.0 Fmix = hsmix.ideal_mix(kT, X_a) return Fmix