From 408ea5efa9515c5f6af1e1132353ac07991fd730 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Sat, 5 Feb 2022 21:13:03 +0100 Subject: [PATCH] Minor documentation and code review corrections (18) --- doc/en/advanced.rst | 24 ++-- doc/en/ref_observers_requirements.rst | 128 +++++++++--------- doc/en/ref_operator_requirements.rst | 22 ++- .../AmplitudeOfTangentPerturbation.rst | 4 +- doc/fr/advanced.rst | 9 +- doc/fr/glossary.rst | 2 +- doc/fr/ref_observers_requirements.rst | 128 +++++++++--------- doc/fr/ref_operator_requirements.rst | 24 +++- .../AmplitudeOfTangentPerturbation.rst | 4 +- doc/fr/theory.rst | 10 +- 10 files changed, 192 insertions(+), 163 deletions(-) diff --git a/doc/en/advanced.rst b/doc/en/advanced.rst index 3ba300f..d040a0d 100644 --- a/doc/en/advanced.rst +++ b/doc/en/advanced.rst @@ -548,17 +548,19 @@ particular to reduce or avoid the difficulties of optimal search which are manifested by many successive iterations on almost identical states. **A third way to improve convergence is to adapt the default setting of the -finite difference approximation, primarily for the observation operator**. The -control of this property is done with the keyword "*DifferentialIncrement*" -which sets the definition using the :ref:`section_ref_operator_one`. Its -default value is 1%, and it can usually be adjusted between :math:`10^{-5}` and -:math:`10^{-3}` (although it is wise to check carefully the relevance of its -value, it is easy in ADAO to change this parameter). The convergence criterion -must then be adjusted so that it does not exceed the order of magnitude of this -approximation. In practice, it is sufficient to set the -"*CostDecrementTolerance*" criterion to approximately the same precision (i.e. -with an order of magnitude more or less) as the "*DifferentialIncrement*" -criterion. +finite difference approximation, primarily for the observation operator and a +single-operator representation**. The control of this property is done with the +keyword "*DifferentialIncrement*" which sets the definition using the +:ref:`section_ref_operator_one`. Its default value is 1%, and it can usually be +adjusted between :math:`10^{-5}` and :math:`10^{-3}` (although it is wise to +check carefully the relevance of its value, it is easy in ADAO to change this +parameter). The convergence criterion must then be adjusted so that it does not +exceed the order of magnitude of this approximation. In practice, it is +sufficient to set the "*CostDecrementTolerance*" criterion to approximately the +same precision (i.e. with an order of magnitude more or less) as the +"*DifferentialIncrement*" criterion. This way of improvement is also to be +completed with analyses using the :ref:`section_ref_algorithm_LinearityTest` +and :ref:`section_ref_algorithm_GradientTest`. From experience, it is *a priori* not recommended to use other means to control convergence, even if they exist. These parameter adjustments are simple to diff --git a/doc/en/ref_observers_requirements.rst b/doc/en/ref_observers_requirements.rst index d214e16..59f5849 100644 --- a/doc/en/ref_observers_requirements.rst +++ b/doc/en/ref_observers_requirements.rst @@ -171,9 +171,9 @@ Save the current value of the variable in a file of the '/tmp' directory named ' v=numpy.array(var[-1], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -189,12 +189,12 @@ Save the value series of the variable in a file of the '/tmp' directory named 'v :: import numpy, re - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -214,9 +214,9 @@ Print on standard output and, in the same time save in a file of the '/tmp' dire print(str(info)+" "+str(v)) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -236,9 +236,9 @@ Print on standard output and, in the same time save in a file of the '/tmp' dire print(str(info)+(" index %i:"%(len(var)-1))+" "+str(v)) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -254,13 +254,13 @@ Print on standard output and, in the same time, save in a file of the '/tmp' dir :: import numpy, re - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) print(str(info)+" "+str(v)) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -279,13 +279,13 @@ Graphically plot with Gnuplot the current value of the variable. v=numpy.array(var[-1], ndmin=1) global ifig, gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueSerieGnuPlotter (Observer) @@ -298,16 +298,16 @@ Graphically plot with Gnuplot the value series of the variable. :: import numpy, Gnuplot - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global ifig, gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValuePrinterAndGnuPlotter (Observer) @@ -319,18 +319,18 @@ Print on standard output and, in the same time, graphically plot with Gnuplot th :: - print(str(info)+" "+str(var[-1])) + print(str(info)+' '+str(var[-1])) import numpy, Gnuplot v=numpy.array(var[-1], ndmin=1) global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueSeriePrinterAndGnuPlotter (Observer) @@ -342,18 +342,18 @@ Print on standard output and, in the same time, graphically plot with Gnuplot th :: - print(str(info)+" "+str(var[:])) + print(str(info)+' '+str(var[:])) import numpy, Gnuplot - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValuePrinterSaverAndGnuPlotter (Observer) @@ -365,14 +365,14 @@ Print on standard output and, in the same, time save in a file of the '/tmp' dir :: - print(str(info)+" "+str(var[-1])) + print(str(info)+' '+str(var[-1])) import numpy, re v=numpy.array(var[-1], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -380,13 +380,13 @@ Print on standard output and, in the same, time save in a file of the '/tmp' dir import Gnuplot global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueSeriePrinterSaverAndGnuPlotter (Observer) @@ -398,14 +398,14 @@ Print on standard output and, in the same, time save in a file of the '/tmp' dir :: - print(str(info)+" "+str(var[:])) + print(str(info)+' '+str(var[:])) import numpy, re - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -413,13 +413,13 @@ Print on standard output and, in the same, time save in a file of the '/tmp' dir import Gnuplot global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueMean (Observer) @@ -432,7 +432,7 @@ Print on standard output the mean of the current value of the variable. :: import numpy - print(str(info)+" "+str(numpy.nanmean(var[-1]))) + print(str(info)+' '+str(numpy.nanmean(var[-1]))) .. index:: single: ValueStandardError (Observer) @@ -444,7 +444,7 @@ Print on standard output the standard error of the current value of the variable :: import numpy - print(str(info)+" "+str(numpy.nanstd(var[-1]))) + print(str(info)+' '+str(numpy.nanstd(var[-1]))) .. index:: single: ValueVariance (Observer) @@ -456,7 +456,7 @@ Print on standard output the variance of the current value of the variable. :: import numpy - print(str(info)+" "+str(numpy.nanvar(var[-1]))) + print(str(info)+' '+str(numpy.nanvar(var[-1]))) .. index:: single: ValueL2Norm (Observer) @@ -469,7 +469,7 @@ Print on standard output the L2 norm of the current value of the variable. import numpy v = numpy.ravel( var[-1] ) - print(str(info)+" "+str(float( numpy.linalg.norm(v) ))) + print(str(info)+' '+str(float( numpy.linalg.norm(v) ))) .. index:: single: ValueRMS (Observer) @@ -482,4 +482,4 @@ Print on standard output the root mean square (RMS), or quadratic mean, of the c import numpy v = numpy.ravel( var[-1] ) - print(str(info)+" "+str(float( numpy.sqrt((1./v.size)*numpy.dot(v,v)) ))) + print(str(info)+' '+str(float( numpy.sqrt((1./v.size)*numpy.dot(v,v)) ))) diff --git a/doc/en/ref_operator_requirements.rst b/doc/en/ref_operator_requirements.rst index 889e384..4cc5070 100644 --- a/doc/en/ref_operator_requirements.rst +++ b/doc/en/ref_operator_requirements.rst @@ -397,6 +397,8 @@ problem. Such a process is rarely enough to avoid all the numerical problems, but it often improves a lot the numeric conditioning of the optimization. +.. index:: single: InputFunctionAsMulti + Dealing explicitly with "multiple" functions ++++++++++++++++++++++++++++++++++++++++++++ @@ -407,7 +409,7 @@ Dealing explicitly with "multiple" functions already done by default in ADAO to increase performances. Only the very experienced user, seeking to manage particularly difficult cases, can be interested in this extension. Despite its simplicity, there is an explicit - risk of significantly worsening performance. + risk of significantly worsening performance, or getting weird runtime errors. It is possible, when defining operator's functions, to set them as functions that treat not only one argument, but a series of arguments, to give back on @@ -427,7 +429,17 @@ The length of the output (that is, the number of calculated values) is equal to the length of the input (that is, the number of states for which one want to calculate the value by the operator). -This possibility is only available in the textual interface for ADAO. For this, -when defining an operator's function, in the same time one usually define the -function or the external script, it can be set using a boolean parameter -"*InputFunctionAsMulti*" that the definition is one of a "multiple" function. +This possibility is only available in the TUI textual interface for ADAO. For +this, when defining an operator's function, in the same time one usually define +the function or the external script, it can be set using an additional boolean +parameter "*InputFunctionAsMulti*" that the definition is one of a "multiple" +function. For example, if it is the observation operator that is defined in +this way, one should write (knowing that all other optional commands remain +unchanged): +:: + + case.set( 'ObservationOperator', + OneFunction = MultiFunctionO, + ... + InputFunctionAsMulti = True, + ) diff --git a/doc/en/snippets/AmplitudeOfTangentPerturbation.rst b/doc/en/snippets/AmplitudeOfTangentPerturbation.rst index 75d1be0..7520464 100644 --- a/doc/en/snippets/AmplitudeOfTangentPerturbation.rst +++ b/doc/en/snippets/AmplitudeOfTangentPerturbation.rst @@ -4,8 +4,8 @@ AmplitudeOfTangentPerturbation *Real value*. This key indicates the relative numerical magnitude of the perturbation used to estimate the tangent value of the operator at the evaluation point, i.e. its directional derivative. The conservative default - is 1.e-2, and it is strongly recommended to adapt it to the needs of real - problems, by decreasing its value by several orders of magnitude. + is 1.e-2 i.e. 1%, and it is strongly recommended to adapt it to the needs of + real problems, by decreasing its value by several orders of magnitude. Example : ``{"AmplitudeOfTangentPerturbation":1.e-2}`` diff --git a/doc/fr/advanced.rst b/doc/fr/advanced.rst index dcb8bfe..12519aa 100644 --- a/doc/fr/advanced.rst +++ b/doc/fr/advanced.rst @@ -598,8 +598,9 @@ presque identiques. **Un troisième moyen d'améliorer la convergence est d'adapter le réglage par défaut de l'approximation par différences finies, essentiellement pour -l'opérateur d'observation**. Le contrôle de cette propriété se fait à l'aide du -mot-clé "*DifferentialIncrement*" qui paramètre la définition à l'aide de la +l'opérateur d'observation et une représentation en mono-opérateur**. Le +contrôle de cette propriété se fait à l'aide du mot-clé +"*DifferentialIncrement*" qui paramètre la définition à l'aide de la :ref:`section_ref_operator_one`. Sa valeur par défaut est de 1%, et il peut généralement être ajusté entre :math:`10^{-5}` et :math:`10^{-3}` (même s'il est sage de vérifier soigneusement la pertinence de sa valeur, il est aisé dans @@ -608,7 +609,9 @@ ajusté de telle sorte qu'il ne surpasse pas l'ordre de grandeur de cette approximation. En pratique, on peut se contenter de fixer le critère "*CostDecrementTolerance*" à peu près à la même précision (c'est-à-dire avec un ordre de grandeur de plus ou de moins) que le critère -"*DifferentialIncrement*". +"*DifferentialIncrement*". Ce moyen d'amélioration est aussi à compléter +d'analyses à l'aide des :ref:`section_ref_algorithm_LinearityTest` et +:ref:`section_ref_algorithm_GradientTest`. Par expérience, il n'est *a priori* pas recommandé d'utiliser d'autres moyens de contrôler la convergence, même s'il en existe. Ces ajustements de paramètres diff --git a/doc/fr/glossary.rst b/doc/fr/glossary.rst index 26e17ba..5c4328c 100644 --- a/doc/fr/glossary.rst +++ b/doc/fr/glossary.rst @@ -142,7 +142,7 @@ Glossaire background C'est le terme anglais pour désigner l'ébauche. - ébauche + ebauche C'est une part (choisie pour être modifiable) de la représentation de l'état du système, représentation connue *a priori* ou initiale, qui n'est pas optimale, et qui est utilisée comme une estimation grossière ou diff --git a/doc/fr/ref_observers_requirements.rst b/doc/fr/ref_observers_requirements.rst index 792d29f..e7aaed1 100644 --- a/doc/fr/ref_observers_requirements.rst +++ b/doc/fr/ref_observers_requirements.rst @@ -180,9 +180,9 @@ Enregistre la valeur courante de la variable dans un fichier du répertoire '/tm v=numpy.array(var[-1], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -198,12 +198,12 @@ Enregistre la série des valeurs de la variable dans un fichier du répertoire ' :: import numpy, re - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -223,9 +223,9 @@ Imprime sur la sortie standard et, en même temps enregistre dans un fichier du print(str(info)+" "+str(v)) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -245,9 +245,9 @@ Imprime sur la sortie standard et, en même temps enregistre dans un fichier du print(str(info)+(" index %i:"%(len(var)-1))+" "+str(v)) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -263,13 +263,13 @@ Imprime sur la sortie standard et, en même temps, enregistre dans un fichier du :: import numpy, re - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) print(str(info)+" "+str(v)) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -288,13 +288,13 @@ Affiche graphiquement avec Gnuplot la valeur courante de la variable. v=numpy.array(var[-1], ndmin=1) global ifig, gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueSerieGnuPlotter (Observer) @@ -307,16 +307,16 @@ Affiche graphiquement avec Gnuplot la série des valeurs de la variable. :: import numpy, Gnuplot - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global ifig, gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValuePrinterAndGnuPlotter (Observer) @@ -328,18 +328,18 @@ Imprime sur la sortie standard et, en même temps, affiche graphiquement avec Gn :: - print(str(info)+" "+str(var[-1])) + print(str(info)+' '+str(var[-1])) import numpy, Gnuplot v=numpy.array(var[-1], ndmin=1) global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueSeriePrinterAndGnuPlotter (Observer) @@ -351,18 +351,18 @@ Imprime sur la sortie standard et, en même temps, affiche graphiquement avec Gn :: - print(str(info)+" "+str(var[:])) + print(str(info)+' '+str(var[:])) import numpy, Gnuplot - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValuePrinterSaverAndGnuPlotter (Observer) @@ -374,14 +374,14 @@ Imprime sur la sortie standard et, en même temps, enregistre dans un fichier du :: - print(str(info)+" "+str(var[-1])) + print(str(info)+' '+str(var[-1])) import numpy, re v=numpy.array(var[-1], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -389,13 +389,13 @@ Imprime sur la sortie standard et, en même temps, enregistre dans un fichier du import Gnuplot global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueSeriePrinterSaverAndGnuPlotter (Observer) @@ -407,14 +407,14 @@ Imprime sur la sortie standard et, en même temps, enregistre dans un fichier du :: - print(str(info)+" "+str(var[:])) + print(str(info)+' '+str(var[:])) import numpy, re - v=numpy.array(var[:], ndmin=1) + v=numpy.array(var[:], ndmin=1) global istep try: - istep += 1 + istep+=1 except: - istep = 0 + istep=0 f='/tmp/value_%s_%05i.txt'%(info,istep) f=re.sub('\s','_',f) print('Value saved in "%s"'%f) @@ -422,13 +422,13 @@ Imprime sur la sortie standard et, en même temps, enregistre dans un fichier du import Gnuplot global ifig,gp try: - ifig += 1 - gp(' set style data lines') + ifig+=1 + gp('set style data lines') except: - ifig = 0 - gp = Gnuplot.Gnuplot(persist=1) - gp(' set style data lines') - gp('set title "%s (Figure %i)"'%(info,ifig)) + ifig=0 + gp=Gnuplot.Gnuplot(persist=1) + gp('set style data lines') + gp('set title "%s (Figure %i)"'%(info,ifig)) gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) ) .. index:: single: ValueMean (Observer) @@ -441,7 +441,7 @@ Imprime sur la sortie standard la moyenne de la valeur courante de la variable. :: import numpy - print(str(info)+" "+str(numpy.nanmean(var[-1]))) + print(str(info)+' '+str(numpy.nanmean(var[-1]))) .. index:: single: ValueStandardError (Observer) @@ -453,7 +453,7 @@ Imprime sur la sortie standard l'écart-type de la valeur courante de la variabl :: import numpy - print(str(info)+" "+str(numpy.nanstd(var[-1]))) + print(str(info)+' '+str(numpy.nanstd(var[-1]))) .. index:: single: ValueVariance (Observer) @@ -465,7 +465,7 @@ Imprime sur la sortie standard la variance de la valeur courante de la variable. :: import numpy - print(str(info)+" "+str(numpy.nanvar(var[-1]))) + print(str(info)+' '+str(numpy.nanvar(var[-1]))) .. index:: single: ValueL2Norm (Observer) @@ -478,7 +478,7 @@ Imprime sur la sortie standard la norme L2 de la valeur courante de la variable. import numpy v = numpy.ravel( var[-1] ) - print(str(info)+" "+str(float( numpy.linalg.norm(v) ))) + print(str(info)+' '+str(float( numpy.linalg.norm(v) ))) .. index:: single: ValueRMS (Observer) @@ -491,4 +491,4 @@ Imprime sur la sortie standard la racine de la moyenne des carrés (RMS), ou moy import numpy v = numpy.ravel( var[-1] ) - print(str(info)+" "+str(float( numpy.sqrt((1./v.size)*numpy.dot(v,v)) ))) + print(str(info)+' '+str(float( numpy.sqrt((1./v.size)*numpy.dot(v,v)) ))) diff --git a/doc/fr/ref_operator_requirements.rst b/doc/fr/ref_operator_requirements.rst index ad7cbf3..4e283a3 100644 --- a/doc/fr/ref_operator_requirements.rst +++ b/doc/fr/ref_operator_requirements.rst @@ -414,6 +414,8 @@ Une telle démarche suffit rarement à éviter tous les problèmes numériques, permet souvent d'améliorer beaucoup le conditionnement numérique de l'optimisation. +.. index:: single: InputFunctionAsMulti + Gestion explicite de fonctions "multiples" ++++++++++++++++++++++++++++++++++++++++++ @@ -425,7 +427,7 @@ Gestion explicite de fonctions "multiples" performances. Seul l'utilisateur très averti, cherchant à gérer des cas particulièrement difficiles, peut s'intéresser à cette extension. En dépit de sa simplicité, c'est au risque explicite de dégrader notablement les - performances. + performances, ou d'avoir des erreurs d'exécution étranges. Il est possible, lorsque l'on fournit des fonctions d'opérateurs, de les définir comme des fonctions qui traitent non pas un seul argument, mais une @@ -447,8 +449,18 @@ La longueur de la sortie (c'est-à-dire le nombre de valeurs calculées) est égale à la longueur de l'entrée (c'est-à-dire le nombre d'états dont on veut calculer la valeur par l'opérateur). -Cette possibilité n'est disponible que dans l'interface textuelle d'ADAO. Pour -cela, lors de la définition d'une fonction d'opérateur, en même temps que l'on -définit de manière habituelle la fonction ou le script externe, il suffit -d'indiquer en plus en argument par un booléen "*InputFunctionAsMulti*" que la -définition est celle d'une fonction "multiple". +Cette possibilité n'est disponible que dans l'interface textuelle TUI d'ADAO. +Pour cela, lors de la définition d'une fonction d'opérateur, en même temps que +l'on définit de manière habituelle la fonction ou le script externe, il suffit +d'indiquer en plus en argument par un booléen supplémentaire +"*InputFunctionAsMulti*" que la définition est celle d'une fonction "multiple". +Par exemple, si c'est l'opérateur d'observation que l'on définit de cette +manière, il faut écrire (sachant que toutes les autres commandes optionnelles +restent inchangées) : +:: + + case.set( 'ObservationOperator', + OneFunction = MultiFunctionO, + ... + InputFunctionAsMulti = True, + ) diff --git a/doc/fr/snippets/AmplitudeOfTangentPerturbation.rst b/doc/fr/snippets/AmplitudeOfTangentPerturbation.rst index af42bf7..e0eb907 100644 --- a/doc/fr/snippets/AmplitudeOfTangentPerturbation.rst +++ b/doc/fr/snippets/AmplitudeOfTangentPerturbation.rst @@ -4,8 +4,8 @@ AmplitudeOfTangentPerturbation *Valeur réelle*. Cette clé indique l'amplitude numérique relative de la perturbation utilisée pour estimer la valeur tangente de l'opérateur au point d'évaluation, i.e. sa dérivée directionnelle. Le défaut conservatif est de - 1.e-2, et il est fortement recommandé de l'adapter aux besoins pour des - problèmes réels, en diminuant sa valeur de plusieurs ordres de grandeur. + 1.e-2 i.e. 1%, et il est fortement recommandé de l'adapter aux besoins pour + des problèmes réels, en diminuant sa valeur de plusieurs ordres de grandeur. Exemple : ``{"AmplitudeOfTangentPerturbation":1.e-2}`` diff --git a/doc/fr/theory.rst b/doc/fr/theory.rst index 186608a..33d96eb 100644 --- a/doc/fr/theory.rst +++ b/doc/fr/theory.rst @@ -29,7 +29,7 @@ .. index:: single: Data Assimilation .. index:: single: assimilation de données -.. index:: single: état vrai +.. index:: single: etat vrai .. index:: single: observation .. index:: single: a priori .. index:: single: EstimationOf @@ -86,7 +86,7 @@ Reconstruction de champs ou interpolation de données .. index:: single: interpolation de données .. index:: single: interpolation de champs .. index:: single: estimation d'état -.. index:: single: ébauche +.. index:: single: ebauche La **reconstruction (ou l'interpolation) de champs** consiste à trouver, à partir d'un nombre restreint de mesures réelles, le (ou les) champ(s) @@ -124,7 +124,7 @@ Identification de paramètres, ajustement de modèles, ou calage .. index:: single: ajustement de modèles .. index:: single: recalage .. index:: single: calage -.. index:: single: ébauche +.. index:: single: ebauche .. index:: single: régularisation .. index:: single: problèmes inverses .. index:: single: estimation de paramètres @@ -206,7 +206,7 @@ d'états et de paramètres. Description simple du cadre méthodologique de l'assimilation de données ----------------------------------------------------------------------- -.. index:: single: ébauche +.. index:: single: ebauche .. index:: single: covariances d'erreurs d'ébauche .. index:: single: covariances d'erreurs d'observation .. index:: single: covariances @@ -646,7 +646,7 @@ Approfondir l'assimilation de données pour la dynamique .. index:: single: dynamique (système) .. index:: single: système dynamique -.. index:: single: évolution temporelle +.. index:: single: evolution temporelle .. index:: single: EDO (Équation Différentielle Ordinaire) .. index:: single: ODE (Ordinary Differential Equation) .. index:: single: EstimationOf -- 2.39.2