.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_functional_modeling/vectorial_functions/plot_composed_function.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_functional_modeling_vectorial_functions_plot_composed_function.py: Create a composed function ========================== .. GENERATED FROM PYTHON SOURCE LINES 7-9 In this example we are going to create a composed function :math:`f\circ g` .. GENERATED FROM PYTHON SOURCE LINES 11-15 .. code-block:: Python import openturns as ot ot.Log.Show(ot.Log.NONE) .. GENERATED FROM PYTHON SOURCE LINES 16-17 assume f, g functions .. GENERATED FROM PYTHON SOURCE LINES 17-20 .. code-block:: Python g = ot.SymbolicFunction(["x1", "x2"], ["x1 + x2", "3 * x1 * x2"]) f = ot.SymbolicFunction(["x1", "x2"], ["2 * x1 - x2"]) .. GENERATED FROM PYTHON SOURCE LINES 21-22 create the composed function .. GENERATED FROM PYTHON SOURCE LINES 22-24 .. code-block:: Python function = ot.ComposedFunction(f, g) .. GENERATED FROM PYTHON SOURCE LINES 25-26 evaluate the function .. GENERATED FROM PYTHON SOURCE LINES 26-29 .. code-block:: Python x = [3.0, 4.0] y = function(x) print("x=", x, "y=", y) .. rst-class:: sphx-glr-script-out .. code-block:: none x= [3.0, 4.0] y= [-22] .. _sphx_glr_download_auto_functional_modeling_vectorial_functions_plot_composed_function.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_composed_function.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_composed_function.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_composed_function.zip `