Salome HOME
Documentation and source observer improvements for checking algorithms
authorJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 3 Oct 2015 13:19:17 +0000 (15:19 +0200)
committerJean-Philippe ARGAUD <jean-philippe.argaud@edf.fr>
Sat, 3 Oct 2015 13:19:17 +0000 (15:19 +0200)
22 files changed:
doc/en/ref_algorithm_AdjointTest.rst
doc/en/ref_algorithm_FunctionTest.rst
doc/en/ref_algorithm_GradientTest.rst
doc/en/ref_algorithm_LinearityTest.rst
doc/en/ref_algorithm_SamplingTest.rst
doc/en/ref_algorithm_TangentTest.rst
doc/en/ref_output_variables.rst
doc/fr/ref_algorithm_AdjointTest.rst
doc/fr/ref_algorithm_FunctionTest.rst
doc/fr/ref_algorithm_GradientTest.rst
doc/fr/ref_algorithm_LinearityTest.rst
doc/fr/ref_algorithm_SamplingTest.rst
doc/fr/ref_algorithm_TangentTest.rst
doc/fr/ref_output_variables.rst
src/daComposant/daAlgorithms/AdjointTest.py
src/daComposant/daAlgorithms/FunctionTest.py
src/daComposant/daAlgorithms/GradientTest.py
src/daComposant/daAlgorithms/LinearityTest.py
src/daComposant/daAlgorithms/SamplingTest.py
src/daComposant/daAlgorithms/TangentTest.py
src/daComposant/daCore/BasicObjects.py
src/daSalome/daYacsSchemaCreator/infos_daComposant.py

index 3f67d8d950f4d246f6c70228248166824f18beab..cb7f76f7a02e50c723b5fcea8af3604b80d50dfa 100644 (file)
@@ -54,6 +54,7 @@ Optional and required commands
 .. index:: single: EpsilonMinimumExponent
 .. index:: single: InitialDirection
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 The general required commands, available in the editing user interface, are the
 following:
@@ -115,10 +116,54 @@ The options of the algorithm are the following:
 
     Example : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    This list indicates the names of the supplementary variables that can be
+    available at the end of the algorithm. It involves potentially costly
+    calculations or memory consumptions. The default is a void list, none of
+    these variables being calculated and stored by default. The possible names
+    are in the following list: ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Example : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Information and variables available at the end of the algorithm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+At the output, after executing the algorithm, there are variables and
+information originating from the calculation. The description of
+:ref:`section_ref_output_variables` show the way to obtain them by the method
+named ``get`` of the variable "*ADD*" of the post-processing. The input
+variables, available to the user at the output in order to facilitate the
+writing of post-processing procedures, are described in the
+:ref:`subsection_r_o_v_Inventaire`.
+
+The unconditional outputs of the algorithm are the following:
+
+  Residu
+    *List of values*. Each element is the value of the particular residu
+    verified during a checking algorithm, in the order of the tests.
+
+    Example : ``r = ADD.get("Residu")[:]``
+
+The conditional outputs of the algorithm are the following:
+
+  CurrentState
+    *List of vectors*. Each element is a usual state vector used during the
+    optimization algorithm procedure.
+
+    Example : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *List of vectors*. Each element is an observed vector at the current state,
+    that is, in the observation space.
+
+    Example : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 See also
 ++++++++
 
 References to other sections:
   - :ref:`section_ref_algorithm_FunctionTest`
+  - :ref:`section_ref_algorithm_LinearityTest`
   - :ref:`section_ref_algorithm_TangentTest`
   - :ref:`section_ref_algorithm_GradientTest`
index e8724bef0eb338305b66fbf12925952ff0fec5fe..b5e4f7f00774a4a4c71b469f96e70dfb13ec3ac5 100644 (file)
@@ -49,6 +49,7 @@ Optional and required commands
 .. index:: single: NumberOfPrintedDigits
 .. index:: single: NumberOfRepetition
 .. index:: single: SetDebug
+.. index:: single: StoreSupplementaryCalculations
 
 The general required commands, available in the editing user interface, are the
 following:
@@ -97,6 +98,41 @@ The options of the algorithm are the following:
 
     Example : ``{"SetDebug":False}``
 
+  StoreSupplementaryCalculations
+    This list indicates the names of the supplementary variables that can be
+    available at the end of the algorithm. It involves potentially costly
+    calculations or memory consumptions. The default is a void list, none of
+    these variables being calculated and stored by default. The possible names
+    are in the following list: ["CurrentState",
+    "SimulatedObservationAtCurrentState"].
+
+    Example : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Information and variables available at the end of the algorithm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+At the output, after executing the algorithm, there are variables and
+information originating from the calculation. The description of
+:ref:`section_ref_output_variables` show the way to obtain them by the method
+named ``get`` of the variable "*ADD*" of the post-processing. The input
+variables, available to the user at the output in order to facilitate the
+writing of post-processing procedures, are described in the
+:ref:`subsection_r_o_v_Inventaire`.
+
+The conditional outputs of the algorithm are the following:
+
+  CurrentState
+    *List of vectors*. Each element is a usual state vector used during the
+    optimization algorithm procedure.
+
+    Example : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *List of vectors*. Each element is an observed vector at the current state,
+    that is, in the observation space.
+
+    Example : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 See also
 ++++++++
 
index c325802db74aa05b1a3ff196b873131dcf6346b0..5bb80f4d0880742e4779cf0a790088a0430e0496 100644 (file)
@@ -97,6 +97,7 @@ Optional and required commands
 .. index:: single: InitialDirection
 .. index:: single: ResiduFormula
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 The general required commands, available in the editing user interface, are the
 following:
