From: Jean-Philippe ARGAUD Date: Fri, 24 May 2024 18:58:10 +0000 (+0200) Subject: Documentation corrections and update X-Git-Tag: V9_13_0a1~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b965d211538313afe898dc38365b91256bb1e952;p=modules%2Fadao.git Documentation corrections and update --- diff --git a/doc/en/examples.rst b/doc/en/examples.rst index 196d7d5..6cd8b44 100644 --- a/doc/en/examples.rst +++ b/doc/en/examples.rst @@ -60,6 +60,7 @@ Checking algorithms uses #. :ref:`Examples with the "FunctionTest" check` #. :ref:`Examples with the "ObservationSimulationComparisonTest" check` #. :ref:`Examples with the "ParallelFunctionTest" check` +#. :ref:`Examples with the "ReducedModelingTest" check` Dedicated tasks or study oriented cases uses -------------------------------------------- diff --git a/doc/en/ref_algorithm_InterpolationByReducedModelTest.rst b/doc/en/ref_algorithm_InterpolationByReducedModelTest.rst new file mode 100644 index 0000000..f6c55eb --- /dev/null +++ b/doc/en/ref_algorithm_InterpolationByReducedModelTest.rst @@ -0,0 +1,89 @@ +.. + 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` diff --git a/doc/en/ref_algorithm_ReducedModelingTest.rst b/doc/en/ref_algorithm_ReducedModelingTest.rst index a509934..6fcce11 100644 --- a/doc/en/ref_algorithm_ReducedModelingTest.rst +++ b/doc/en/ref_algorithm_ReducedModelingTest.rst @@ -126,6 +126,26 @@ StoreSupplementaryCalculations .. ------------------------------------ .. .. _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` diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 6b7b673..d0be7a1 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -142,6 +142,7 @@ providing :ref:`section_theory`. ref_algorithm_FunctionTest ref_algorithm_GradientTest ref_algorithm_InputValuesTest + ref_algorithm_InterpolationByReducedModelTest ref_algorithm_LinearityTest ref_algorithm_LocalSensitivityTest ref_algorithm_ObservationSimulationComparisonTest diff --git a/doc/en/scripts/simple_ReducedModelingTest1.png b/doc/en/scripts/simple_ReducedModelingTest1.png new file mode 100644 index 0000000..03662e7 Binary files /dev/null and b/doc/en/scripts/simple_ReducedModelingTest1.png differ diff --git a/doc/en/scripts/simple_ReducedModelingTest1.py b/doc/en/scripts/simple_ReducedModelingTest1.py new file mode 100644 index 0000000..a8f9bda --- /dev/null +++ b/doc/en/scripts/simple_ReducedModelingTest1.py @@ -0,0 +1,24 @@ +# -*- 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() diff --git a/doc/en/scripts/simple_ReducedModelingTest1.res b/doc/en/scripts/simple_ReducedModelingTest1.res new file mode 100644 index 0000000..119f6a7 --- /dev/null +++ b/doc/en/scripts/simple_ReducedModelingTest1.res @@ -0,0 +1,86 @@ + + 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 + + --------------------------------------------------------------------------- + diff --git a/doc/en/scripts/simple_ReducedModelingTest1.rst b/doc/en/scripts/simple_ReducedModelingTest1.rst new file mode 100644 index 0000000..0f4ebfb --- /dev/null +++ b/doc/en/scripts/simple_ReducedModelingTest1.rst @@ -0,0 +1,13 @@ +.. 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. diff --git a/doc/en/snippets/MeasurementLocations.rst b/doc/en/snippets/MeasurementLocations.rst new file mode 100644 index 0000000..0fb520f --- /dev/null +++ b/doc/en/snippets/MeasurementLocations.rst @@ -0,0 +1,13 @@ +.. 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`. diff --git a/doc/en/snippets/ModuleValidation.rst b/doc/en/snippets/ModuleValidation.rst index be79221..4ef9258 100644 --- a/doc/en/snippets/ModuleValidation.rst +++ b/doc/en/snippets/ModuleValidation.rst @@ -13,7 +13,7 @@ purposes only, knowing that, in case of doubt, the SALOME version sheet 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 diff --git a/doc/en/snippets/NoConditionalOutput.rst b/doc/en/snippets/NoConditionalOutput.rst new file mode 100644 index 0000000..6bd824c --- /dev/null +++ b/doc/en/snippets/NoConditionalOutput.rst @@ -0,0 +1 @@ + *None* diff --git a/doc/fr/examples.rst b/doc/fr/examples.rst index f12f2af..076f5f3 100644 --- a/doc/fr/examples.rst +++ b/doc/fr/examples.rst @@ -60,6 +60,7 @@ Utilisations d'algorithmes de vérification #. :ref:`Exemples de vérification avec "FunctionTest"` #. :ref:`Exemples de vérification avec "ObservationSimulationComparisonTest"` #. :ref:`Exemples de vérification avec "ParallelFunctionTest"` +#. :ref:`Exemples de vérification avec "ReducedModelingTest"` Utilisations d'algorithmes orientés tâches ou études dédiées ------------------------------------------------------------ diff --git a/doc/fr/ref_algorithm_InterpolationByReducedModelTest.rst b/doc/fr/ref_algorithm_InterpolationByReducedModelTest.rst new file mode 100644 index 0000000..1b4831e --- /dev/null +++ b/doc/fr/ref_algorithm_InterpolationByReducedModelTest.rst @@ -0,0 +1,89 @@ +.. + 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` diff --git a/doc/fr/ref_algorithm_ReducedModelingTest.rst b/doc/fr/ref_algorithm_ReducedModelingTest.rst index de02d18..431e5b1 100644 --- a/doc/fr/ref_algorithm_ReducedModelingTest.rst +++ b/doc/fr/ref_algorithm_ReducedModelingTest.rst @@ -128,6 +128,26 @@ StoreSupplementaryCalculations .. ------------------------------------ .. .. _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` diff --git a/doc/fr/reference.rst b/doc/fr/reference.rst index a703cfb..4564014 100644 --- a/doc/fr/reference.rst +++ b/doc/fr/reference.rst @@ -144,6 +144,7 @@ section générale donnant :ref:`section_theory`. ref_algorithm_FunctionTest ref_algorithm_GradientTest ref_algorithm_InputValuesTest + ref_algorithm_InterpolationByReducedModelTest ref_algorithm_LinearityTest ref_algorithm_LocalSensitivityTest ref_algorithm_ObservationSimulationComparisonTest diff --git a/doc/fr/scripts/simple_ReducedModelingTest1.png b/doc/fr/scripts/simple_ReducedModelingTest1.png new file mode 100644 index 0000000..03662e7 Binary files /dev/null and b/doc/fr/scripts/simple_ReducedModelingTest1.png differ diff --git a/doc/fr/scripts/simple_ReducedModelingTest1.py b/doc/fr/scripts/simple_ReducedModelingTest1.py new file mode 100644 index 0000000..a8f9bda --- /dev/null +++ b/doc/fr/scripts/simple_ReducedModelingTest1.py @@ -0,0 +1,24 @@ +# -*- 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() diff --git a/doc/fr/scripts/simple_ReducedModelingTest1.res b/doc/fr/scripts/simple_ReducedModelingTest1.res new file mode 100644 index 0000000..119f6a7 --- /dev/null +++ b/doc/fr/scripts/simple_ReducedModelingTest1.res @@ -0,0 +1,86 @@ + + 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 + + --------------------------------------------------------------------------- + diff --git a/doc/fr/scripts/simple_ReducedModelingTest1.rst b/doc/fr/scripts/simple_ReducedModelingTest1.rst new file mode 100644 index 0000000..f07c4eb --- /dev/null +++ b/doc/fr/scripts/simple_ReducedModelingTest1.rst @@ -0,0 +1,13 @@ +.. 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. diff --git a/doc/fr/snippets/MeasurementLocations.rst b/doc/fr/snippets/MeasurementLocations.rst new file mode 100644 index 0000000..8e97457 --- /dev/null +++ b/doc/fr/snippets/MeasurementLocations.rst @@ -0,0 +1,13 @@ +.. 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`. diff --git a/doc/fr/snippets/ModuleValidation.rst b/doc/fr/snippets/ModuleValidation.rst index d4dcb08..55e2e02 100644 --- a/doc/fr/snippets/ModuleValidation.rst +++ b/doc/fr/snippets/ModuleValidation.rst @@ -13,7 +13,7 @@ uniquement sachant que, en cas de doute, c'est la fiche de version de SALOME 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 diff --git a/doc/fr/snippets/NoConditionalOutput.rst b/doc/fr/snippets/NoConditionalOutput.rst new file mode 100644 index 0000000..7edf811 --- /dev/null +++ b/doc/fr/snippets/NoConditionalOutput.rst @@ -0,0 +1 @@ + *Aucune* diff --git a/src/daComposant/daAlgorithms/Atoms/ecw2ukf.py b/src/daComposant/daAlgorithms/Atoms/ecw2ukf.py index f935804..e5ea58e 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecw2ukf.py +++ b/src/daComposant/daAlgorithms/Atoms/ecw2ukf.py @@ -101,9 +101,6 @@ def ecw2ukf(selfA, Xb, Y, U, HO, EM, CM, R, B, Q, VariantM="UKF"): 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: @@ -118,6 +115,7 @@ def ecw2ukf(selfA, Xb, Y, U, HO, EM, CM, R, B, Q, VariantM="UKF"): 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 ) @@ -152,6 +150,7 @@ def ecw2ukf(selfA, Xb, Y, U, HO, EM, CM, R, B, Q, VariantM="UKF"): 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 ) diff --git a/src/daComposant/daAlgorithms/Atoms/ecwukf.py b/src/daComposant/daAlgorithms/Atoms/ecwukf.py index 465168d..a100e8e 100644 --- a/src/daComposant/daAlgorithms/Atoms/ecwukf.py +++ b/src/daComposant/daAlgorithms/Atoms/ecwukf.py @@ -99,9 +99,6 @@ def ecwukf(selfA, Xb, Y, U, HO, EM, CM, R, B, Q, VariantM="UKF"): 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: @@ -112,6 +109,7 @@ def ecwukf(selfA, Xb, Y, U, HO, EM, CM, R, B, Q, VariantM="UKF"): 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 ) @@ -135,6 +133,7 @@ def ecwukf(selfA, Xb, Y, U, HO, EM, CM, R, B, Q, VariantM="UKF"): 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 ) diff --git a/src/daComposant/daAlgorithms/ReducedModelingTest.py b/src/daComposant/daAlgorithms/ReducedModelingTest.py index 14536e0..d94faf4 100644 --- a/src/daComposant/daAlgorithms/ReducedModelingTest.py +++ b/src/daComposant/daAlgorithms/ReducedModelingTest.py @@ -276,7 +276,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): 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 @@ -291,7 +291,7 @@ class ElementaryAlgorithm(BasicObjects.Algorithm): 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: diff --git a/src/daComposant/daCore/NumericObjects.py b/src/daComposant/daCore/NumericObjects.py index cafe15d..dc72f85 100644 --- a/src/daComposant/daCore/NumericObjects.py +++ b/src/daComposant/daCore/NumericObjects.py @@ -1503,12 +1503,11 @@ def multiXOsteps( 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