From a0e51689f8c1c889f6f7e4647ac1e2e54f5b4b5a Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Sun, 31 Jan 2021 17:19:02 +0100 Subject: [PATCH] Improvement of EnKF algorithm internals --- src/daComposant/daAlgorithms/EnsembleKalmanFilter.py | 6 ++++++ src/daComposant/daCore/NumericObjects.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py b/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py index 9716d2c..a7e178e 100644 --- a/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py +++ b/src/daComposant/daAlgorithms/EnsembleKalmanFilter.py @@ -50,6 +50,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): "MLEF-T", "MLEF-B", "IEnKF-T", + "IEnKF-B", + "IEKF", ], ) self.defineRequiredParameter( @@ -204,6 +206,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): elif self._parameters["Minimizer"] in ["IEnKF-T", "IEnKF"]: NumericObjects.ienkf(self, Xb, Y, U, HO, EM, CM, R, B, Q, BnotT=False) # + elif self._parameters["Minimizer"] in ["IEnKF-B", "IEKF"]: + NumericObjects.ienkf(self, Xb, Y, U, HO, EM, CM, R, B, Q, BnotT=True) + # + #-------------------------- else: raise ValueError("Error in Minimizer name: %s"%self._parameters["Minimizer"]) # diff --git a/src/daComposant/daCore/NumericObjects.py b/src/daComposant/daCore/NumericObjects.py index 095a51c..1e97bf6 100644 --- a/src/daComposant/daCore/NumericObjects.py +++ b/src/daComposant/daCore/NumericObjects.py @@ -1594,6 +1594,10 @@ def ienkf(selfA, Xb, Y, U, HO, EM, CM, R, B, Q, VariantM="IEnKF12", # A2 = EnsembleCenteredAnomalies( E2 ) # + if BnotT: + Ta = numpy.real(scipy.linalg.sqrtm(numpy.linalg.inv( mH ))) + A2 = numpy.sqrt(__m-1) * A2 @ Ta / _epsilon + # Xn = vx2 + A2 #-------------------------- else: -- 2.39.2