@@ -170,10 +171,54 @@ The options of the algorithm are the following:
 
     Example : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    This list indicates the names of the supplementary variables that can be
+    available at the end of the algorithm. It involves potentially costly
+    calculations or memory consumptions. The default is a void list, none of
+    these variables being calculated and stored by default. The possible names
+    are in the following list: ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Example : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Information and variables available at the end of the algorithm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+At the output, after executing the algorithm, there are variables and
+information originating from the calculation. The description of
+:ref:`section_ref_output_variables` show the way to obtain them by the method
+named ``get`` of the variable "*ADD*" of the post-processing. The input
+variables, available to the user at the output in order to facilitate the
+writing of post-processing procedures, are described in the
+:ref:`subsection_r_o_v_Inventaire`.
+
+The unconditional outputs of the algorithm are the following:
+
+  Residu
+    *List of values*. Each element is the value of the particular residu
+    verified during a checking algorithm, in the order of the tests.
+
+    Example : ``r = ADD.get("Residu")[:]``
+
+The conditional outputs of the algorithm are the following:
+
+  CurrentState
+    *List of vectors*. Each element is a usual state vector used during the
+    optimization algorithm procedure.
+
+    Example : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *List of vectors*. Each element is an observed vector at the current state,
+    that is, in the observation space.
+
+    Example : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 See also
 ++++++++
 
 References to other sections:
   - :ref:`section_ref_algorithm_FunctionTest`
+  - :ref:`section_ref_algorithm_LinearityTest`
   - :ref:`section_ref_algorithm_TangentTest`
   - :ref:`section_ref_algorithm_AdjointTest`
index 1716c279559a3a216522e13614a0398e5455fe7a..0dc591ee90ccbd098edec35d18c0813d3bd4e5fe 100644 (file)
@@ -120,6 +120,7 @@ Optional and required commands
 .. index:: single: InitialDirection
 .. index:: single: ResiduFormula
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 The general required commands, available in the editing user interface, are the
 following:
@@ -195,6 +196,49 @@ The options of the algorithm are the following:
 
     Example : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    This list indicates the names of the supplementary variables that can be
+    available at the end of the algorithm. It involves potentially costly
+    calculations or memory consumptions. The default is a void list, none of
+    these variables being calculated and stored by default. The possible names
+    are in the following list: ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Example : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Information and variables available at the end of the algorithm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+At the output, after executing the algorithm, there are variables and
+information originating from the calculation. The description of
+:ref:`section_ref_output_variables` show the way to obtain them by the method
+named ``get`` of the variable "*ADD*" of the post-processing. The input
+variables, available to the user at the output in order to facilitate the
+writing of post-processing procedures, are described in the
+:ref:`subsection_r_o_v_Inventaire`.
+
+The unconditional outputs of the algorithm are the following:
+
+  Residu
+    *List of values*. Each element is the value of the particular residu
+    verified during a checking algorithm, in the order of the tests.
+
+    Example : ``r = ADD.get("Residu")[:]``
+
+The conditional outputs of the algorithm are the following:
+
+  CurrentState
+    *List of vectors*. Each element is a usual state vector used during the
+    optimization algorithm procedure.
+
+    Example : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *List of vectors*. Each element is an observed vector at the current state,
+    that is, in the observation space.
+
+    Example : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 See also
 ++++++++
 
index 10dd6b07c1aa3d2c8498caa802809e3b5cbe7d4d..eb465c085bef41a27daf8db948edaf06791aaefe 100644 (file)
@@ -178,11 +178,60 @@ The options of the algorithm are the following:
     available at the end of the algorithm. It involves potentially costly
     calculations or memory consumptions. The default is a void list, none of
     these variables being calculated and stored by default. The possible names
-    are in the following list: ["CostFunctionJ", "CurrentState", "Innovation",
-    "SimulatedObservationAtCurrentState"].
+    are in the following list: ["CostFunctionJ", "CurrentState",
+    "InnovationAtCurrentState", "SimulatedObservationAtCurrentState"].
 
     Example : ``{"StoreSupplementaryCalculations":["CostFunctionJ", "SimulatedObservationAtCurrentState"]}``
 
+Information and variables available at the end of the algorithm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+At the output, after executing the algorithm, there are variables and
+information originating from the calculation. The description of
+:ref:`section_ref_output_variables` show the way to obtain them by the method
+named ``get`` of the variable "*ADD*" of the post-processing. The input
+variables, available to the user at the output in order to facilitate the
+writing of post-processing procedures, are described in the
+:ref:`subsection_r_o_v_Inventaire`.
+
+The unconditional outputs of the algorithm are the following:
+
+  CostFunctionJ
+    *List of values*. Each element is a value of the error function :math:`J`.
+
+    Example : ``J = ADD.get("CostFunctionJ")[:]``
+
+  CostFunctionJb
+    *List of values*. Each element is a value of the error function :math:`J^b`,
+    that is of the background difference part.
+
+    Example : ``Jb = ADD.get("CostFunctionJb")[:]``
+
+  CostFunctionJo
+    *List of values*. Each element is a value of the error function :math:`J^o`,
+    that is of the observation difference part.
+
+    Example : ``Jo = ADD.get("CostFunctionJo")[:]``
+
+The conditional outputs of the algorithm are the following:
+
+  CurrentState
+    *List of vectors*. Each element is a usual state vector used during the
+    optimization algorithm procedure.
+
+    Example : ``Xs = ADD.get("CurrentState")[:]``
+
+  InnovationAtCurrentState
+    *List of vectors*. Each element is an innovation vector at current state.
+
+    Example : ``ds = ADD.get("InnovationAtCurrentState")[-1]``
+
+  SimulatedObservationAtCurrentState
+    *List of vectors*. Each element is an observed vector at the current state,
+    that is, in the observation space.
+
+    Example : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 See also
 ++++++++
 
