Salome HOME
Adding examples for each optional command
[modules/adao.git] / doc / en / ref_algorithm_3DVAR.rst
1 ..
2    Copyright (C) 2008-2014 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: 3DVAR
25 .. _section_ref_algorithm_3DVAR:
26
27 Calculation algorithm "*3DVAR*"
28 -------------------------------
29
30 Description
31 +++++++++++
32
33 This algorithm performs a state estimation by variational minimization of the
34 classical :math:`J` function in static data assimilation:
35
36 .. math:: J(\mathbf{x})=(\mathbf{x}-\mathbf{x}^b)^T.\mathbf{B}^{-1}.(\mathbf{x}-\mathbf{x}^b)+(\mathbf{y}^o-\mathbf{H}.\mathbf{x})^T.\mathbf{R}^{-1}.(\mathbf{y}^o-\mathbf{H}.\mathbf{x})
37
38 which is usually designed as the "*3D-VAR*" function (see for example
39 [Talagrand97]_).
40
41 Optional and required commands
42 ++++++++++++++++++++++++++++++
43
44 .. index:: single: Background
45 .. index:: single: BackgroundError
46 .. index:: single: Observation
47 .. index:: single: ObservationError
48 .. index:: single: ObservationOperator
49 .. index:: single: Minimizer
50 .. index:: single: Bounds
51 .. index:: single: MaximumNumberOfSteps
52 .. index:: single: CostDecrementTolerance
53 .. index:: single: ProjectedGradientTolerance
54 .. index:: single: GradientNormTolerance
55 .. index:: single: StoreInternalVariables
56 .. index:: single: StoreSupplementaryCalculations
57
58 The general required commands, available in the editing user interface, are the
59 following:
60
61   Background
62     *Required command*. This indicates the background or initial vector used,
63     previously noted as :math:`\mathbf{x}^b`. Its value is defined as a
64     "*Vector*" or a *VectorSerie*" type object.
65
66   BackgroundError
67     *Required command*. This indicates the background error covariance matrix,
68     previously noted as :math:`\mathbf{B}`. Its value is defined as a "*Matrix*"
69     type object, a "*ScalarSparseMatrix*" type object, or a
70     "*DiagonalSparseMatrix*" type object.
71
72   Observation
73     *Required command*. This indicates the observation vector used for data
74     assimilation or optimization, previously noted as :math:`\mathbf{y}^o`. It
75     is defined as a "*Vector*" or a *VectorSerie* type object.
76
77   ObservationError
78     *Required command*. This indicates the observation error covariance matrix,
79     previously noted as :math:`\mathbf{R}`. It is defined as a "*Matrix*" type
80     object, a "*ScalarSparseMatrix*" type object, or a "*DiagonalSparseMatrix*"
81     type object.
82
83   ObservationOperator
84     *Required command*. This indicates the observation operator, previously
85     noted :math:`H`, which transforms the input parameters :math:`\mathbf{x}` to
86     results :math:`\mathbf{y}` to be compared to observations
87     :math:`\mathbf{y}^o`. Its value is defined as a "*Function*" type object or
88     a "*Matrix*" type one. In the case of "*Function*" type, different
89     functional forms can be used, as described in the section
90     :ref:`section_ref_operator_requirements`. If there is some control :math:`U`
91     included in the observation, the operator has to be applied to a pair
92     :math:`(X,U)`.
93
94 The general optional commands, available in the editing user interface, are
95 indicated in :ref:`section_ref_assimilation_keywords`. In particular, the
96 optional command "*AlgorithmParameters*" allows to choose the specific options,
97 described hereafter, of the algorithm. See
98 :ref:`section_ref_options_AlgorithmParameters` for the good use of this command.
99
100 The options of the algorithm are the following:
101
102   Minimizer
103     This key allows to choose the optimization minimizer. The default choice is
104     "LBFGSB", and the possible ones are "LBFGSB" (nonlinear constrained
105     minimizer, see [Byrd95]_, [Morales11]_ and [Zhu97]_), "TNC" (nonlinear
106     constrained minimizer), "CG" (nonlinear unconstrained minimizer), "BFGS"
107     (nonlinear unconstrained minimizer), "NCG" (Newton CG minimizer). It is
108     strongly recommended to stay with the default.
109
110     Example : ``{"Minimizer":"LBFGSB"}``
111
112   Bounds
113     This key allows to define upper and lower bounds for every state variable
114     being optimized. Bounds have to be given by a list of list of pairs of
115     lower/upper bounds for each variable, with possibly ``None`` every time
116     there is no bound. The bounds can always be specified, but they are taken
117     into account only by the constrained optimizers.
118
119     Example : ``{"Bounds":[[2.,5.],[1.e-2,10.],[-30.,None],[None,None]]}``
120
121   MaximumNumberOfSteps
122     This key indicates the maximum number of iterations allowed for iterative
123     optimization. The default is 15000, which is very similar to no limit on
124     iterations. It is then recommended to adapt this parameter to the needs on
125     real problems. For some optimizers, the effective stopping step can be
126     slightly different of the limit due to algorithm internal control
127     requirements.
128
129     Example : ``{"MaximumNumberOfSteps":100}``
130
131   CostDecrementTolerance
132     This key indicates a limit value, leading to stop successfully the
133     iterative optimization process when the cost function decreases less than
134     this tolerance at the last step. The default is 1.e-7, and it is
135     recommended to adapt it to the needs on real problems.
136
137     Example : ``{"CostDecrementTolerance":1.e-7}``
138
139   ProjectedGradientTolerance
140     This key indicates a limit value, leading to stop successfully the iterative
141     optimization process when all the components of the projected gradient are
142     under this limit. It is only used for constrained optimizers. The default is
143     -1, that is the internal default of each minimizer (generally 1.e-5), and it
144     is not recommended to change it.
145
146     Example : ``{"ProjectedGradientTolerance":-1}``
147
148   GradientNormTolerance
149     This key indicates a limit value, leading to stop successfully the
150     iterative optimization process when the norm of the gradient is under this
151     limit. It is only used for non-constrained optimizers.  The default is
152     1.e-5 and it is not recommended to change it.
153
154     Example : ``{"GradientNormTolerance":1.e-5}``
155
156   StoreInternalVariables
157     This Boolean key allows to store default internal variables, mainly the
158     current state during iterative optimization process. Be careful, this can be
159     a numerically costly choice in certain calculation cases. The default is
160     "False".
161
162     Example : ``{"StoreInternalVariables":True}``
163
164   StoreSupplementaryCalculations
165     This list indicates the names of the supplementary variables that can be
166     available at the end of the algorithm. It involves potentially costly
167     calculations or memory consumptions. The default is a void list, none of
168     these variables being calculated and stored by default. The possible names
169     are in the following list: ["APosterioriCovariance", "BMA", "OMA", "OMB",
170     "Innovation", "SigmaObs2", "MahalanobisConsistency"].
171
172     Example : ``{"StoreSupplementaryCalculations":["BMA","Innovation"]}``
173
174 See also
175 ++++++++
176
177 References to other sections:
178   - :ref:`section_ref_algorithm_Blue`
179   - :ref:`section_ref_algorithm_ExtendedBlue`
180   - :ref:`section_ref_algorithm_LinearityTest`
181
182 Bibliographical references:
183   - [Byrd95]_
184   - [Morales11]_
185   - [Talagrand97]_