Hi Folks,
anyone know how to submit constants or coefficients into a python function.
example. I am trying to submit the coefficient as Y below.
I have tried other methods as well with a composite, composed distribution,
and several others. any help would be appreciated
import openturns as ot
def a_function(X):
return [(X[0] + X[1] +X[2] + X[3]) * X[4]]
if __name__ == "__main__":
ot.RandomGenerator.SetSeed(0)
cov = 0.0017
myFunction = ot.PythonFunction(5,1, a_function(Y=cov))
myDistribution = ot.Normal([50.0, 1.0, 10.0, 5.0], [1.0]*4,
ot.IdentityMatrix(4))
vect = ot.RandomVector(myDistribution)
output = ot.RandomVector(myFunction, vect)
sample1 = myDistribution.getSample(10)
print(sample1)
_______________________________________________
OpenTURNS users mailing list
[email protected]
http://openturns.org/mailman/listinfo/users