Note
Go to the end to download the full example code
Example : Using ottemplatepython moduleΒΆ
This example aims to illustrate how to use the module.
Loading python modules
import openturns as ot
from openturns.viewer import View
import numpy as np
import ottemplate
Using the module to compute power
print(ottemplate.MyClass(3).power(2))
9
Compute power using arrays
array = np.linspace(-5, 5, 101)
values = ottemplate.MyClass(array).power(2.0)
Use of graph objects
graph = ot.Graph('Square function', 'x1', 'x2', True, '')
graph.add(ot.Cloud(array, values))
View(graph).show()
Total running time of the script: (0 minutes 0.271 seconds)