From a5f806aa3113b123e2cdfc26880f9cc1adb52dfc Mon Sep 17 00:00:00 2001 From: Nicolas Kruse Date: Mon, 23 Jun 2025 11:12:50 +0200 Subject: [PATCH] For equilibrium_eq start values are estimated now by calculating the maximum possible amount for each species based on the elements --- src/gaspype/_solver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gaspype/_solver.py b/src/gaspype/_solver.py index a6040b4..6f858fa 100644 --- a/src/gaspype/_solver.py +++ b/src/gaspype/_solver.py @@ -80,7 +80,8 @@ def equilibrium_eq(fs: fluid_system, element_composition: FloatArray, t: float, # Pressure corrected log equilibrium constants bp = b - np.sum(a * np.log(p / p0), axis=1) - logn_start = np.ones(el_matrix.shape[1]) * 0.1 + # Calculating the maximum possible amount for each species based on the elements + logn_start = np.min(element_norm / (fs.array_species_elements + epsy), axis=1) def residuals(logn: FloatArray): # type: ignore n = np.exp(logn)