index 7b8460d967dddd2f03ec49c962bc618ea9d56e1b..04d06764c3513c4b4aeea6a6151220d857c7a8a8 100644 (file)
@@ -62,6 +62,7 @@ Optional and required commands
 .. index:: single: EpsilonMinimumExponent
 .. index:: single: InitialDirection
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 The general required commands, available in the editing user interface, are the
 following:
@@ -123,10 +124,54 @@ The options of the algorithm are the following:
 
     Example : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    This list indicates the names of the supplementary variables that can be
+    available at the end of the algorithm. It involves potentially costly
+    calculations or memory consumptions. The default is a void list, none of
+    these variables being calculated and stored by default. The possible names
+    are in the following list: ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Example : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Information and variables available at the end of the algorithm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+At the output, after executing the algorithm, there are variables and
+information originating from the calculation. The description of
+:ref:`section_ref_output_variables` show the way to obtain them by the method
+named ``get`` of the variable "*ADD*" of the post-processing. The input
+variables, available to the user at the output in order to facilitate the
+writing of post-processing procedures, are described in the
+:ref:`subsection_r_o_v_Inventaire`.
+
+The unconditional outputs of the algorithm are the following:
+
+  Residu
+    *List of values*. Each element is the value of the particular residu
+    verified during a checking algorithm, in the order of the tests.
+
+    Example : ``r = ADD.get("Residu")[:]``
+
+The conditional outputs of the algorithm are the following:
+
+  CurrentState
+    *List of vectors*. Each element is a usual state vector used during the
+    optimization algorithm procedure.
+
+    Example : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *List of vectors*. Each element is an observed vector at the current state,
+    that is, in the observation space.
+
+    Example : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 See also
 ++++++++
 
 References to other sections:
   - :ref:`section_ref_algorithm_FunctionTest`
+  - :ref:`section_ref_algorithm_LinearityTest`
   - :ref:`section_ref_algorithm_AdjointTest`
   - :ref:`section_ref_algorithm_GradientTest`
index 03735107a709373490e6937fb50072c5413547cd..d8713c5c77e35d6d69d09c3d98d20b1cb31a20fb 100644 (file)
@@ -313,6 +313,12 @@ of availability. They are the following, in alphabetical order:
 
     Example : ``omb = ADD.get("OMB")[-1]``
 
+  Residu
+    *List of values*. Each element is the value of the particular residu
+    verified during a checking algorithm, in the order of the tests.
+
+    Example : ``r = ADD.get("Residu")[:]``
+
   SigmaBck2
     *List of values*. Each element is a value of the quality indicator
     :math:`(\sigma^b)^2` of the background part.
index 118e1aee163bc6a936d0226eb9026977f6a91441..93a51608f727a003f5477c8445d656009d26fbba 100644 (file)
@@ -53,6 +53,7 @@ Commandes requises et optionnelles
 .. index:: single: EpsilonMinimumExponent
 .. index:: single: InitialDirection
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 Les commandes requises générales, disponibles dans l'interface en édition, sont
 les suivantes:
@@ -117,10 +118,55 @@ Les options de l'algorithme sont les suivantes:
 
     Exemple : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    Cette liste indique les noms des variables supplémentaires qui peuvent être
+    disponibles à la fin de l'algorithme. Cela implique potentiellement des
+    calculs ou du stockage coûteux. La valeur par défaut est une liste vide,
+    aucune de ces variables n'étant calculée et stockée par défaut. Les noms
+    possibles sont dans la liste suivante : ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Exemple : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Informations et variables disponibles à la fin de l'algorithme
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+En sortie, après exécution de l'algorithme, on dispose d'informations et de
+variables issues du calcul. La description des
+:ref:`section_ref_output_variables` indique la manière de les obtenir par la
+méthode nommée ``get`` de la variable "*ADD*" du post-processing. Les variables
+d'entrée, mises à disposition de l'utilisateur en sortie pour faciliter
+l'écriture des procédures de post-processing, sont décrites dans
+l':ref:`subsection_r_o_v_Inventaire`.
+
+Les sorties non conditionnelles de l'algorithme sont les suivantes:
+
+  Residu
+    *Liste de valeurs*. Chaque élément est la valeur du résidu particulier
+    vérifié lors d'un algorithme de vérification, selon l'ordre des tests
+    effectués.
+
+    Exemple : ``r = ADD.get("Residu")[:]``
+
+Les sorties conditionnelles de l'algorithme sont les suivantes:
+
+  CurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'état courant utilisé
+    au cours du déroulement de l'algorithme d'optimisation.
+
+    Exemple : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'observation simulé à
+    partir de l'état courant, c'est-à-dire dans l'espace des observations.
+
+    Exemple : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 Voir aussi
 ++++++++++
 
 Références vers d'autres sections :
   - :ref:`section_ref_algorithm_FunctionTest`
+  - :ref:`section_ref_algorithm_LinearityTest`
   - :ref:`section_ref_algorithm_TangentTest`
   - :ref:`section_ref_algorithm_GradientTest`
index ac114488562008c35435418ab118ff16bd842190..775ca3a2bfc2bbe45ca8ce4e13cf784f830f6386 100644 (file)
@@ -51,6 +51,7 @@ Commandes requises et optionnelles
 .. index:: single: NumberOfPrintedDigits
 .. index:: single: NumberOfRepetition
 .. index:: single: SetDebug
+.. index:: single: StoreSupplementaryCalculations
 
 Les commandes requises générales, disponibles dans l'interface en édition, sont
 les suivantes:
@@ -100,6 +101,41 @@ Les options de l'algorithme sont les suivantes:
 
     Exemple : ``{"SetDebug":False}``
 
