]> SALOME platform Git repositories - modules/adao.git/blob - doc/en/ref_observers_requirements.rst
Salome HOME
Minor source update for OM compatibility
[modules/adao.git] / doc / en / ref_observers_requirements.rst
1 ..
2    Copyright (C) 2008-2024 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 .. _section_ref_observers_requirements:
25
26 Requirements for functions describing an "*observer*"
27 -----------------------------------------------------
28
29 .. index:: single: Observer
30 .. index:: single: setObserver
31 .. index:: single: Observer Template
32
33 Some special variables, internal to the optimization process and used inside
34 calculation, can be monitored during an ADAO calculation. These variables can
35 be printed, plotted, saved, etc. by the user. This can be done using some
36 "*observer*", sometimes also called "callback", on a variable. They are special
37 Python functions, each one associated with a given variable, as conceptually
38 described in the following figure:
39
40   .. ref_observer_simple:
41   .. image:: images/ref_observer_simple.png
42     :align: center
43     :width: 75%
44   .. centered::
45     **Conceptual definition of an "observer" function**
46
47 These "*observer*" functions are described in the next subsections.
48
49 Register and activate of an "*observer*" function
50 +++++++++++++++++++++++++++++++++++++++++++++++++
51
52 In the graphical interface EFICAS of ADAO, there are 3 practical methods to
53 provide an "*observer*" function in an ADAO case. The method is chosen with the
54 "*NodeType*" keyword of each "*observer*" entry type, as shown in the following
55 figure:
56
57   .. eficas_observer_nodetype:
58   .. image:: images/eficas_observer_nodetype.png
59     :align: center
60     :width: 100%
61   .. centered::
62     **Choosing its entry type for an "observer" function**
63
64 An "*observer*" function can be given as an explicit script (entry of type
65 "*String*"), as a script in an external file (entry of type "*Script*"), or by
66 using a template or pattern (entry of type"*Template*"). The templates are
67 available by default in ADAO, using the graphical interface EFICAS or the text
68 interface TUI, and are detailed in the following
69 :ref:`section_ref_observers_templates`. These templates are simple scripts that
70 can be tuned by the user, either in the integrated edition stage of the case
71 with ADAO EFICAS, or in the edition stage of the schema before execution, to
72 improve the ADAO case performance in the SALOME execution supervisor YACS.
73
74 In the textual interface (TUI) of ADAO (see the part :ref:`section_tui`), the
75 same information can be given with the command "*setObserver*" applied to a
76 specific variable indicated using the "*Variable*" argument. The other
77 arguments of this command allow to define an "*observer*" either as a template
78 ("*Template*" argument) representing one of the scripts detailed in the part
79 :ref:`section_ref_observers_templates`, or as an explicit script ("*String*"
80 argument), or as a script in an external file ("*Script*" argument).
81
82 General form for a script describing an "*observer*" function
83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
84
85 An "*observer*" function is a special Python script, associated with a given
86 variable, and that is automatically activated for each variable modification
87 during calculation. Every (carefully established) function that applies to the
88 selected variable can be used. Many "*observer*" functions are available by
89 default.
90
91 To use directly this "*observer*" capability, the user must use or build a
92 script that have on standard input (that is, in the naming space) the variables
93 ``var`` and ``info``. The variable ``var`` is to be used as an object of
94 list/tuple type, that contains the history of the variable of interest, indexed
95 by the iterating and/or time steps. Only the body of the "*observer*" function
96 has to be specified by the user, not the  Python ``def`` function call itself.
97
98 As an example, here is a very simple script (similar to the "*ValuePrinter*"
99 template), that can be used to print the value of the monitored variable::
100
101     print("    --->",info," Value =",var[-1])
102
103 Stored as a Python file or as an explicit string, this or these script lines
104 can be associated to each variable found in the keyword "*SELECTION*" of the
105 "*Observers*" command of the ADAO case: "*Analysis*", "*CurrentState*",
106 "*CostFunction*"... The current value of the variable will for example be
107 printed at each step of the optimization or data assimilation algorithm. The
108 "*observer*" can include graphical output, storage capacities, complex
109 treatment, statistical analysis, etc. If the variable, to which the
110 "*observer*" is linked, is not required in the calculation and by the user, the
111 execution of this "*observer*" is simply never activated.
112
113 .. warning::
114
115     If not using the default available templates, it is up to the user to make
116     carefully established function scripts or external programs that do not
117     crash before being registered as an "*observer*" function. The debugging
118     can otherwise be really difficult!
119
120 Some "*observer*" allow the creation of successive files or figures, which are
121 uniquely numbered and, if applicable, stored by default in the standard
122 ``/tmp`` directory. In the case where this information needs to be modified (as
123 for example when the ``/tmp`` directory is a virtual or local non-permanent
124 folder, or when one wishes to have a numbering according to the iteration), the
125 user is encouraged to take inspiration from a model that is suitable for him
126 and to modify it by specifying differently this shared information. Then, the
127 modified function can be used in a "*String*" or "*Script*" input.
128
129 .. note::
130
131     Some of the "observers" allow to create figures using the built-in Python
132     module Gnuplot.py [Gnuplot.py]_, here updated to support Python 3. This
133     module is an interface to control and to send arguments to the outstanding
134     classic utility for graphic plotting Gnuplot [Gnuplot]_. Available for most
135     environments, Gnuplot is independent and must be correctly preinstalled.
136
137 Hereinafter we give the identifier and the contents of all the available
138 "*observer*" models.
139
140 .. _section_ref_observers_templates:
141
142 Inventory of available "*observer*" function models ("*Template*")
143 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
144
145 .. index:: single: ValuePrinter (Observer)
146
147 Template **ValuePrinter**
148 .........................
149
150 Print on standard output the current value of the variable.
151
152 ::
153
154     print(str(info)+" "+str(var[-1]))
155
156 .. index:: single: ValueAndIndexPrinter (Observer)
157
158 Template **ValueAndIndexPrinter**
159 .................................
160
161 Print on standard output the current value of the variable, adding its index.
162
163 ::
164
165     print(str(info)+(" index %i:"%(len(var)-1))+" "+str(var[-1]))
166
167 .. index:: single: ValueSeriePrinter (Observer)
168
169 Template **ValueSeriePrinter**
170 ..............................
171
172 Print on standard output the value series of the variable.
173
174 ::
175
176     print(str(info)+" "+str(var[:]))
177
178 .. index:: single: ValueSaver (Observer)
179
180 Template **ValueSaver**
181 .......................
182
183 Save the current value of the variable in a file of the '/tmp' directory named 'value...txt' from the variable name and the saving step.
184
185 ::
186
187     import numpy, re
188     v=numpy.array(var[-1], ndmin=1)
189     global istep
190     try:
191         istep+=1
192     except:
193         istep=0
194     f='/tmp/value_%s_%05i.txt'%(info,istep)
195     f=re.sub(r'\s','_',f)
196     print('Value saved in "%s"'%f)
197     numpy.savetxt(f,v)
198
199 .. index:: single: ValueSerieSaver (Observer)
200
201 Template **ValueSerieSaver**
202 ............................
203
204 Save the value series of the variable in a file of the '/tmp' directory named 'value...txt' from the variable name and the saving step.
205
206 ::
207
208     import numpy, re
209     v=numpy.array(var[:], ndmin=1)
210     global istep
211     try:
212         istep+=1
213     except:
214         istep=0
215     f='/tmp/value_%s_%05i.txt'%(info,istep)
216     f=re.sub(r'\s','_',f)
217     print('Value saved in "%s"'%f)
218     numpy.savetxt(f,v)
219
220 .. index:: single: ValuePrinterAndSaver (Observer)
221
222 Template **ValuePrinterAndSaver**
223 .................................
224
225 Print on standard output and, in the same time save in a file of the '/tmp' directory, the current value of the variable.
226
227 ::
228
229     import numpy, re
230     v=numpy.array(var[-1], ndmin=1)
231     print(str(info)+" "+str(v))
232     global istep
233     try:
234         istep+=1
235     except:
236         istep=0
237     f='/tmp/value_%s_%05i.txt'%(info,istep)
238     f=re.sub(r'\s','_',f)
239     print('Value saved in "%s"'%f)
240     numpy.savetxt(f,v)
241
242 .. index:: single: ValueIndexPrinterAndSaver (Observer)
243
244 Template **ValueIndexPrinterAndSaver**
245 ......................................
246
247 Print on standard output and, in the same time save in a file of the '/tmp' directory, the current value of the variable, adding its index.
248
249 ::
250
251     import numpy, re
252     v=numpy.array(var[-1], ndmin=1)
253     print(str(info)+(" index %i:"%(len(var)-1))+" "+str(v))
254     global istep
255     try:
256         istep+=1
257     except:
258         istep=0
259     f='/tmp/value_%s_%05i.txt'%(info,istep)
260     f=re.sub(r'\s','_',f)
261     print('Value saved in "%s"'%f)
262     numpy.savetxt(f,v)
263
264 .. index:: single: ValueSeriePrinterAndSaver (Observer)
265
266 Template **ValueSeriePrinterAndSaver**
267 ......................................
268
269 Print on standard output and, in the same time, save in a file of the '/tmp' directory, the value series of the variable.
270
271 ::
272
273     import numpy, re
274     v=numpy.array(var[:], ndmin=1)
275     print(str(info)+" "+str(v))
276     global istep
277     try:
278         istep+=1
279     except:
280         istep=0
281     f='/tmp/value_%s_%05i.txt'%(info,istep)
282     f=re.sub(r'\s','_',f)
283     print('Value saved in "%s"'%f)
284     numpy.savetxt(f,v)
285
286 .. index:: single: ValueGnuPlotter (Observer)
287
288 Template **ValueGnuPlotter**
289 ............................
290
291 Graphically plot with Gnuplot the current value of the variable (persistent plot).
292
293 ::
294
295     import numpy, Gnuplot
296     v=numpy.array(var[-1], ndmin=1)
297     global igfig, gp
298     try:
299         igfig+=1
300         gp('set title "%s (Figure %i)"'%(info,igfig))
301     except:
302         igfig=0
303         gp=Gnuplot.Gnuplot(persist=1)
304         gp('set title "%s (Figure %i)"'%(info,igfig))
305         gp('set style data lines')
306     gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) )
307
308 .. index:: single: ValueSerieGnuPlotter (Observer)
309
310 Template **ValueSerieGnuPlotter**
311 .................................
312
313 Graphically plot with Gnuplot the value series of the variable (persistent plot).
314
315 ::
316
317     import numpy, Gnuplot
318     v=numpy.array(var[:], ndmin=1)
319     global igfig, gp
320     try:
321         igfig+=1
322         gp('set title "%s (Figure %i)"'%(info,igfig))
323     except:
324         igfig=0
325         gp=Gnuplot.Gnuplot(persist=1)
326         gp('set title "%s (Figure %i)"'%(info,igfig))
327         gp('set style data lines')
328         gp('set xlabel "Step"')
329         gp('set ylabel "Variable"')
330     gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) )
331
332 .. index:: single: ValuePrinterAndGnuPlotter (Observer)
333
334 Template **ValuePrinterAndGnuPlotter**
335 ......................................
336
337 Print on standard output and, in the same time, graphically plot with Gnuplot the current value of the variable (persistent plot).
338
339 ::
340
341     print(str(info)+' '+str(var[-1]))
342     import numpy, Gnuplot
343     v=numpy.array(var[-1], ndmin=1)
344     global igfig, gp
345     try:
346         igfig+=1
347         gp('set title "%s (Figure %i)"'%(info,igfig))
348     except:
349         igfig=0
350         gp=Gnuplot.Gnuplot(persist=1)
351         gp('set title "%s (Figure %i)"'%(info,igfig))
352         gp('set style data lines')
353     gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) )
354
355 .. index:: single: ValueSeriePrinterAndGnuPlotter (Observer)
356
357 Template **ValueSeriePrinterAndGnuPlotter**
358 ...........................................
359
360 Print on standard output and, in the same time, graphically plot with Gnuplot the value series of the variable (persistent plot).
361
362 ::
363
364     print(str(info)+' '+str(var[:]))
365     import numpy, Gnuplot
366     v=numpy.array(var[:], ndmin=1)
367     global igfig, gp
368     try:
369         igfig+=1
370         gp('set title "%s (Figure %i)"'%(info,igfig))
371     except:
372         igfig=0
373         gp=Gnuplot.Gnuplot(persist=1)
374         gp('set title "%s (Figure %i)"'%(info,igfig))
375         gp('set style data lines')
376         gp('set xlabel "Step"')
377         gp('set ylabel "Variable"')
378     gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) )
379
380 .. index:: single: ValuePrinterSaverAndGnuPlotter (Observer)
381
382 Template **ValuePrinterSaverAndGnuPlotter**
383 ...........................................
384
385 Print on standard output and, in the same, time save in a file of the '/tmp' directory and graphically plot the current value of the variable (persistent plot).
386
387 ::
388
389     print(str(info)+' '+str(var[-1]))
390     import numpy, re
391     v=numpy.array(var[-1], ndmin=1)
392     global istep
393     try:
394         istep+=1
395     except:
396         istep=0
397     f='/tmp/value_%s_%05i.txt'%(info,istep)
398     f=re.sub(r'\s','_',f)
399     print('Value saved in "%s"'%f)
400     numpy.savetxt(f,v)
401     import Gnuplot
402     global igfig, gp
403     try:
404         igfig+=1
405         gp('set title "%s (Figure %i)"'%(info,igfig))
406     except:
407         igfig=0
408         gp=Gnuplot.Gnuplot(persist=1)
409         gp('set title "%s (Figure %i)"'%(info,igfig))
410         gp('set style data lines')
411     gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) )
412
413 .. index:: single: ValueSeriePrinterSaverAndGnuPlotter (Observer)
414
415 Template **ValueSeriePrinterSaverAndGnuPlotter**
416 ................................................
417
418 Print on standard output and, in the same, time save in a file of the '/tmp' directory and graphically plot the value series of the variable (persistent plot).
419
420 ::
421
422     print(str(info)+' '+str(var[:]))
423     import numpy, re
424     v=numpy.array(var[:], ndmin=1)
425     global istep
426     try:
427         istep+=1
428     except:
429         istep=0
430     f='/tmp/value_%s_%05i.txt'%(info,istep)
431     f=re.sub(r'\s','_',f)
432     print('Value saved in "%s"'%f)
433     numpy.savetxt(f,v)
434     import Gnuplot
435     global igfig, gp
436     try:
437         igfig+=1
438         gp('set title "%s (Figure %i)"'%(info,igfig))
439     except:
440         igfig=0
441         gp=Gnuplot.Gnuplot(persist=1)
442         gp('set title "%s (Figure %i)"'%(info,igfig))
443         gp('set style data lines')
444         gp('set xlabel "Step"')
445         gp('set ylabel "Variable"')
446     gp.plot( Gnuplot.Data( v, with_='lines lw 2' ) )
447
448 .. index:: single: ValueMatPlotter (Observer)
449
450 Template **ValueMatPlotter**
451 ............................
452
453 Graphically plot with Matplolib the current value of the variable (non persistent plot).
454
455 ::
456
457     import numpy
458     import matplotlib.pyplot as plt
459     v=numpy.array(var[-1], ndmin=1)
460     global imfig, mp, ax
461     plt.ion()
462     try:
463         imfig+=1
464         mp.suptitle('%s (Figure %i)'%(info,imfig))
465     except:
466         imfig=0
467         mp = plt.figure()
468         ax = mp.add_subplot(1, 1, 1)
469         mp.suptitle('%s (Figure %i)'%(info,imfig))
470     ax.plot(v)
471     plt.show()
472
473 .. index:: single: ValueMatPlotterSaver (Observer)
474
475 Template **ValueMatPlotterSaver**
476 .................................
477
478 Graphically plot with Matplolib the current value of the variable, and save the figure in a file of the '/tmp' directory (persistant figure).
479
480 ::
481
482     import numpy, re
483     import matplotlib.pyplot as plt
484     v=numpy.array(var[-1], ndmin=1)
485     global imfig, mp, ax
486     plt.ion()
487     try:
488         imfig+=1
489         mp.suptitle('%s (Figure %i)'%(info,imfig))
490     except:
491         imfig=0
492         mp = plt.figure()
493         ax = mp.add_subplot(1, 1, 1)
494         mp.suptitle('%s (Figure %i)'%(info,imfig))
495     ax.plot(v)
496     f='/tmp/figure_%s_%05i.pdf'%(info,imfig)
497     f=re.sub(r'\s','_',f)
498     plt.savefig(f)
499     plt.show()
500
501 .. index:: single: ValueSerieMatPlotter (Observer)
502
503 Template **ValueSerieMatPlotter**
504 .................................
505
506 Graphically plot with Matplolib the value series of the variable (non persistent plot).
507
508 ::
509
510     import numpy
511     import matplotlib.pyplot as plt
512     v=numpy.array(var[:], ndmin=1)
513     global imfig, mp, ax
514     plt.ion()
515     try:
516         imfig+=1
517         mp.suptitle('%s (Figure %i)'%(info,imfig))
518     except:
519         imfig=0
520         mp = plt.figure()
521         ax = mp.add_subplot(1, 1, 1)
522         mp.suptitle('%s (Figure %i)'%(info,imfig))
523         ax.set_xlabel('Step')
524         ax.set_ylabel('Variable')
525     ax.plot(v)
526     plt.show()
527
528 .. index:: single: ValueSerieMatPlotterSaver (Observer)
529
530 Template **ValueSerieMatPlotterSaver**
531 ......................................
532
533 Graphically plot with Matplolib the value series of the variable, and save the figure in a file of the '/tmp' directory (persistant figure).
534
535 ::
536
537     import numpy, re
538     import matplotlib.pyplot as plt
539     v=numpy.array(var[:], ndmin=1)
540     global imfig, mp, ax
541     plt.ion()
542     try:
543         imfig+=1
544         mp.suptitle('%s (Figure %i)'%(info,imfig))
545     except:
546         imfig=0
547         mp = plt.figure()
548         ax = mp.add_subplot(1, 1, 1)
549         mp.suptitle('%s (Figure %i)'%(info,imfig))
550         ax.set_xlabel('Step')
551         ax.set_ylabel('Variable')
552     ax.plot(v)
553     f='/tmp/figure_%s_%05i.pdf'%(info,imfig)
554     f=re.sub(r'\s','_',f)
555     plt.savefig(f)
556     plt.show()
557
558 .. index:: single: ValuePrinterAndMatPlotter (Observer)
559
560 Template **ValuePrinterAndMatPlotter**
561 ......................................
562
563 Graphically plot with Matplolib the current value of the variable (non persistent plot).
564
565 ::
566
567     print(str(info)+' '+str(var[-1]))
568     import numpy
569     import matplotlib.pyplot as plt
570     v=numpy.array(var[-1], ndmin=1)
571     global imfig, mp, ax
572     plt.ion()
573     try:
574         imfig+=1
575         mp.suptitle('%s (Figure %i)'%(info,imfig))
576     except:
577         imfig=0
578         mp = plt.figure()
579         ax = mp.add_subplot(1, 1, 1)
580         mp.suptitle('%s (Figure %i)'%(info,imfig))
581     ax.plot(v)
582     plt.show()
583
584 .. index:: single: ValuePrinterAndMatPlotterSaver (Observer)
585
586 Template **ValuePrinterAndMatPlotterSaver**
587 ...........................................
588
589 Graphically plot with Matplolib the current value of the variable, and save the figure in a file of the '/tmp' directory (persistant figure).
590
591 ::
592
593     print(str(info)+' '+str(var[-1]))
594     import numpy, re
595     import matplotlib.pyplot as plt
596     v=numpy.array(var[-1], ndmin=1)
597     global imfig, mp, ax
598     plt.ion()
599     try:
600         imfig+=1
601         mp.suptitle('%s (Figure %i)'%(info,imfig))
602     except:
603         imfig=0
604         mp = plt.figure()
605         ax = mp.add_subplot(1, 1, 1)
606         mp.suptitle('%s (Figure %i)'%(info,imfig))
607     ax.plot(v)
608     f='/tmp/figure_%s_%05i.pdf'%(info,imfig)
609     f=re.sub(r'\s','_',f)
610     plt.savefig(f)
611     plt.show()
612
613 .. index:: single: ValueSeriePrinterAndMatPlotter (Observer)
614
615 Template **ValueSeriePrinterAndMatPlotter**
616 ...........................................
617
618 Graphically plot with Matplolib the value series of the variable (non persistent plot).
619
620 ::
621
622     print(str(info)+' '+str(var[:]))
623     import numpy
624     import matplotlib.pyplot as plt
625     v=numpy.array(var[:], ndmin=1)
626     global imfig, mp, ax
627     plt.ion()
628     try:
629         imfig+=1
630         mp.suptitle('%s (Figure %i)'%(info,imfig))
631     except:
632         imfig=0
633         mp = plt.figure()
634         ax = mp.add_subplot(1, 1, 1)
635         mp.suptitle('%s (Figure %i)'%(info,imfig))
636         ax.set_xlabel('Step')
637         ax.set_ylabel('Variable')
638     ax.plot(v)
639     plt.show()
640
641 .. index:: single: ValueSeriePrinterAndMatPlotterSaver (Observer)
642
643 Template **ValueSeriePrinterAndMatPlotterSaver**
644 ................................................
645
646 Graphically plot with Matplolib the value series of the variable, and save the figure in a file of the '/tmp' directory (persistant figure).
647
648 ::
649
650     print(str(info)+' '+str(var[:]))
651     import numpy, re
652     import matplotlib.pyplot as plt
653     v=numpy.array(var[:], ndmin=1)
654     global imfig, mp, ax
655     plt.ion()
656     try:
657         imfig+=1
658         mp.suptitle('%s (Figure %i)'%(info,imfig))
659     except:
660         imfig=0
661         mp = plt.figure()
662         ax = mp.add_subplot(1, 1, 1)
663         mp.suptitle('%s (Figure %i)'%(info,imfig))
664         ax.set_xlabel('Step')
665         ax.set_ylabel('Variable')
666     ax.plot(v)
667     f='/tmp/figure_%s_%05i.pdf'%(info,imfig)
668     f=re.sub(r'\s','_',f)
669     plt.savefig(f)
670     plt.show()
671
672 .. index:: single: ValueMean (Observer)
673
674 Template **ValueMean**
675 ......................
676
677 Print on standard output the mean of the current value of the variable.
678
679 ::
680
681     import numpy
682     print(str(info)+' '+str(numpy.nanmean(var[-1])))
683
684 .. index:: single: ValueStandardError (Observer)
685
686 Template **ValueStandardError**
687 ...............................
688
689 Print on standard output the standard error of the current value of the variable.
690
691 ::
692
693     import numpy
694     print(str(info)+' '+str(numpy.nanstd(var[-1])))
695
696 .. index:: single: ValueVariance (Observer)
697
698 Template **ValueVariance**
699 ..........................
700
701 Print on standard output the variance of the current value of the variable.
702
703 ::
704
705     import numpy
706     print(str(info)+' '+str(numpy.nanvar(var[-1])))
707
708 .. index:: single: ValueL2Norm (Observer)
709
710 Template **ValueL2Norm**
711 ........................
712
713 Print on standard output the L2 norm of the current value of the variable.
714
715 ::
716
717     import numpy
718     v = numpy.ravel( var[-1] )
719     print(str(info)+' '+str(float( numpy.linalg.norm(v) )))
720
721 .. index:: single: ValueRMS (Observer)
722
723 Template **ValueRMS**
724 .....................
725
726 Print on standard output the root mean square (RMS), or quadratic mean, of the current value of the variable.
727
728 ::
729
730     import numpy
731     v = numpy.ravel( var[-1] )
732     print(str(info)+' '+str(float( numpy.sqrt((1./v.size)*numpy.dot(v,v)) )))