Salome HOME
Code and documentation update for ControledFunctionTest
[modules/adao.git] / test / test6704 / Doc_TUI_Exemple_03_en_multifonction.py
index de87ec65b97d85d13979f6c1c2f0785cedc5a12d..c492d51b5698f1ddf9a3fb0f115d2d5a8b84d686 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008-2022 EDF R&D
+# Copyright (C) 2008-2023 EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -39,9 +39,9 @@ gammamin, gammamax = 1.5, 15.5
 def simulation(x):
     "Fonction de simulation H pour effectuer Y=H(X)"
     import numpy
-    __x = numpy.matrix(numpy.ravel(numpy.matrix(x))).T
-    __H = numpy.matrix("1 0 0;0 2 0;0 0 3; 1 2 3")
-    return __H * __x
+    __x = numpy.ravel(x)
+    __H = numpy.array([[1,0,0],[0,2,0],[0,0,3],[1,2,3]])
+    return __H @ __x
 #
 def multisimulation( xserie ):
     yserie = []
@@ -82,7 +82,7 @@ class Test_Adao(unittest.TestCase):
             Algorithm = '3DVAR',
             Parameters = {
                 "Bounds":Bounds,
-                "MaximumNumberOfSteps":100,
+                "MaximumNumberOfIterations":100,
                 "StoreSupplementaryCalculations":[
                     "CostFunctionJ",
                     "CurrentState",
@@ -123,8 +123,6 @@ class Test_Adao(unittest.TestCase):
         print("  L'écart absolu maximal obtenu lors du test est de %.2e."%ecart)
         print("  Les résultats obtenus sont corrects.")
         print("")
-        #
-        return xa
 
 # ==============================================================================
 def assertAlmostEqualArrays(first, second, places=7, msg=None, delta=None):