+  StoreSupplementaryCalculations
+    Cette liste indique les noms des variables supplémentaires qui peuvent être
+    disponibles à la fin de l'algorithme. Cela implique potentiellement des
+    calculs ou du stockage coûteux. La valeur par défaut est une liste vide,
+    aucune de ces variables n'étant calculée et stockée par défaut. Les noms
+    possibles sont dans la liste suivante : ["CurrentState",
+    "SimulatedObservationAtCurrentState"].
+
+    Exemple : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Informations et variables disponibles à la fin de l'algorithme
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+En sortie, après exécution de l'algorithme, on dispose d'informations et de
+variables issues du calcul. La description des
+:ref:`section_ref_output_variables` indique la manière de les obtenir par la
+méthode nommée ``get`` de la variable "*ADD*" du post-processing. Les variables
+d'entrée, mises à disposition de l'utilisateur en sortie pour faciliter
+l'écriture des procédures de post-processing, sont décrites dans
+l':ref:`subsection_r_o_v_Inventaire`.
+
+Les sorties conditionnelles de l'algorithme sont les suivantes:
+
+  CurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'état courant utilisé
+    au cours du déroulement de l'algorithme d'optimisation.
+
+    Exemple : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'observation simulé à
+    partir de l'état courant, c'est-à-dire dans l'espace des observations.
+
+    Exemple : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 Voir aussi
 ++++++++++
 
index 83ae79cee74e3d99de0f259924804f0b2fe22e5f..3cf57aba9e3fa18bda53f587862fdf5834275c4b 100644 (file)
@@ -96,6 +96,7 @@ Commandes requises et optionnelles
 .. index:: single: InitialDirection
 .. index:: single: ResiduFormula
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 Les commandes requises générales, disponibles dans l'interface en édition, sont
 les suivantes:
@@ -172,10 +173,55 @@ Les options de l'algorithme sont les suivantes:
 
     Exemple : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    Cette liste indique les noms des variables supplémentaires qui peuvent être
+    disponibles à la fin de l'algorithme. Cela implique potentiellement des
+    calculs ou du stockage coûteux. La valeur par défaut est une liste vide,
+    aucune de ces variables n'étant calculée et stockée par défaut. Les noms
+    possibles sont dans la liste suivante : ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Exemple : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Informations et variables disponibles à la fin de l'algorithme
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+En sortie, après exécution de l'algorithme, on dispose d'informations et de
+variables issues du calcul. La description des
+:ref:`section_ref_output_variables` indique la manière de les obtenir par la
+méthode nommée ``get`` de la variable "*ADD*" du post-processing. Les variables
+d'entrée, mises à disposition de l'utilisateur en sortie pour faciliter
+l'écriture des procédures de post-processing, sont décrites dans
+l':ref:`subsection_r_o_v_Inventaire`.
+
+Les sorties non conditionnelles de l'algorithme sont les suivantes:
+
+  Residu
+    *Liste de valeurs*. Chaque élément est la valeur du résidu particulier
+    vérifié lors d'un algorithme de vérification, selon l'ordre des tests
+    effectués.
+
+    Exemple : ``r = ADD.get("Residu")[:]``
+
+Les sorties conditionnelles de l'algorithme sont les suivantes:
+
+  CurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'état courant utilisé
+    au cours du déroulement de l'algorithme d'optimisation.
+
+    Exemple : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'observation simulé à
+    partir de l'état courant, c'est-à-dire dans l'espace des observations.
+
+    Exemple : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 Voir aussi
 ++++++++++
 
 Références vers d'autres sections :
   - :ref:`section_ref_algorithm_FunctionTest`
+  - :ref:`section_ref_algorithm_LinearityTest`
   - :ref:`section_ref_algorithm_TangentTest`
   - :ref:`section_ref_algorithm_AdjointTest`
index f9d0077f5e7e9aee25996462bdb76e39153bfb2f..e81d45f8295f7555aa1a1c263eeb78c2ec198b41 100644 (file)
@@ -119,6 +119,7 @@ Commandes requises et optionnelles
 .. index:: single: InitialDirection
 .. index:: single: ResiduFormula
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 Les commandes requises générales, disponibles dans l'interface en édition, sont
 les suivantes:
@@ -198,6 +199,50 @@ Les options de l'algorithme sont les suivantes:
 
     Exemple : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    Cette liste indique les noms des variables supplémentaires qui peuvent être
+    disponibles à la fin de l'algorithme. Cela implique potentiellement des
+    calculs ou du stockage coûteux. La valeur par défaut est une liste vide,
+    aucune de ces variables n'étant calculée et stockée par défaut. Les noms
+    possibles sont dans la liste suivante : ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Exemple : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Informations et variables disponibles à la fin de l'algorithme
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+En sortie, après exécution de l'algorithme, on dispose d'informations et de
+variables issues du calcul. La description des
+:ref:`section_ref_output_variables` indique la manière de les obtenir par la
+méthode nommée ``get`` de la variable "*ADD*" du post-processing. Les variables
+d'entrée, mises à disposition de l'utilisateur en sortie pour faciliter
+l'écriture des procédures de post-processing, sont décrites dans
+l':ref:`subsection_r_o_v_Inventaire`.
+
+Les sorties non conditionnelles de l'algorithme sont les suivantes:
+
+  Residu
+    *Liste de valeurs*. Chaque élément est la valeur du résidu particulier
+    vérifié lors d'un algorithme de vérification, selon l'ordre des tests
+    effectués.
+
+    Exemple : ``r = ADD.get("Residu")[:]``
+
+Les sorties conditionnelles de l'algorithme sont les suivantes:
+
+  CurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'état courant utilisé
+    au cours du déroulement de l'algorithme d'optimisation.
+
+    Exemple : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'observation simulé à
+    partir de l'état courant, c'est-à-dire dans l'espace des observations.
+
+    Exemple : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 Voir aussi
 ++++++++++
 
