Salome HOME
Documentation correction and improvements with methodology (EN)
[modules/adao.git] / doc / en / ref_algorithm_LinearLeastSquares.rst
1 ..
2    Copyright (C) 2008-2017 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", "CurrentState", "CostFunctionJ",
97     "CostFunctionJb", "CostFunctionJo", "SimulatedObservationAtCurrentState",
98     "SimulatedObservationAtOptimum"].
99
100     Example : ``{"StoreSupplementaryCalculations":["OMA", "CurrentState"]}``
101
102 *Tips for this algorithm:*
103
104     As the *"Background"* and *"BackgroundError"* commands are required for ALL
105     the calculation algorithms in the interface, you have to provide a value,
106     even if these commands are not required for this algorithm, and will not be
107     used. The simplest way is to give "1" as a STRING for both.
108
109 Information and variables available at the end of the algorithm
110 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
111
112 At the output, after executing the algorithm, there are variables and
113 information originating from the calculation. The description of
114 :ref:`section_ref_output_variables` show the way to obtain them by the method
115 named ``get`` of the variable "*ADD*" of the post-processing. The input
116 variables, available to the user at the output in order to facilitate the
117 writing of post-processing procedures, are described in the
118 :ref:`subsection_r_o_v_Inventaire`.
119
120 The unconditional outputs of the algorithm are the following:
121
122   Analysis
123     *List of vectors*. Each element is an optimal state :math:`\mathbf{x}*` in
124     optimization or an analysis :math:`\mathbf{x}^a` in data assimilation.
125
126     Example : ``Xa = ADD.get("Analysis")[-1]``
127
128   CostFunctionJ
129     *List of values*. Each element is a value of the error function :math:`J`.
130
131     Example : ``J = ADD.get("CostFunctionJ")[:]``
132
133   CostFunctionJb
134     *List of values*. Each element is a value of the error function :math:`J^b`,
135     that is of the background difference part.
136
137     Example : ``Jb = ADD.get("CostFunctionJb")[:]``
138
139   CostFunctionJo
140     *List of values*. Each element is a value of the error function :math:`J^o`,
141     that is of the observation difference part.
142
143     Example : ``Jo = ADD.get("CostFunctionJo")[:]``
144
145 The conditional outputs of the algorithm are the following:
146
147   OMA
148     *List of vectors*. Each element is a vector of difference between the
149     observation and the optimal state in the observation space.
150
151     Example : ``oma = ADD.get("OMA")[-1]``
152
153   SimulatedObservationAtOptimum
154     *List of vectors*. Each element is a vector of observation simulated from
155     the analysis or optimal state :math:`\mathbf{x}^a`.
156
157     Example : ``hxa = ADD.get("SimulatedObservationAtOptimum")[-1]``
158
159 See also
160 ++++++++
161
162 References to other sections:
163   - :ref:`section_ref_algorithm_Blue`
164   - :ref:`section_ref_algorithm_ExtendedBlue`
165   - :ref:`section_ref_algorithm_3DVAR`
166   - :ref:`section_ref_algorithm_LinearityTest`