# ResponseSurface¶

Surrogate Model based on second order response surface equations.

Here is a simple example where the ResponseSurface surrogate is used to approximate the output of a sinusoidal component.

import numpy as np

import openmdao.api as om

prob = om.Problem()

sin_mm = om.MetaModelUnStructuredComp()

prob.setup()

# train the surrogate and check predicted value
sin_mm.options['train:x'] = np.linspace(0, 3.14, 20)
sin_mm.options['train:f_x'] = .5*np.sin(sin_mm.options['train:x'])

prob.set_val('sin_mm.x', 2.1)

prob.run_model()

print(prob.get_val('sin_mm.f_x'))

[0.43075734]