# Utilisation éventuelle d'un vecteur H(Xb) précalculé
# ----------------------------------------------------
if HO["AppliedInX"] is not None and "HXb" in HO["AppliedInX"]:
- HXb = Hm( Xb, HO["AppliedInX"]["HXb"])
+ HXb = Hm( Xb, HO["AppliedInX"]["HXb"] )
else:
HXb = Hm( Xb )
HXb = numpy.asmatrix(numpy.ravel( HXb )).T
_HX = numpy.asmatrix(numpy.ravel( _HX )).T
_Innovation = Y - _HX
if self._toStore("SimulatedObservationAtCurrentState") or \
- self._toStore("SimulatedObservationAtCurrentOptimum"):
+ self._toStore("SimulatedObservationAtCurrentOptimum"):
self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
if self._toStore("InnovationAtCurrentState"):
self.StoredVariables["InnovationAtCurrentState"].store( _Innovation )
elif self._toStore("SimulatedObservationAtCurrentOptimum"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
else:
- HXa = Hm(Xa)
+ HXa = Hm( Xa )
#
# Calcul de la covariance d'analyse
# ---------------------------------
HXa = Hm * Xa
oma = Y - HXa
if self._parameters["StoreInternalVariables"] or \
- self._toStore("CostFunctionJ") or \
- self._toStore("MahalanobisConsistency"):
+ self._toStore("CostFunctionJ") or \
+ self._toStore("MahalanobisConsistency"):
Jb = float( 0.5 * (Xa - Xb).T * BI * (Xa - Xb) )
Jo = float( 0.5 * oma.T * RI * oma )
J = Jb + Jo
#
# Opérateurs
# ----------
- H = HO["Direct"].appliedControledFormTo
+ Hm = HO["Direct"].appliedControledFormTo
#
if self._parameters["EstimationOf"] == "State":
- M = EM["Direct"].appliedControledFormTo
+ Mm = EM["Direct"].appliedControledFormTo
#
if CM is not None and "Tangent" in CM and U is not None:
Cm = CM["Tangent"].asMatrix(Xb)
Un = None
#
if self._parameters["EstimationOf"] == "State":
- Xn_predicted = numpy.asmatrix(numpy.ravel( M( (Xn, Un) ) )).T
+ Xn_predicted = numpy.asmatrix(numpy.ravel( Mm( (Xn, Un) ) )).T
if Cm is not None and Un is not None: # Attention : si Cm est aussi dans M, doublon !
Cm = Cm.reshape(Xn.size,Un.size) # ADAO & check shape
Xn_predicted = Xn_predicted + Cm * Un
Xn_predicted = numpy.min(numpy.hstack((Xn_predicted,numpy.asmatrix(self._parameters["Bounds"])[:,1])),axis=1)
#
if self._parameters["EstimationOf"] == "State":
- d = Ynpu - numpy.asmatrix(numpy.ravel( H( (Xn_predicted, None) ) )).T
+ d = Ynpu - numpy.asmatrix(numpy.ravel( Hm( (Xn_predicted, None) ) )).T
elif self._parameters["EstimationOf"] == "Parameters":
- d = Ynpu - numpy.asmatrix(numpy.ravel( H( (Xn_predicted, Un) ) )).T
+ d = Ynpu - numpy.asmatrix(numpy.ravel( Hm( (Xn_predicted, Un) ) )).T
if Cm is not None and Un is not None: # Attention : si Cm est aussi dans H, doublon !
d = d - Cm * Un
#
# Utilisation éventuelle d'un vecteur H(Xb) précalculé
# ----------------------------------------------------
if HO["AppliedInX"] is not None and "HXb" in HO["AppliedInX"]:
- HXb = Hm( Xb, HO["AppliedInX"]["HXb"])
+ HXb = Hm( Xb, HO["AppliedInX"]["HXb"] )
else:
HXb = Hm( Xb )
HXb = numpy.asmatrix(numpy.ravel( HXb )).T
elif self._toStore("SimulatedObservationAtCurrentOptimum"):
HXa = self.StoredVariables["SimulatedObservationAtCurrentOptimum"][-1]
else:
- HXa = Hm(Xa)
+ HXa = Hm( Xa )
#
#
# Calculs et/ou stockages supplémentaires
# ---------------------------------------
- if self._toStore("Innovation") or self._toStore("OMB"):
+ if self._toStore("Innovation") or \
+ self._toStore("OMB"):
d = Y - HXb
if self._toStore("Innovation"):
self.StoredVariables["Innovation"].store( numpy.ravel(d) )
#
# Opérateurs
# ----------
- H = HO["Direct"].appliedControledFormTo
+ Hm = HO["Direct"].appliedControledFormTo
#
if self._parameters["EstimationOf"] == "State":
- M = EM["Direct"].appliedControledFormTo
+ Mm = EM["Direct"].appliedControledFormTo
#
if CM is not None and "Tangent" in CM and U is not None:
Cm = CM["Tangent"].asMatrix(Xb)
XEtnnp = []
for point in range(nbSpts):
if self._parameters["EstimationOf"] == "State":
- XEtnnpi = numpy.asmatrix(numpy.ravel( M( (Xnp[:,point], Un) ) )).T
+ XEtnnpi = numpy.asmatrix(numpy.ravel( Mm( (Xnp[:,point], Un) ) )).T
if Cm is not None and Un is not None: # Attention : si Cm est aussi dans M, doublon !
Cm = Cm.reshape(Xn.size,Un.size) # ADAO & check shape
XEtnnpi = XEtnnpi + Cm * Un
Ynnp = []
for point in range(nbSpts):
if self._parameters["EstimationOf"] == "State":
- Ynnpi = numpy.asmatrix(numpy.ravel( H( (Xnnp[:,point], None) ) )).T
+ Ynnpi = numpy.asmatrix(numpy.ravel( Hm( (Xnnp[:,point], None) ) )).T
elif self._parameters["EstimationOf"] == "Parameters":
- Ynnpi = numpy.asmatrix(numpy.ravel( H( (Xnnp[:,point], Un) ) )).T
+ Ynnpi = numpy.asmatrix(numpy.ravel( Hm( (Xnnp[:,point], Un) ) )).T
Ynnp.append( Ynnpi )
Ynnp = numpy.hstack( Ynnp )
#
has_eficas = bool( "EFICAS_ROOT_DIR" in os.environ )
# ==============================================================================
-def uniq(__sequence):
+def uniq( __sequence ):
"""
Fonction pour rendre unique chaque élément d'une liste, en préservant l'ordre
"""