#. :ref:`Examples with the "FunctionTest" check<section_ref_algorithm_FunctionTest_examples>`
#. :ref:`Examples with the "ObservationSimulationComparisonTest" check<section_ref_algorithm_ObservationSimulationComparisonTest_examples>`
#. :ref:`Examples with the "ParallelFunctionTest" check<section_ref_algorithm_ParallelFunctionTest_examples>`
+#. :ref:`Examples with the "ReducedModelingTest" check<section_ref_algorithm_ReducedModelingTest_examples>`
Dedicated tasks or study oriented cases uses
--------------------------------------------
--- /dev/null
+..
+ Copyright (C) 2008-2024 EDF R&D
+
+ This file is part of SALOME ADAO module.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+ Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+.. index:: single: InterpolationByReducedModelTest
+.. _section_ref_algorithm_InterpolationByReducedModelTest:
+
+Checking algorithm "*InterpolationByReducedModelTest*"
+------------------------------------------------------
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo01.rst
+
+This algorithm provides a simple way of analyzing the quality of the empirical
+state interpolation obtained using a reduced basis, using measurements at
+specific points.
+
+The results displayed by default are simple statistics related to the
+normalized errors of interpolation with a reduced basis. The test uses a
+reduced base and a set of optimal measurement positions, and uses
+pseudo-measurements from each complete state (“*snapshot*”) included in the
+given test set.
+
+Please note: to be consistent, this test must use the same mathematical norm as
+that used to construct the reduced basis. As the norm is chosen by the user
+when defining the test, the norm used to construct the reduced basis must be
+verified.
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo12.rst
+
+.. include:: snippets/FeaturePropDerivativeFree.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo02.rst
+
+.. include:: snippets/EnsembleOfSnapshots.rst
+
+.. include:: snippets/MeasurementLocations.rst
+
+.. include:: snippets/ReducedBasis.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo03Chck.rst
+
+.. include:: snippets/ErrorNorm.rst
+
+.. include:: snippets/NumberOfPrintedDigits.rst
+
+.. include:: snippets/ShowElementarySummary.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo04.rst
+
+.. include:: snippets/NoUnconditionalOutput.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo05.rst
+
+.. include:: snippets/NoConditionalOutput.rst
+
+.. ------------------------------------ ..
+.. _section_ref_algorithm_InterpolationByReducedModelTest_examples:
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo06.rst
+
+- :ref:`section_ref_algorithm_InterpolationByReducedModelTask`
+- :ref:`section_ref_algorithm_MeasurementsOptimalPositioningTask`
+- :ref:`section_ref_algorithm_ReducedModelingTest`
.. ------------------------------------ ..
.. _section_ref_algorithm_ReducedModelingTest_examples:
+.. include:: snippets/Header2Algo09.rst
+
+.. --------- ..
+.. include:: scripts/simple_ReducedModelingTest1.rst
+
+.. literalinclude:: scripts/simple_ReducedModelingTest1.py
+
+.. include:: snippets/Header2Algo10.rst
+
+.. literalinclude:: scripts/simple_ReducedModelingTest1.res
+ :language: none
+
+.. include:: snippets/Header2Algo11.rst
+
+.. _simple_ReducedModelingTest1:
+.. image:: scripts/simple_ReducedModelingTest1.png
+ :align: center
+ :width: 90%
+
+.. ------------------------------------ ..
.. include:: snippets/Header2Algo06.rst
- :ref:`section_ref_algorithm_FunctionTest`
ref_algorithm_FunctionTest
ref_algorithm_GradientTest
ref_algorithm_InputValuesTest
+ ref_algorithm_InterpolationByReducedModelTest
ref_algorithm_LinearityTest
ref_algorithm_LocalSensitivityTest
ref_algorithm_ObservationSimulationComparisonTest
--- /dev/null
+# -*- coding: utf-8 -*-
+#
+import numpy
+from adao import adaoBuilder
+numpy.random.seed(123456789)
+#
+dimension = 100
+nbsnapshots = 15
+Ensemble = numpy.empty((dimension,2*nbsnapshots))
+for i in range(nbsnapshots):
+ Ensemble[:,i] = numpy.sin((i+1)*numpy.arange(dimension))
+Ensemble[:,nbsnapshots:2*nbsnapshots] = Ensemble[:,:nbsnapshots]
+#
+case = adaoBuilder.New()
+case.setAlgorithmParameters(
+ Algorithm = 'ReducedModelingTest',
+ Parameters = {
+ "EnsembleOfSnapshots":Ensemble,
+ "StoreSupplementaryCalculations":["Residus","SingularValues"],
+ "PlotAndSave":True,
+ "ResultFile":"simple_ReducedModelingTest1.png",
+ }
+ )
+case.execute()
--- /dev/null
+
+ REDUCEDMODELINGTEST
+ ===================
+
+ This test allows to analyze the characteristics of the collection of
+ states from a reduction point of view. Using an SVD, it measures how
+ the information decreases with the number of singular values, either
+ as values or, with a statistical point of view, as remaining variance.
+
+===> Information before launching:
+ -----------------------------
+
+ Characteristics of input data:
+ State dimension................: 100
+ Number of snapshots to test....: 30
+
+===> Summary of the 5 first singular values:
+ ---------------------------------------
+
+ Singular values σ:
+ σ[1] = 1.03513e+01
+ σ[2] = 1.03509e+01
+ σ[3] = 1.03258e+01
+ σ[4] = 1.02436e+01
+ σ[5] = 1.02386e+01
+
+ Singular values σ divided by the first one σ[1]:
+ σ[1] / σ[1] = 1.00000e+00
+ σ[2] / σ[1] = 9.99962e-01
+ σ[3] / σ[1] = 9.97533e-01
+ σ[4] / σ[1] = 9.89589e-01
+ σ[5] / σ[1] = 9.89104e-01
+
+===> Ordered singular values and remaining variance:
+ -----------------------------------------------
+
+ -------------------------------------------------------------------------
+ i | Singular value σ | σ[i]/σ[1] | Variance: part, remaining
+ -------------------------------------------------------------------------
+ 00 | 1.03513e+01 | 1.00000e+00 | 7% , 92.8%
+ 01 | 1.03509e+01 | 9.99962e-01 | 7% , 85.6%
+ 02 | 1.03258e+01 | 9.97533e-01 | 7% , 78.5%
+ 03 | 1.02436e+01 | 9.89589e-01 | 7% , 71.5%
+ 04 | 1.02386e+01 | 9.89104e-01 | 7% , 64.4%
+ 05 | 1.01050e+01 | 9.76200e-01 | 6% , 57.6%
+ 06 | 9.99948e+00 | 9.66009e-01 | 6% , 50.9%
+ 07 | 9.99643e+00 | 9.65714e-01 | 6% , 44.2%
+ 08 | 9.98375e+00 | 9.64489e-01 | 6% , 37.5%
+ 09 | 9.90828e+00 | 9.57198e-01 | 6% , 31.0%
+ 10 | 9.90691e+00 | 9.57066e-01 | 6% , 24.4%
+ 11 | 9.64803e+00 | 9.32056e-01 | 6% , 18.1%
+ 12 | 9.62587e+00 | 9.29916e-01 | 6% , 11.9%
+ 13 | 9.62344e+00 | 9.29681e-01 | 6% , 5.7%
+ 14 | 9.25446e+00 | 8.94035e-01 | 5% , 0.0%
+ 15 | 2.41400e-15 | 2.33206e-16 | 0% , 0.0%
+ 16 | 1.94612e-15 | 1.88006e-16 | 0% , 0.0%
+ 17 | 1.61527e-15 | 1.56044e-16 | 0% , 0.0%
+ 18 | 1.54864e-15 | 1.49608e-16 | 0% , 0.0%
+ 19 | 1.35243e-15 | 1.30653e-16 | 0% , 0.0%
+ 20 | 1.11119e-15 | 1.07347e-16 | 0% , 0.0%
+ 21 | 1.05852e-15 | 1.02260e-16 | 0% , 0.0%
+ 22 | 9.68764e-16 | 9.35883e-17 | 0% , 0.0%
+ 23 | 8.82878e-16 | 8.52912e-17 | 0% , 0.0%
+ 24 | 6.53296e-16 | 6.31122e-17 | 0% , 0.0%
+ 25 | 5.21872e-16 | 5.04159e-17 | 0% , 0.0%
+ 26 | 4.98146e-16 | 4.81238e-17 | 0% , 0.0%
+ 27 | 3.74898e-16 | 3.62173e-17 | 0% , 0.0%
+ 28 | 2.79953e-16 | 2.70452e-17 | 0% , 0.0%
+ 29 | 1.99083e-16 | 1.92326e-17 | 0% , 0.0%
+ -------------------------------------------------------------------------
+
+===> Summary of variance cut-off:
+ ----------------------------
+ Representing more than 90% of variance requires at least 14 mode(s).
+ Representing more than 99% of variance requires at least 15 mode(s).
+ Representing more than 99.9% of variance requires at least 15 mode(s).
+ Representing more than 99.99% of variance requires at least 15 mode(s).
+
+ Plot and save results in a file named "simple_ReducedModelingTest1.png"
+
+ ---------------------------------------------------------------------------
+
+ End of the "REDUCEDMODELINGTEST" verification
+
+ ---------------------------------------------------------------------------
+
--- /dev/null
+.. index:: single: ReducedModelingTest (exemple)
+
+First example
+.............
+
+This example describes the reducibility characteristics of the set of states
+(“*snapshots*”) under study. The set considered is first composed of 15 sine
+calculations on a sequence of integers (so the space generated by the snapshots
+is linearly non-decomposable) and these 15 snapshots are then duplicated once
+to obtain a reduced space of size exactly 15 (since the last 15 are identical
+to the first 15). All the variance is thus explained by the first 15 modes,
+numbered from 0 to 14, and the following singular values are close to numerical
+zero.
--- /dev/null
+.. index:: single: MeasurementLocations
+
+MeasurementLocations
+ *Integer series*. This series contains the indices of the positions at which
+ a measurement is required to support a reduced basis interpolation, according
+ to the order of the variables of a state vector arbitrarily considered in
+ one-dimensional form, and in the same order as the information contained in
+ the vectors of the reduced basis.
+
+ This is similar to the set of optimal positions or points resulting from a
+ :ref:`section_ref_algorithm_MeasurementsOptimalPositioningTask`, or the set
+ of positions required to run a
+ :ref:`section_ref_algorithm_InterpolationByReducedModelTask`.
EFICAS, |release|
SALOME, |release|
Python, 3.9.2
- Numpy, 1.19.5
+ Numpy, 1.20.3
Scipy, 1.6.0
MatplotLib, 3.3.4
Gnuplot, 1.8
#. :ref:`Exemples de vérification avec "FunctionTest"<section_ref_algorithm_FunctionTest_examples>`
#. :ref:`Exemples de vérification avec "ObservationSimulationComparisonTest"<section_ref_algorithm_ObservationSimulationComparisonTest_examples>`
#. :ref:`Exemples de vérification avec "ParallelFunctionTest"<section_ref_algorithm_ParallelFunctionTest_examples>`
+#. :ref:`Exemples de vérification avec "ReducedModelingTest"<section_ref_algorithm_ReducedModelingTest_examples>`
Utilisations d'algorithmes orientés tâches ou études dédiées
------------------------------------------------------------
--- /dev/null
+..
+ Copyright (C) 2008-2024 EDF R&D
+
+ This file is part of SALOME ADAO module.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+ Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
+
+.. index:: single: InterpolationByReducedModelTest
+.. _section_ref_algorithm_InterpolationByReducedModelTest:
+
+Algorithme de vérification "*InterpolationByReducedModelTest*"
+--------------------------------------------------------------
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo01.rst
+
+Cet algorithme permet d'analyser de manière simple la qualité de
+l'interpolation empirique des états obtenue par une base réduite, en utilisant
+des mesures en des points précis.
+
+Les résultats affichés par défaut sont des statistiques simples liées aux
+erreurs normalisées de l'interpolation avec une base réduite. Le test utilise
+une base réduite et un ensemble de positions de mesures optimales, et utilise
+des pseudo-mesures provenant de chaque état complet ("*snapshot*") inclus dans
+l'ensemble de test donné.
+
+Attention : pour être cohérent, ce test doit utiliser la même norme
+mathématique que celle utilisée pour construire la base réduite. La norme étant
+choisie par l'utilisateur lors de la définition du test, il faut vérifier la
+norme de construction de la base réduite.
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo12.rst
+
+.. include:: snippets/FeaturePropDerivativeFree.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo02.rst
+
+.. include:: snippets/EnsembleOfSnapshots.rst
+
+.. include:: snippets/MeasurementLocations.rst
+
+.. include:: snippets/ReducedBasis.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo03Chck.rst
+
+.. include:: snippets/ErrorNorm.rst
+
+.. include:: snippets/NumberOfPrintedDigits.rst
+
+.. include:: snippets/ShowElementarySummary.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo04.rst
+
+.. include:: snippets/NoUnconditionalOutput.rst
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo05.rst
+
+.. include:: snippets/NoConditionalOutput.rst
+
+.. ------------------------------------ ..
+.. _section_ref_algorithm_InterpolationByReducedModelTest_examples:
+
+.. ------------------------------------ ..
+.. include:: snippets/Header2Algo06.rst
+
+- :ref:`section_ref_algorithm_InterpolationByReducedModelTask`
+- :ref:`section_ref_algorithm_MeasurementsOptimalPositioningTask`
+- :ref:`section_ref_algorithm_ReducedModelingTest`
.. ------------------------------------ ..
.. _section_ref_algorithm_ReducedModelingTest_examples:
+.. include:: snippets/Header2Algo09.rst
+
+.. --------- ..
+.. include:: scripts/simple_ReducedModelingTest1.rst
+
+.. literalinclude:: scripts/simple_ReducedModelingTest1.py
+
+.. include:: snippets/Header2Algo10.rst
+
+.. literalinclude:: scripts/simple_ReducedModelingTest1.res
+ :language: none
+
+.. include:: snippets/Header2Algo11.rst
+
+.. _simple_ReducedModelingTest1:
+.. image:: scripts/simple_ReducedModelingTest1.png
+ :align: center
+ :width: 90%
+
+.. ------------------------------------ ..
.. include:: snippets/Header2Algo06.rst
- :ref:`section_ref_algorithm_FunctionTest`
ref_algorithm_FunctionTest
ref_algorithm_GradientTest
ref_algorithm_InputValuesTest
+ ref_algorithm_InterpolationByReducedModelTest
ref_algorithm_LinearityTest
ref_algorithm_LocalSensitivityTest
ref_algorithm_ObservationSimulationComparisonTest
--- /dev/null
+# -*- coding: utf-8 -*-
+#
+import numpy
+from adao import adaoBuilder
+numpy.random.seed(123456789)
+#
+dimension = 100
+nbsnapshots = 15
+Ensemble = numpy.empty((dimension,2*nbsnapshots))
+for i in range(nbsnapshots):
+ Ensemble[:,i] = numpy.sin((i+1)*numpy.arange(dimension))
+Ensemble[:,nbsnapshots:2*nbsnapshots] = Ensemble[:,:nbsnapshots]
+#
+case = adaoBuilder.New()
+case.setAlgorithmParameters(
+ Algorithm = 'ReducedModelingTest',
+ Parameters = {
+ "EnsembleOfSnapshots":Ensemble,
+ "StoreSupplementaryCalculations":["Residus","SingularValues"],
+ "PlotAndSave":True,
+ "ResultFile":"simple_ReducedModelingTest1.png",
+ }
+ )
+case.execute()
--- /dev/null
+
+ REDUCEDMODELINGTEST
+ ===================
+
+ This test allows to analyze the characteristics of the collection of
+ states from a reduction point of view. Using an SVD, it measures how
+ the information decreases with the number of singular values, either
+ as values or, with a statistical point of view, as remaining variance.
+
+===> Information before launching:
+ -----------------------------
+
+ Characteristics of input data:
+ State dimension................: 100
+ Number of snapshots to test....: 30
+
+===> Summary of the 5 first singular values:
+ ---------------------------------------
+
+ Singular values σ:
+ σ[1] = 1.03513e+01
+ σ[2] = 1.03509e+01
+ σ[3] = 1.03258e+01
+ σ[4] = 1.02436e+01
+ σ[5] = 1.02386e+01
+
+ Singular values σ divided by the first one σ[1]:
+ σ[1] / σ[1] = 1.00000e+00
+ σ[2] / σ[1] = 9.99962e-01
+ σ[3] / σ[1] = 9.97533e-01
+ σ[4] / σ[1] = 9.89589e-01
+ σ[5] / σ[1] = 9.89104e-01
+
+===> Ordered singular values and remaining variance:
+ -----------------------------------------------
+
+ -------------------------------------------------------------------------
+ i | Singular value σ | σ[i]/σ[1] | Variance: part, remaining
+ -------------------------------------------------------------------------
+ 00 | 1.03513e+01 | 1.00000e+00 | 7% , 92.8%
+ 01 | 1.03509e+01 | 9.99962e-01 | 7% , 85.6%
+ 02 | 1.03258e+01 | 9.97533e-01 | 7% , 78.5%
+ 03 | 1.02436e+01 | 9.89589e-01 | 7% , 71.5%
+ 04 | 1.02386e+01 | 9.89104e-01 | 7% , 64.4%
+ 05 | 1.01050e+01 | 9.76200e-01 | 6% , 57.6%
+ 06 | 9.99948e+00 | 9.66009e-01 | 6% , 50.9%
+ 07 | 9.99643e+00 | 9.65714e-01 | 6% , 44.2%
+ 08 | 9.98375e+00 | 9.64489e-01 | 6% , 37.5%
+ 09 | 9.90828e+00 | 9.57198e-01 | 6% , 31.0%
+ 10 | 9.90691e+00 | 9.57066e-01 | 6% , 24.4%
+ 11 | 9.64803e+00 | 9.32056e-01 | 6% , 18.1%
+ 12 | 9.62587e+00 | 9.29916e-01 | 6% , 11.9%
+ 13 | 9.62344e+00 | 9.29681e-01 | 6% , 5.7%
+ 14 | 9.25446e+00 | 8.94035e-01 | 5% , 0.0%
+ 15 | 2.41400e-15 | 2.33206e-16 | 0% , 0.0%
+ 16 | 1.94612e-15 | 1.88006e-16 | 0% , 0.0%
+ 17 | 1.61527e-15 | 1.56044e-16 | 0% , 0.0%
+ 18 | 1.54864e-15 | 1.49608e-16 | 0% , 0.0%
+ 19 | 1.35243e-15 | 1.30653e-16 | 0% , 0.0%
+ 20 | 1.11119e-15 | 1.07347e-16 | 0% , 0.0%
+ 21 | 1.05852e-15 | 1.02260e-16 | 0% , 0.0%
+ 22 | 9.68764e-16 | 9.35883e-17 | 0% , 0.0%
+ 23 | 8.82878e-16 | 8.52912e-17 | 0% , 0.0%
+ 24 | 6.53296e-16 | 6.31122e-17 | 0% , 0.0%
+ 25 | 5.21872e-16 | 5.04159e-17 | 0% , 0.0%
+ 26 | 4.98146e-16 | 4.81238e-17 | 0% , 0.0%
+ 27 | 3.74898e-16 | 3.62173e-17 | 0% , 0.0%
+ 28 | 2.79953e-16 | 2.70452e-17 | 0% , 0.0%
+ 29 | 1.99083e-16 | 1.92326e-17 | 0% , 0.0%
+ -------------------------------------------------------------------------
+
+===> Summary of variance cut-off:
+ ----------------------------
+ Representing more than 90% of variance requires at least 14 mode(s).
+ Representing more than 99% of variance requires at least 15 mode(s).
+ Representing more than 99.9% of variance requires at least 15 mode(s).
+ Representing more than 99.99% of variance requires at least 15 mode(s).
+
+ Plot and save results in a file named "simple_ReducedModelingTest1.png"
+
+ ---------------------------------------------------------------------------
+
+ End of the "REDUCEDMODELINGTEST" verification
+
+ ---------------------------------------------------------------------------
+
--- /dev/null
+.. index:: single: ReducedModelingTest (exemple)
+
+Premier exemple
+...............
+
+Cet exemple décrit les caractéristiques de réductibilité de l'ensemble d'états
+("*snapshots*") étudié. Cet ensemble considéré est d'abord composé de 15
+calculs de sinus sur un suite d'entiers (donc l'espace engendré par les
+snapshots est non décomposable linéairement) et ces 15 snapshots sont ensuite
+dupliqués une fois pour avoir un espace réduit de taille exactement 15 (puisque
+les 15 derniers sont identiques aux 15 premiers). La totalité de la variance
+est ainsi expliquée par les 15 premiers modes, numérotés de 0 à 14, et les
+valeurs singulières suivantes sont proches du zéro numérique.
--- /dev/null
+.. index:: single: MeasurementLocations
+
+MeasurementLocations
+ *Série d'entiers*. Cette série contient les indices des positions auxquelles
+ une mesure est requise pour accompagner une interpolation par base réduite,
+ selon l'ordre des variables d'un vecteur d'état considéré arbitrairement sous
+ forme unidimensionnelle, et dans le même ordre que les informations contenues
+ dans les vecteurs de la base réduite.
+
+ Elle est semblable à la série de positions ou points optimaux issue d'un
+ :ref:`section_ref_algorithm_MeasurementsOptimalPositioningTask`, ou la série
+ de positions nécessaires à exécuter un
+ :ref:`section_ref_algorithm_InterpolationByReducedModelTask`.
EFICAS, |release|
SALOME, |release|
Python, 3.9.2
- Numpy, 1.19.5
+ Numpy, 1.20.3
Scipy, 1.6.0
MatplotLib, 3.3.4
Gnuplot, 1.8
else:
Un = None
#
- Hm = HO["Direct"].appliedControledFormTo
- if selfA._parameters["EstimationOf"] == "State":
- Mm = EM["Direct"].appliedControledFormTo
if CM is not None and "Tangent" in CM and U is not None:
Cm = CM["Tangent"].asMatrix(Xn)
else:
Xnmu[:, point] = ApplyBounds( Xnmu[:, point], selfA._parameters["Bounds"] )
#
if selfA._parameters["EstimationOf"] == "State":
+ Mm = EM["Direct"].appliedControledFormTo
XEnnmu = Mm( [(Xnmu[:, point].reshape((-1, 1)), Un) for point in range(nbSpts)],
argsAsSerie = True,
returnSerieAsArrayMatrix = True )
for point in range(nbSpts):
Xnnmu[:, point] = ApplyBounds( Xnnmu[:, point], selfA._parameters["Bounds"] )
#
+ Hm = HO["Direct"].appliedControledFormTo
Ynnmu = Hm( [(Xnnmu[:, point], None) for point in range(nbSpts)],
argsAsSerie = True,
returnSerieAsArrayMatrix = True )
else:
Un = None
#
- Hm = HO["Direct"].appliedControledFormTo
- if selfA._parameters["EstimationOf"] == "State":
- Mm = EM["Direct"].appliedControledFormTo
if CM is not None and "Tangent" in CM and U is not None:
Cm = CM["Tangent"].asMatrix(Xn)
else:
nbSpts = SC.shape[1]
#
if selfA._parameters["EstimationOf"] == "State":
+ Mm = EM["Direct"].appliedControledFormTo
XEnnmu = Mm( [(Xnmu[:, point].reshape((-1, 1)), Un) for point in range(nbSpts)],
argsAsSerie = True,
returnSerieAsArrayMatrix = True )
Pmndemi = numpy.real(scipy.linalg.sqrtm(Pmn))
Xnnmu = Xhmn.reshape((-1, 1)) + Pmndemi @ SC
#
+ Hm = HO["Direct"].appliedControledFormTo
Ynnmu = Hm( [(Xnnmu[:, point], None) for point in range(nbSpts)],
argsAsSerie = True,
returnSerieAsArrayMatrix = True )
msgs += ("\n")
msgs += (__flech + "Ordered singular values and remaining variance:\n")
msgs += (__marge + "-----------------------------------------------\n")
- __entete = (" %" + str(__ordre) + "s | %22s | %22s | Variance: part, remaining")%("i", "Singular value σ", "σ[i]/σ[1]") # noqa: E501
+ __entete = (" %" + str(__ordre) + "s | %16s | %16s | Variance: part, remaining")%("i", "Singular value σ", "σ[i]/σ[1]") # noqa: E501
#
__nbtirets = len(__entete) + 2
msgs += "\n" + __marge + "-" * __nbtirets
vsinfo = 100 * __tisv[ns]
rsinfo = max(100 * __qisv[ns], 0.)
if __s:
- msgs += (__marge + " %0" + str(__ordre) + "i | %22." + str(__p) + "e | %22." + str(__p) + "e | %2i%s , %4.1f%s\n")%(ns, svalue, rvalue, vsinfo, "%", rsinfo, "%") # noqa: E501
+ msgs += (__marge + " %0" + str(__ordre) + "i | %16." + str(__p) + "e | %16." + str(__p) + "e | %2i%s , %4.1f%s\n")%(ns, svalue, rvalue, vsinfo, "%", rsinfo, "%") # noqa: E501
if rsinfo > 10:
cut1pd = ns + 2 # 10%
if rsinfo > 1:
if __CovForecast:
Mt = EM["Tangent"].asMatrix(Xn)
Mt = Mt.reshape(Xn.size, Xn.size) # ADAO & check shape
- if __CovForecast:
Ma = EM["Adjoint"].asMatrix(Xn)
Ma = Ma.reshape(Xn.size, Xn.size) # ADAO & check shape
Pn_predicted = Q + Mt @ (Pn @ Ma)
- M = EM["Direct"].appliedControledFormTo
- Xn_predicted = M( (Xn, Un) ).reshape((-1, 1))
+ Mm = EM["Direct"].appliedControledFormTo
+ Xn_predicted = Mm( (Xn, Un) ).reshape((-1, 1))
if CM is not None and "Tangent" in CM and Un is not None: # Attention : si Cm est aussi dans M, doublon !
Cm = CM["Tangent"].asMatrix(Xn_predicted)
Cm = Cm.reshape(Xn.size, Un.size) # ADAO & check shape