index 0ae57f9cbce421d6538ac64145dab4b3b1e6fa87..b1f2c6250a042f7121f7d15befef031653476cb4 100644 (file)
@@ -186,10 +186,61 @@ Les options de l'algorithme sont les suivantes:
     calculs ou du stockage coûteux. La valeur par défaut est une liste vide,
     aucune de ces variables n'étant calculée et stockée par défaut. Les noms
     possibles sont dans la liste suivante : ["CostFunctionJ", "CurrentState",
-    "Innovation", "SimulatedObservationAtCurrentState"].
+    "InnovationAtCurrentState", "SimulatedObservationAtCurrentState"].
 
     Exemple : ``{"StoreSupplementaryCalculations":["CostFunctionJ", "SimulatedObservationAtCurrentState"]}``
 
+Informations et variables disponibles à la fin de l'algorithme
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+En sortie, après exécution de l'algorithme, on dispose d'informations et de
+variables issues du calcul. La description des
+:ref:`section_ref_output_variables` indique la manière de les obtenir par la
+méthode nommée ``get`` de la variable "*ADD*" du post-processing. Les variables
+d'entrée, mises à disposition de l'utilisateur en sortie pour faciliter
+l'écriture des procédures de post-processing, sont décrites dans
+l':ref:`subsection_r_o_v_Inventaire`.
+
+Les sorties non conditionnelles de l'algorithme sont les suivantes:
+
+  CostFunctionJ
+    *Liste de valeurs*. Chaque élément est une valeur de fonctionnelle d'écart
+    :math:`J`.
+
+    Exemple : ``J = ADD.get("CostFunctionJ")[:]``
+
+  CostFunctionJb
+    *Liste de valeurs*. Chaque élément est une valeur de fonctionnelle d'écart
+    :math:`J^b`, c'est-à-dire de la partie écart à l'ébauche.
+
+    Exemple : ``Jb = ADD.get("CostFunctionJb")[:]``
+
+  CostFunctionJo
+    *Liste de valeurs*. Chaque élément est une valeur de fonctionnelle d'écart
+    :math:`J^o`, c'est-à-dire de la partie écart à l'observation.
+
+    Exemple : ``Jo = ADD.get("CostFunctionJo")[:]``
+
+Les sorties conditionnelles de l'algorithme sont les suivantes:
+
+  CurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'état courant utilisé
+    au cours du déroulement de l'algorithme d'optimisation.
+
+    Exemple : ``Xs = ADD.get("CurrentState")[:]``
+
+  InnovationAtCurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'innovation à l'état
+    courant.
+
+    Exemple : ``ds = ADD.get("InnovationAtCurrentState")[-1]``
+
+  SimulatedObservationAtCurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'observation simulé à
+    partir de l'état courant, c'est-à-dire dans l'espace des observations.
+
+    Exemple : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 Voir aussi
 ++++++++++
 
index fd36480cc57fc179690e9d529925b9062c1c01ed..9455b9d0f39faf1997ade5fdc278a1b71d64a9f6 100644 (file)
@@ -63,6 +63,7 @@ Commandes requises et optionnelles
 .. index:: single: EpsilonMinimumExponent
 .. index:: single: InitialDirection
 .. index:: single: SetSeed
+.. index:: single: StoreSupplementaryCalculations
 
 Les commandes requises générales, disponibles dans l'interface en édition, sont
 les suivantes:
@@ -127,10 +128,55 @@ Les options de l'algorithme sont les suivantes:
 
     Exemple : ``{"SetSeed":1000}``
 
+  StoreSupplementaryCalculations
+    Cette liste indique les noms des variables supplémentaires qui peuvent être
+    disponibles à la fin de l'algorithme. Cela implique potentiellement des
+    calculs ou du stockage coûteux. La valeur par défaut est une liste vide,
+    aucune de ces variables n'étant calculée et stockée par défaut. Les noms
+    possibles sont dans la liste suivante : ["CurrentState", "Residu",
+    "SimulatedObservationAtCurrentState"].
+
+    Exemple : ``{"StoreSupplementaryCalculations":["CurrentState"]}``
+
+Informations et variables disponibles à la fin de l'algorithme
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+En sortie, après exécution de l'algorithme, on dispose d'informations et de
+variables issues du calcul. La description des
+:ref:`section_ref_output_variables` indique la manière de les obtenir par la
+méthode nommée ``get`` de la variable "*ADD*" du post-processing. Les variables
+d'entrée, mises à disposition de l'utilisateur en sortie pour faciliter
+l'écriture des procédures de post-processing, sont décrites dans
+l':ref:`subsection_r_o_v_Inventaire`.
+
+Les sorties non conditionnelles de l'algorithme sont les suivantes:
+
+  Residu
+    *Liste de valeurs*. Chaque élément est la valeur du résidu particulier
+    vérifié lors d'un algorithme de vérification, selon l'ordre des tests
+    effectués.
+
+    Exemple : ``r = ADD.get("Residu")[:]``
+
+Les sorties conditionnelles de l'algorithme sont les suivantes:
+
+  CurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'état courant utilisé
+    au cours du déroulement de l'algorithme d'optimisation.
+
+    Exemple : ``Xs = ADD.get("CurrentState")[:]``
+
+  SimulatedObservationAtCurrentState
+    *Liste de vecteurs*. Chaque élément est un vecteur d'observation simulé à
+    partir de l'état courant, c'est-à-dire dans l'espace des observations.
+
+    Exemple : ``hxs = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+
 Voir aussi
 ++++++++++
 
 Références vers d'autres sections :
   - :ref:`section_ref_algorithm_FunctionTest`
