]> SALOME platform Git repositories - modules/adao.git/commitdiff
Salome HOME
Improving notations
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Wed, 25 Sep 2013 15:57:45 +0000 (17:57 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Wed, 25 Sep 2013 15:57:45 +0000 (17:57 +0200)
src/daComposant/daAlgorithms/ExtendedKalmanFilter.py
src/daComposant/daAlgorithms/KalmanFilter.py
src/daComposant/daCore/BasicObjects.py

index 7c72996aea44f92dc3bdc001cab962f08fe8b4d6..4b4bc1d14ea84c7efffbe57c33e86614d98a7d50 100644 (file)
@@ -164,9 +164,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
                     d = d - Cm * Un
             #
-            K  = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
-            Xn = Xn_predicted + K * d
-            Pn = Pn_predicted - K * Ht * Pn_predicted
+            Kn = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
+            Xn = Xn_predicted + Kn * d
+            Pn = Pn_predicted - Kn * Ht * Pn_predicted
             #
             self.StoredVariables["Analysis"].store( Xn.A1 )
             if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
index c3f7bfebc45ed44054001f911242f552160d2ded..dc8fe79e1153658509487dd4b6838688e055b148 100644 (file)
@@ -139,9 +139,9 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
                     d = d - Cm * Un
             #
-            K  = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
-            Xn = Xn_predicted + K * d
-            Pn = Pn_predicted - K * Ht * Pn_predicted
+            Kn = Pn_predicted * Ha * (R + Ht * Pn_predicted * Ha).I
+            Xn = Xn_predicted + Kn * d
+            Pn = Pn_predicted - Kn * Ht * Pn_predicted
             #
             self.StoredVariables["Analysis"].store( Xn.A1 )
             if "APosterioriCovariance" in self._parameters["StoreSupplementaryCalculations"]:
index 7a58d2332a2a9d3d77f3a672205728c833977d9a..e774e4f5a2cdfb4e251c55ed0c4db0cd0f45bd3a 100644 (file)
@@ -446,6 +446,17 @@ class Covariance:
             else:
                 return self.__B * numpy.ones(int(msize))
     
+    def asfullmatrix(self, msize=None):
+        if   self.ismatrix():
+            return self.__B
+        elif self.isvector():
+            return numpy.matrix( numpy.diag(self.__B), float )
+        elif self.isscalar():
+            if msize is None:
+                raise ValueError("the size of the %s covariance matrix has to be given in case of definition as a scalar over the diagonal."%(self.__name,))
+            else:
+                return numpy.matrix( self.__B * numpy.eye(int(msize)), float )
+    
     def trace(self, msize=None):
         if   self.ismatrix():
             return numpy.trace(self.__B)