From a4659b9fa68127689b2bac52f82d373efee5e0f2 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Fri, 23 Aug 2024 16:38:07 +0100 Subject: [PATCH] Do linear extrapolation in PsiContour.contourSfunc() This allows the 'orthogonal' Sfunc to do something sensible at the targets when it is being used there because only the X-point is 'nonorthogonal'. --- hypnotoad/core/equilibrium.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hypnotoad/core/equilibrium.py b/hypnotoad/core/equilibrium.py index f69fb0f0..6701549a 100644 --- a/hypnotoad/core/equilibrium.py +++ b/hypnotoad/core/equilibrium.py @@ -1697,8 +1697,11 @@ def contourSfunc(self, *, psi, kind="cubic"): i, [i <= 0.0, i >= thisEndInd - thisStartInd], [ - 0.0, - endDistance - startDistance, + lambda i: i * (distance[thisStartInd + 1] - distance[thisStartInd]), + lambda i: endDistance + - startDistance + + (i - thisEndInd + thisStartInd) + * (distance[thisEndInd] - distance[thisEndInd - 1]), lambda i: interpS(i + thisStartInd) - startDistance, ], )