+  - :ref:`section_ref_algorithm_LinearityTest`
   - :ref:`section_ref_algorithm_AdjointTest`
   - :ref:`section_ref_algorithm_GradientTest`
index 9fbeeeecba8aa0a4114b7e88bb19ee866fe64162..16576e3be97befdc85b7de8b32ef6667302fbe41 100644 (file)
@@ -325,6 +325,13 @@ alphab
 
     Exemple : ``omb = ADD.get("OMB")[-1]``
 
+  Residu
+    *Liste de valeurs*. Chaque élément est la valeur du résidu particulier
+    vérifié lors d'un algorithme de vérification, selon l'ordre des tests
+    effectués.
+
+    Exemple : ``r = ADD.get("Residu")[:]``
+
   SigmaBck2
     *Liste de valeurs*. Chaque élément est une valeur de l'indicateur de
     qualité :math:`(\sigma^b)^2` de la partie ébauche.
index dd80339f6852e3f6f8c38b71ef677645f2a82cb6..827c8c0bccf43aa8115a4e7359fa38d3d47e1aef 100644 (file)
@@ -66,6 +66,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             typecast = str,
             message  = "Titre du tableau et de la figure",
             )
+        self.defineRequiredParameter(
+            name     = "StoreSupplementaryCalculations",
+            default  = [],
+            typecast = tuple,
+            message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
+            listval  = ["CurrentState", "Residu", "SimulatedObservationAtCurrentState"]
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
@@ -86,6 +93,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             Y = numpy.asmatrix(numpy.ravel( Hm( X ) )).T
         Y = numpy.asmatrix(numpy.ravel( Y )).T
         NormeY = numpy.linalg.norm( Y )
+        if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["CurrentState"].store( numpy.ravel(X) )
+        if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(Y) )
         #
         if len(self._parameters["InitialDirection"]) == 0:
             dX0 = []
@@ -143,7 +154,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             msg = "  %2i  %5.0e   %9.3e   %9.3e   %9.3e   |  %9.3e"%(i,amplitude,NormeX,NormeY,NormedX,Residu)
             msgs += "\n" + __marge + msg
             #
-            self.StoredVariables["CostFunctionJ"].store( Residu )
+            self.StoredVariables["Residu"].store( Residu )
         #
         msgs += "\n" + __marge + "-"*__nbtirets
         msgs += "\n"
index 0daf2869bd849cf01c606bfb850c1cd4ea8c0872..4718cf9023fa324a51092dea1063764c0caeddfa 100644 (file)
@@ -54,6 +54,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             typecast = bool,
             message  = "Activation du mode debug lors de l'exécution",
             )
+        self.defineRequiredParameter(
+            name     = "StoreSupplementaryCalculations",
+            default  = [],
+            typecast = tuple,
+            message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
+            listval  = ["CurrentState", "SimulatedObservationAtCurrentState"]
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
@@ -72,11 +79,11 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             msg += "     ====" + "="*len(self._parameters["ResultTitle"]) + "====\n"
             print("%s"%msg)
         #
-        msg  = "===> Information before launching:\n"
-        msg += "     -----------------------------\n"
-        msg += "     Characteristics of input vector X, internally converted:\n"
-        msg += "       Type...............: %s\n"%type( Xn )
-        msg += "       Lenght of vector...: %i\n"%max(numpy.matrix( Xn ).shape)
+        msg  = ("===> Information before launching:\n")
+        msg += ("     -----------------------------\n")
+        msg += ("     Characteristics of input vector X, internally converted:\n")
+        msg += ("       Type...............: %s\n")%type( Xn )
+        msg += ("       Lenght of vector...: %i\n")%max(numpy.matrix( Xn ).shape)
         msg += ("       Minimum value......: %."+str(_p)+"e\n")%numpy.min( Xn )
         msg += ("       Maximum value......: %."+str(_p)+"e\n")%numpy.max( Xn )
         msg += ("       Mean of vector.....: %."+str(_p)+"e\n")%numpy.mean( Xn )
@@ -96,6 +103,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         # ----------
         Ys = []
         for i in range(self._parameters["NumberOfRepetition"]):
+            if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
             print("     %s\n"%("-"*75,))
             if self._parameters["NumberOfRepetition"] > 1:
                 print("===> Repetition step number %i on a total of %i\n"%(i+1,self._parameters["NumberOfRepetition"]))
@@ -115,6 +124,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             msg += ("       Standard error.....: %."+str(_p)+"e\n")%numpy.std( Yn )
             msg += ("       L2 norm of vector..: %."+str(_p)+"e\n")%numpy.linalg.norm( Yn )
             print(msg)
+            if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(Yn) )
             #
             Ys.append( copy.copy( numpy.ravel(
                 Yn
index fbe30003ba90f9778a85a6e7b0bc12d2f7d131bf..8e4849520c5175d9b6ddd9c5a42497f8eb679563 100644 (file)
@@ -92,6 +92,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             typecast = str,
             message  = "Label de la courbe tracée dans la figure",
             )
+        self.defineRequiredParameter(
+            name     = "StoreSupplementaryCalculations",
+            default  = [],
+            typecast = tuple,
+            message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
+            listval  = ["CurrentState", "Residu", "SimulatedObservationAtCurrentState"]
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
@@ -110,6 +117,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         FX      = numpy.asmatrix(numpy.ravel( Hm( X ) )).T
         NormeX  = numpy.linalg.norm( X )
         NormeFX = numpy.linalg.norm( FX )
+        if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
+        if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX) )
         #
         if len(self._parameters["InitialDirection"]) == 0:
             dX0 = []
@@ -222,6 +233,11 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             FX_plus_dX = Hm( X + dX )
             FX_plus_dX = numpy.asmatrix(numpy.ravel( FX_plus_dX )).T
             #
+            if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                self.StoredVariables["CurrentState"].store( numpy.ravel(X + dX) )
+            if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
+            #
             NormedX     = numpy.linalg.norm( dX )
             NormeFXdX   = numpy.linalg.norm( FX_plus_dX )
             NormedFX    = numpy.linalg.norm( FX_plus_dX - FX )
@@ -254,7 +270,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             msg = "  %2i  %5.0e   %9.3e   %9.3e   %9.3e   %9.3e   %9.3e      |      %9.3e          |   %9.3e   %4.0f"%(i,amplitude,NormeX,NormeFX,NormeFXdX,NormedX,NormedFX,NormedFXsdX,Residu,math.log10(max(1.e-99,Residu)))
             msgs += "\n" + __marge + msg
             #
-            self.StoredVariables["CostFunctionJ"].store( Residu )
+            self.StoredVariables["Residu"].store( Residu )
         #
         msgs += "\n" + __marge + "-"*__nbtirets
         msgs += "\n"
@@ -269,7 +285,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             f.write(msgs)
             f.close()
             #
-            Residus = self.StoredVariables["CostFunctionJ"][-len(Perturbations):]
+            Residus = self.StoredVariables["Residu"][-len(Perturbations):]
             if self._parameters["ResiduFormula"] in ["Taylor", "TaylorOnNorm"]:
                 PerturbationsCarre = [ 10**(2*i) for i in xrange(-len(NormesdFXGdX)+1,1) ]
                 PerturbationsCarre.reverse()
index d3b3b8171b18159087a27b104f22644d6f1ee8ae..75ec3723725bb76d83b0cb755b8d4f0402b2cfd5 100644 (file)
@@ -74,6 +74,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             typecast = str,
             message  = "Titre du tableau et de la figure",
             )
