Create a composed functionΒΆ

In this example we are going to create a composed function

f\circ g

[1]:
from __future__ import print_function
import openturns as ot
import math as m
[2]:
# assume f, g functions
g = ot.SymbolicFunction(['x1', 'x2'],
                        ['x1 + x2','3 * x1 * x2'])
f = ot.SymbolicFunction(['x1', 'x2'], ['2 * x1 - x2'])
[3]:
# create the composed function
function = ot.ComposedFunction(f, g)
[4]:
# evaluate the function
x = [3.0, 4.0]
y = function(x)
print('x=', x, 'y=', y)
x= [3.0, 4.0] y= [-22]