MonomialFunction

class MonomialFunction(*args)

Monomial function class.

Parameters:
degreint

Degree of the monomial function

Notes

The monomial function defines as :

P(x)  = X^n

Examples

Create a standard absolute exponential covariance function:

>>> import openturns as ot
>>> P = ot.MonomialFunction(3)

Methods

draw(xMin, xMax, pointNumber)

Draw the function.

getClassName()

Accessor to the object's name.

getName()

Accessor to the object's name.

gradient(x)

Compute the gradient at point x.

hasName()

Test if the object is named.

hessian(x)

Compute the hessian at point x.

setName(name)

Accessor to the object's name.

__init__(*args)
draw(xMin, xMax, pointNumber)

Draw the function.

Parameters:
x_minfloat, optional

The starting value that is used for meshing the x-axis.

x_maxfloat, optional, x_{\max} > x_{\min}

The ending value that is used for meshing the x-axis.

n_pointsint, optional

The number of points that is used for meshing the x-axis.

Examples

>>> import openturns as ot
>>> from openturns.viewer import View
>>> f = ot.UniVariatePolynomial([1.0, 2.0, -3.0, 5.0])
>>> View(f.draw(-10.0, 10.0, 100)).show()
getClassName()

Accessor to the object’s name.

Returns:
class_namestr

The object class name (object.__class__.__name__).

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

gradient(x)

Compute the gradient at point x.

Returns:
gradientfloat

The value of the monomial’s first-order derivative at point x.

Examples

>>> import openturns as ot
>>> P = ot.MonomialFunction(3)
>>> print(P.gradient(1.0))
3.0
hasName()

Test if the object is named.

Returns:
hasNamebool

True if the name is not empty.

hessian(x)

Compute the hessian at point x.

Parameters:
xfloat

Input value.

Returns:
hessianfloat

The value of the monomial’s second-order derivative at point x.

Examples

>>> import openturns as ot
>>> P = ot.MonomialFunction(3)
>>> print(P.hessian(1.0))
6.0
setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

Examples using the class

Create univariate functions

Create univariate functions