+        self.defineRequiredParameter(
+            name     = "StoreSupplementaryCalculations",
+            default  = [],
+            typecast = tuple,
+            message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
+            listval  = ["CurrentState", "Residu", "SimulatedObservationAtCurrentState"]
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
@@ -103,6 +110,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         FX      = numpy.asmatrix(numpy.ravel( Hm( Xn ) )).T
         NormeX  = numpy.linalg.norm( Xn )
         NormeFX = numpy.linalg.norm( FX )
+        if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
+        if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX) )
         #
         # Fabrication de la direction de  l'incrément dX
         # ----------------------------------------------
@@ -238,49 +249,83 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             dX      = amplitude * dX0
             #
             if self._parameters["ResiduFormula"] == "CenteredDL":
+                if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(Xn - dX) )
+                #
                 FX_plus_dX  = numpy.asmatrix(numpy.ravel( Hm( Xn + dX ) )).T
                 FX_moins_dX = numpy.asmatrix(numpy.ravel( Hm( Xn - dX ) )).T
                 #
+                if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_moins_dX) )
+                #
                 Residu = numpy.linalg.norm( FX_plus_dX + FX_moins_dX - 2 * FX ) / NormeFX
                 #
-                self.StoredVariables["CostFunctionJ"].store( Residu )
+                self.StoredVariables["Residu"].store( Residu )
                 msg = "  %2i  %5.0e   %9.3e   %9.3e   |   %9.3e   %4.0f"%(i,amplitude,NormeX,NormeFX,Residu,math.log10(max(1.e-99,Residu)))
                 msgs += "\n" + __marge + msg
             #
             if self._parameters["ResiduFormula"] == "Taylor":
+                if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
+                #
                 FX_plus_dX  = numpy.asmatrix(numpy.ravel( Hm( Xn + dX ) )).T
                 #
+                if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
+                #
                 Residu = numpy.linalg.norm( FX_plus_dX - FX - amplitude * GradFxdX ) / NormeFX
                 #
-                self.StoredVariables["CostFunctionJ"].store( Residu )
+                self.StoredVariables["Residu"].store( Residu )
                 msg = "  %2i  %5.0e   %9.3e   %9.3e   |   %9.3e   %4.0f"%(i,amplitude,NormeX,NormeFX,Residu,math.log10(max(1.e-99,Residu)))
                 msgs += "\n" + __marge + msg
             #
             if self._parameters["ResiduFormula"] == "NominalTaylor":
+                if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(Xn - dX) )
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(dX) )
+                #
                 FX_plus_dX  = numpy.asmatrix(numpy.ravel( Hm( Xn + dX ) )).T
                 FX_moins_dX = numpy.asmatrix(numpy.ravel( Hm( Xn - dX ) )).T
                 FdX         = numpy.asmatrix(numpy.ravel( Hm( dX ) )).T
                 #
+                if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_moins_dX) )
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FdX) )
+                #
                 Residu = max(
                     numpy.linalg.norm( FX_plus_dX  - amplitude * FdX ) / NormeFX,
                     numpy.linalg.norm( FX_moins_dX + amplitude * FdX ) / NormeFX,
                     )
                 #
-                self.StoredVariables["CostFunctionJ"].store( Residu )
+                self.StoredVariables["Residu"].store( Residu )
                 msg = "  %2i  %5.0e   %9.3e   %9.3e   |   %9.3e   %5i %s"%(i,amplitude,NormeX,NormeFX,Residu,100.*abs(Residu-1.),"%")
                 msgs += "\n" + __marge + msg
             #
             if self._parameters["ResiduFormula"] == "NominalTaylorRMS":
