Salome HOME
Documentation corrections and modular evolution (3 EN)
[modules/adao.git] / doc / en / ref_algorithm_LinearityTest.rst
1 ..
2    Copyright (C) 2008-2018 EDF R&D
3
4    This file is part of SALOME ADAO module.
5
6    This library is free software; you can redistribute it and/or
7    modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    This library is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with this library; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19
20    See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21
22    Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
23
24 .. index:: single: LinearityTest
25 .. _section_ref_algorithm_LinearityTest:
26
27 Checking algorithm "*LinearityTest*"
28 ------------------------------------
29
30 Description
31 +++++++++++
32
33 This algorithm allows to check the linear quality of the operator, by
34 calculating a residue with known theoretical properties. Different residue
35 formula are available.
36
37 In any cases, one take :math:`\mathbf{dx}_0=Normal(0,\mathbf{x})` and
38 :math:`\mathbf{dx}=\alpha*\mathbf{dx}_0`. :math:`F` is the calculation code.
39
40 "CenteredDL" residue
41 ********************
42
43 One observe the following residue, coming from the centered difference of the
44 :math:`F` values at nominal point and at perturbed points, normalized by the
45 value at the nominal point:
46
47 .. math:: R(\alpha) = \frac{|| F(\mathbf{x}+\alpha*\mathbf{dx}) + F(\mathbf{x}-\alpha*\mathbf{dx}) - 2*F(\mathbf{x}) ||}{|| F(\mathbf{x}) ||}
48
49 If it stays constantly really small with respect to 1, the linearity hypothesis
50 of :math:`F` is verified.
51
52 If the residue is varying, or if it is of order 1 or more, and it is small only
53 at a certain order of increment, the linearity hypothesis of :math:`F` is not
54 verified.
55
56 If the residue is decreasing and the decrease change in :math:`\alpha^2` with
57 respect to :math:`\alpha`, it signifies that the gradient is correctly
58 calculated until the stopping level of the quadratic decrease.
59
60 "Taylor" residue
61 ****************
62
63 One observe the residue coming from the Taylor development of the :math:`F`
64 function, normalized by the value at the nominal point:
65
66 .. math:: R(\alpha) = \frac{|| F(\mathbf{x}+\alpha*\mathbf{dx}) - F(\mathbf{x}) - \alpha * \nabla_xF(\mathbf{dx}) ||}{|| F(\mathbf{x}) ||}
67
68 If it stay constantly really small with respect to 1, the linearity hypothesis
69 of :math:`F` is verified.
70
71 If the residue is varying, or if it is of order 1 or more, and it is small only
72 at a certain order of increment, the linearity hypothesis of :math:`F` is not
73 verified.
74
75 If the residue is decreasing and the decrease change in :math:`\alpha^2` with
76 respect to :math:`\alpha`, it signifies that the gradient is correctly
77 calculated until the stopping level of the quadratic decrease.
78
79 "NominalTaylor" residue
80 ***********************
81
82 One observe the residue build from two approximations of order 1 of
83 :math:`F(\mathbf{x})`, normalized by the value at the nominal point:
84
85 .. math:: R(\alpha) = \max(|| F(\mathbf{x}+\alpha*\mathbf{dx}) - \alpha * F(\mathbf{dx}) || / || F(\mathbf{x}) ||,|| F(\mathbf{x}-\alpha*\mathbf{dx}) + \alpha * F(\mathbf{dx}) || / || F(\mathbf{x}) ||)
86
87 If the residue stays constant equal to 1 at less than 2 or 3 percents (that that
88 :math:`|R-1|` stays equal to 2 or 3 percents), the linearity hypothesis of
89 :math:`F` is verified.
90
91 If it is equal to 1 only on part of the variation domain of increment
92 :math:`\alpha`, it is on this sub-domain that the linearity hypothesis of
93 :math:`F` is verified.
94
95 "NominalTaylorRMS" residue
96 **************************
97
98 One observe the residue build from two approximations of order 1 of
99 :math:`F(\mathbf{x})`, normalized by the value at the nominal point, on which
100 one estimate the quadratic root mean square (RMS) with the value at the nominal
101 point:
102
103 .. math:: R(\alpha) = \max(RMS( F(\mathbf{x}), F(\mathbf{x}+\alpha*\mathbf{dx}) - \alpha * F(\mathbf{dx}) ) / || F(\mathbf{x}) ||,RMS( F(\mathbf{x}), F(\mathbf{x}-\alpha*\mathbf{dx}) + \alpha * F(\mathbf{dx}) ) / || F(\mathbf{x}) ||)
104
105 If it stay constantly equal to 0 at less than 1 or 2 percents, the linearity
106 hypothesis of :math:`F` is verified.
107
108 If it is equal to 0 only on part of the variation domain of increment
109 :math:`\alpha`, it is on this sub-domain that the linearity hypothesis of
110 :math:`F` is verified.
111
112 Optional and required commands
113 ++++++++++++++++++++++++++++++
114
115 The general required commands, available in the editing user interface, are the
116 following:
117
118   .. include:: snippets/CheckingPoint.rst
119
120   .. include:: snippets/ObservationOperator.rst
121
122 The general optional commands, available in the editing user interface, are
123 indicated in :ref:`section_ref_assimilation_keywords`. Moreover, the parameters
124 of the command "*AlgorithmParameters*" allow to choose the specific options,
125 described hereafter, of the algorithm. See
126 :ref:`section_ref_options_Algorithm_Parameters` for the good use of this
127 command.
128
129 The options of the algorithm are the following:
130
131   .. include:: snippets/AmplitudeOfInitialDirection.rst
132
133   .. include:: snippets/EpsilonMinimumExponent.rst
134
135   .. include:: snippets/InitialDirection.rst
136
137   .. include:: snippets/SetSeed.rst
138
139   ResiduFormula
140     .. index:: single: ResiduFormula
141
142     This key indicates the residue formula that has to be used for the test. The
143     default choice is "CenteredDL", and the possible ones are "CenteredDL"
144     (residue of the difference between the function at nominal point and the
145     values with positive and negative increments, which has to stay very small),
146     "Taylor" (residue of the Taylor development of the operator normalized by
147     the nominal value, which has to stay very small), "NominalTaylor" (residue
148     of the order 1 approximations of the operator, normalized to the nominal
149     point, which has to stay close to 1), and "NominalTaylorRMS" (residue of the
150     order 1 approximations of the operator, normalized by RMS to the nominal
151     point, which has to stay close to 0).
152
153     Example :
154     ``{"ResiduFormula":"CenteredDL"}``
155
156   StoreSupplementaryCalculations
157     .. index:: single: StoreSupplementaryCalculations
158
159     This list indicates the names of the supplementary variables that can be
160     available at the end of the algorithm. It involves potentially costly
161     calculations or memory consumptions. The default is a void list, none of
162     these variables being calculated and stored by default. The possible names
163     are in the following list: ["CurrentState", "Residu",
164     "SimulatedObservationAtCurrentState"].
165
166     Example :
167     ``{"StoreSupplementaryCalculations":["CurrentState"]}``
168
169 Information and variables available at the end of the algorithm
170 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
171
172 At the output, after executing the algorithm, there are variables and
173 information originating from the calculation. The description of
174 :ref:`section_ref_output_variables` show the way to obtain them by the method
175 named ``get`` of the variable "*ADD*" of the post-processing. The input
176 variables, available to the user at the output in order to facilitate the
177 writing of post-processing procedures, are described in the
178 :ref:`subsection_r_o_v_Inventaire`.
179
180 The unconditional outputs of the algorithm are the following:
181
182   .. include:: snippets/Residu.rst
183
184 The conditional outputs of the algorithm are the following:
185
186   .. include:: snippets/CurrentState.rst
187
188   .. include:: snippets/SimulatedObservationAtCurrentState.rst
189
190 See also
191 ++++++++
192
193 References to other sections:
194   - :ref:`section_ref_algorithm_FunctionTest`