Salome HOME
Correction of catalogue and version setting
[modules/adao.git] / doc / en / ref_algorithm_LinearLeastSquares.rst
1 ..
2    Copyright (C) 2008-2015 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: LinearLeastSquares
25 .. _section_ref_algorithm_LinearLeastSquares:
26
27 Calculation algorithm "*LinearLeastSquares*"
28 --------------------------------------------
29
30 Description
31 +++++++++++
32
33 This algorithm realizes a "Least Squares" linear type estimation of the state of
34 a system. It is similar to the :ref:`section_ref_algorithm_Blue`, without its
35 background part.
36
37 This algorithm is always the fastest of all the optimization algorithms of ADAO.
38 It is theoretically reserved for observation operator cases which are linear,
39 even if it sometimes works in "slightly" non-linear cases. One can verify the
40 linearity of the observation operator with the help of the
41 :ref:`section_ref_algorithm_LinearityTest`.
42
43 In all cases, it is recommanded to prefer at least the
44 :ref:`section_ref_algorithm_Blue`, or the
45 :ref:`section_ref_algorithm_ExtendedBlue` or the
46 :ref:`section_ref_algorithm_3DVAR`.
47
48 Optional and required commands
49 ++++++++++++++++++++++++++++++
50
51 .. index:: single: AlgorithmParameters
52 .. index:: single: Observation
53 .. index:: single: ObservationError
54 .. index:: single: ObservationOperator
55 .. index:: single: StoreSupplementaryCalculations
56
57 The general required commands, available in the editing user interface, are the
58 following:
59
60   Observation
61     *Required command*. This indicates the observation vector used for data
62     assimilation or optimization, previously noted as :math:`\mathbf{y}^o`. It
63     is defined as a "*Vector*" or a *VectorSerie* type object.
64
65   ObservationError
66     *Required command*. This indicates the observation error covariance matrix,
67     previously noted as :math:`\mathbf{R}`. It is defined as a "*Matrix*" type
68     object, a "*ScalarSparseMatrix*" type object, or a "*DiagonalSparseMatrix*"
69     type object.
70
71   ObservationOperator
72     *Required command*. This indicates the observation operator, previously
73     noted :math:`H`, which transforms the input parameters :math:`\mathbf{x}` to
74     results :math:`\mathbf{y}` to be compared to observations
75     :math:`\mathbf{y}^o`. Its value is defined as a "*Function*" type object or
76     a "*Matrix*" type one. In the case of "*Function*" type, different
77     functional forms can be used, as described in the section
78     :ref:`section_ref_operator_requirements`. If there is some control :math:`U`
79     included in the observation, the operator has to be applied to a pair
80     :math:`(X,U)`.
81
82 The general optional commands, available in the editing user interface, are
83 indicated in :ref:`section_ref_assimilation_keywords`. Moreover, the parameters
84 of the command "*AlgorithmParameters*" allows to choose the specific options,
85 described hereafter, of the algorithm. See
86 :ref:`section_ref_options_Algorithm_Parameters` for the good use of this
87 command.
88
89 The options of the algorithm are the following:
90
91   StoreSupplementaryCalculations
92     This list indicates the names of the supplementary variables that can be
93     available at the end of the algorithm. It involves potentially costly
94     calculations or memory consumptions. The default is a void list, none of
95     these variables being calculated and stored by default. The possible names
96     are in the following list: ["OMA", "CostFunctionJ",
97     "SimulatedObservationAtOptimum"].
98
99     Example : ``{"StoreSupplementaryCalculations":["OMA"]}``
100
101 *Tips for this algorithm:*
102
103     As the *"Background"* and *"BackgroundError"* commands are required for ALL
104     the calculation algorithms in the interface, you have to provide a value,
105     even if these commands are not required for this algorithm, and will not be
106     used. The simplest way is to give "1" as a STRING for both.
107
108 Information and variables available at the end of the algorithm
109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
110
111 At the output, after executing the algorithm, there are variables and
112 information originating from the calculation. The description of
113 :ref:`section_ref_output_variables` show the way to obtain them by the method
114 named ``get`` of the variable "*ADD*" of the post-processing. The input
115 variables, available to the user at the output in order to facilitate the
116 writing of post-processing procedures, are described in the
117 :ref:`subsection_r_o_v_Inventaire`.
118
119 The unconditional outputs of the algorithm are the following:
120
121   Analysis
122     *List of vectors*. Each element is an optimal state :math:`\mathbf{x}*` in
123     optimization or an analysis :math:`\mathbf{x}^a` in data assimilation.
124
125     Example : ``Xa = ADD.get("Analysis")[-1]``
126
127   CostFunctionJ
128     *List of values*. Each element is a value of the error function :math:`J`.
129
130     Example : ``J = ADD.get("CostFunctionJ")[:]``
131
132   CostFunctionJb
133     *List of values*. Each element is a value of the error function :math:`J^b`,
134     that is of the background difference part.
135
136     Example : ``Jb = ADD.get("CostFunctionJb")[:]``
137
138   CostFunctionJo
139     *List of values*. Each element is a value of the error function :math:`J^o`,
140     that is of the observation difference part.
141
142     Example : ``Jo = ADD.get("CostFunctionJo")[:]``
143
144 The conditional outputs of the algorithm are the following:
145
146   OMA
147     *List of vectors*. Each element is a vector of difference between the
148     observation and the optimal state in the observation space.
149
150     Example : ``oma = ADD.get("OMA")[-1]``
151
152   SimulatedObservationAtOptimum
153     *List of vectors*. Each element is a vector of observation simulated from
154     the analysis or optimal state :math:`\mathbf{x}^a`.
155
156     Example : ``hxa = ADD.get("SimulatedObservationAtOptimum")[-1]``
157
158 See also
159 ++++++++
160
161 References to other sections:
162   - :ref:`section_ref_algorithm_Blue`
163   - :ref:`section_ref_algorithm_ExtendedBlue`
164   - :ref:`section_ref_algorithm_3DVAR`
165   - :ref:`section_ref_algorithm_LinearityTest`