+                if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(Xn + dX) )
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(Xn - dX) )
+                    self.StoredVariables["CurrentState"].store( numpy.ravel(dX) )
+                #
                 FX_plus_dX  = numpy.asmatrix(numpy.ravel( Hm( Xn + dX ) )).T
                 FX_moins_dX = numpy.asmatrix(numpy.ravel( Hm( Xn - dX ) )).T
                 FdX         = numpy.asmatrix(numpy.ravel( Hm( dX ) )).T
                 #
+                if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_plus_dX) )
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX_moins_dX) )
+                    self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FdX) )
+                #
                 Residu = max(
                     RMS( FX, FX_plus_dX   - amplitude * FdX ) / NormeFX,
                     RMS( FX, FX_moins_dX  + amplitude * FdX ) / NormeFX,
                     )
                 #
-                self.StoredVariables["CostFunctionJ"].store( Residu )
+                self.StoredVariables["Residu"].store( Residu )
                 msg = "  %2i  %5.0e   %9.3e   %9.3e   |   %9.3e   %5i %s"%(i,amplitude,NormeX,NormeFX,Residu,100.*Residu,"%")
                 msgs += "\n" + __marge + msg
         #
index b4cbeb7ad8b54c617c91520c84ef72a93d7a4d4d..26a040186dca04bcd9d1eafc78c359b9860c9466 100644 (file)
@@ -74,7 +74,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             default  = [],
             typecast = tuple,
             message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
-            listval  = ["CostFunctionJ","CurrentState","Innovation","SimulatedObservationAtCurrentState"]
+            listval  = ["CostFunctionJ","CurrentState","InnovationAtCurrentState","SimulatedObservationAtCurrentState"]
             )
         self.defineRequiredParameter(
             name     = "SetSeed",
@@ -155,8 +155,8 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 J   = float( Jb ) + float( Jo )
             if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
                 self.StoredVariables["CurrentState"].store( _X )
-            if "Innovation" in self._parameters["StoreSupplementaryCalculations"]:
-                self.StoredVariables["Innovation"].store( Y - _HX )
+            if "InnovationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+                self.StoredVariables["InnovationAtCurrentState"].store( Y - _HX )
             if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
                 self.StoredVariables["SimulatedObservationAtCurrentState"].store( _HX )
             self.StoredVariables["CostFunctionJb"].store( Jb )
index 1a4a90f66f774ea3abfbd6fa114f8a42632d0982..f52750bab106a075785f5e259b6326318d205735 100644 (file)
@@ -74,6 +74,13 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
             typecast = str,
             message  = "Titre du tableau et de la figure",
             )
+        self.defineRequiredParameter(
+            name     = "StoreSupplementaryCalculations",
+            default  = [],
+            typecast = tuple,
+            message  = "Liste de calculs supplémentaires à stocker et/ou effectuer",
+            listval  = ["CurrentState", "Residu", "SimulatedObservationAtCurrentState"]
+            )
 
     def run(self, Xb=None, Y=None, U=None, HO=None, EM=None, CM=None, R=None, B=None, Q=None, Parameters=None):
         self._pre_run()
@@ -98,6 +105,10 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
         FX      = numpy.asmatrix(numpy.ravel( Hm( Xn ) )).T
         NormeX  = numpy.linalg.norm( Xn )
         NormeFX = numpy.linalg.norm( FX )
+        if "CurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["CurrentState"].store( numpy.ravel(Xn) )
+        if "SimulatedObservationAtCurrentState" in self._parameters["StoreSupplementaryCalculations"]:
+            self.StoredVariables["SimulatedObservationAtCurrentState"].store( numpy.ravel(FX) )
         #
         # Fabrication de la direction de  l'incrément dX
         # ----------------------------------------------
@@ -173,7 +184,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm):
                 #
                 Residu = numpy.linalg.norm( FX_plus_dX - FX ) / (amplitude * NormeGX)
                 #
-                self.StoredVariables["CostFunctionJ"].store( Residu )
+                self.StoredVariables["Residu"].store( Residu )
                 msg = "  %2i  %5.0e   %9.3e   %9.3e   |   %11.5e    %5.1e"%(i,amplitude,NormeX,NormeFX,Residu,abs(Residu-1.)/amplitude)
                 msgs += "\n" + __marge + msg
         #
index d970634c74af552adb7f06fb83950b794ff1b09f..78934f70bf85137f23ef008fad02734347d5b95c 100644 (file)
@@ -307,6 +307,7 @@ class Algorithm(object):
             - APosterioriVariances : variances de la matrice A
             - APosterioriStandardDeviations : écart-types de la matrice A
             - APosterioriCorrelations : correlations de la matrice A
+            - Residu : dans le cas des algorithmes de vérification
         On peut rajouter des variables à stocker dans l'initialisation de
         l'algorithme élémentaire qui va hériter de cette classe
         """
@@ -345,6 +346,7 @@ class Algorithm(object):
         self.StoredVariables["APosterioriStandardDeviations"]        = Persistence.OneVector(name = "APosterioriStandardDeviations")
         self.StoredVariables["APosterioriCorrelations"]              = Persistence.OneMatrix(name = "APosterioriCorrelations")
         self.StoredVariables["SimulationQuantiles"]                  = Persistence.OneMatrix(name = "SimulationQuantiles")
+        self.StoredVariables["Residu"]                               = Persistence.OneScalar(name = "Residu")
 
     def _pre_run(self):
         "Pré-calcul"
index 0968c91e33bdecee7854d1251fbabd0f9a96c9d3..1c66cf0d722c5e4f667e2e46feb22d7394cd8b6a 100644 (file)
@@ -283,4 +283,5 @@ ObserversList = [
     "APosterioriCovariance",
     "APosterioriStandardDeviations",
     "APosterioriVariances",
+    "Residu",
     ]