修改体积导数计算逻辑,补充完善index.md

This commit is contained in:
lujingze committed 2026-06-09 09:22:39 +00:00
1 parent 1cf8427b52
commit 3994835c65
8 files changed
+557 -232

No files matched your search

+16
View File
@@ -6,6 +6,7 @@ sys.path.insert(0, "src")
from cryo_tank.properties import (
ln2_rho, ln2_h, ln2_u, ln2_T_from_u,
ln2_drho_dT_const_p, ln2_du_dT_const_p,
he_u, he_h, he_cp, he_cv,
)
from cryo_tank.config import P_WORKING
@@ -32,6 +33,21 @@ class TestLN2Properties:
T_recovered = ln2_T_from_u(u, P_WORKING)
assert abs(T_recovered - T_orig) < 0.01
def test_ln2_density_derivative_matches_finite_difference(self):
T = 78.0
step = 1e-3
actual = ln2_drho_dT_const_p(T, P_WORKING)
expected = (
ln2_rho(T + step, P_WORKING)
- ln2_rho(T - step, P_WORKING)
) / (2.0 * step)
assert actual < 0.0
assert abs(actual - expected) / abs(expected) < 1e-5
def test_ln2_internal_energy_derivative_is_positive(self):
du_dT = ln2_du_dT_const_p(78.0, P_WORKING)
assert du_dT > 0.0
class TestHeliumProperties:
"""Helium properties."""