]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Fix some coherency choices for *KF algorithms
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 27 Dec 2020 06:46:24 +0000 (07:46 +0100)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sun, 27 Dec 2020 06:47:03 +0000 (07:47 +0100)
src/daComposant/daAlgorithms/ExtendedKalmanFilter.py
src/daComposant/daAlgorithms/KalmanFilter.py
src/daComposant/daAlgorithms/UnscentedKalmanFilter.py

index b243668be28a119a5aaf8dee0c0e545b10a902d1..ee838c8c0075e0fc2afbee882df789fc743fd7e7 100644 (file)
@@ -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"):
index eadb0689450f03d41e2c45a047724287b62ef5cb..257cd26395f20d833d469afe34c3486ef14ab8cc 100644 (file)
@@ -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"):
index 5af253c871afaf642be6bc23b1bfe24e39fb70b8..4fa7d04476dec4fb0933c8942e78829d5ffab040 100644 (file)
@@ -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"):