From: Jean-Philippe ARGAUD Date: Sun, 27 Dec 2020 06:46:24 +0000 (+0100) Subject: Fix some coherency choices for *KF algorithms X-Git-Tag: V9_7_0b1~57 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=967ce0a170eafb3c7ac3f734179099117a1eb2f1;p=modules%2Fadao.git Fix some coherency choices for *KF algorithms --- diff --git a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py index b243668..ee838c8 100644 --- a/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/ExtendedKalmanFilter.py @@ -140,10 +140,12 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( Pn.asfullmatrix(Xn.size) ) covarianceXa = Pn + if self._parameters["EstimationOf"] == "Parameters": + covarianceXaMin = Pn # - Xa = Xn - XaMin = Xn - previousJMinimum = numpy.finfo(float).max + if self._parameters["EstimationOf"] == "Parameters": + XaMin = Xn + previousJMinimum = numpy.finfo(float).max # for step in range(duration-1): if hasattr(Y,"store"): diff --git a/src/daComposant/daAlgorithms/KalmanFilter.py b/src/daComposant/daAlgorithms/KalmanFilter.py index eadb068..257cd26 100644 --- a/src/daComposant/daAlgorithms/KalmanFilter.py +++ b/src/daComposant/daAlgorithms/KalmanFilter.py @@ -131,9 +131,12 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( Pn.asfullmatrix(Xn.size) ) covarianceXa = Pn + if self._parameters["EstimationOf"] == "Parameters": + covarianceXaMin = Pn # - Xa = Xn - previousJMinimum = numpy.finfo(float).max + if self._parameters["EstimationOf"] == "Parameters": + XaMin = Xn + previousJMinimum = numpy.finfo(float).max # for step in range(duration-1): if hasattr(Y,"store"): diff --git a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py index 5af253c..4fa7d04 100644 --- a/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py +++ b/src/daComposant/daAlgorithms/UnscentedKalmanFilter.py @@ -102,7 +102,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): message = "Liste des valeurs de bornes", ) self.requireInputArguments( - mandatory= ("Xb", "Y", "HO", "R", "B" ), + mandatory= ("Xb", "Y", "HO", "R", "B"), optional = ("U", "EM", "CM", "Q"), ) self.setAttributes(tags=( @@ -178,14 +178,17 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): else: Pn = B # if len(self.StoredVariables["Analysis"])==0 or not self._parameters["nextStep"]: - self.StoredVariables["Analysis"].store( numpy.ravel(Xb) ) + self.StoredVariables["CurrentIterationNumber"].store( len(self.StoredVariables["Analysis"]) ) + self.StoredVariables["Analysis"].store( numpy.ravel(Xn) ) if self._toStore("APosterioriCovariance"): self.StoredVariables["APosterioriCovariance"].store( Pn ) covarianceXa = Pn + if self._parameters["EstimationOf"] == "Parameters": + covarianceXaMin = Pn # - Xa = Xb - XaMin = Xb - previousJMinimum = numpy.finfo(float).max + if self._parameters["EstimationOf"] == "Parameters": + XaMin = Xn + previousJMinimum = numpy.finfo(float).max # for step in range(duration-1): if hasattr(Y,"store"):