Hi,
I will have a lookFYI the script runs with 1.13rc1
Best regards,Sofiane HADDAD
Le mercredi 24 avril 2019 à 15:26:42 UTC+2, armando alexandre
<[email protected]> a écrit :
Hello,
I've been trying to recreate the example in the user cases manual on creating
a PCE model from a design experiment ( section 4.3.4) but I am getting an
error:
return _metamodel.FunctionalChaosAlgorithm_run(self)TypeError:
InvalidArgumentException : Error: the left gradient and the right function have
incompatible input or output dimensions.
The code I am using is given below and I am using OT 1.11. Does anyone have
any idea what can be the problem?
Many thanks for the help, Armando
from math import sin, piimport openturns as ot
# Definition of the Ishigami functiondimension = 3a = 7.0b = 0.1input_variables
= ['xi1', 'xi2', 'xi3', 'a', 'b']formula = ['sin(xi1) + a * (sin(xi2)) ^ 2 + b
* xi3^4 * sin(xi1)']full = ot.SymbolicFunction(input_variables,
formula)ishigami_model = ot.ParametricFunction(full, [3, 4], [a, b])
distribution = ot.ComposedDistribution([ot.Uniform(-pi, pi)] *
dimension)lhs_validation = ot.MonteCarloExperiment(distribution,
100)input_validation = lhs_validation.generate()X = input_validationY =
ishigami_model(input_validation)coll = [ ]for i in range ( dimension):
coll.append(ot.StandardDistributionPolynomialFactory(
distribution.getMarginal(i)))
enumerateFunction = ot.LinearEnumerateFunction( dimension )productBasis =
ot.OrthogonalProductPolynomialFactory( coll , enumerateFunction )# c r e a t e
the algor i thmdegree = 6adaptiveStrategy = ot.FixedStrategy (productBasis ,
enumerateFunction . getStrataCumulatedCardinal ( degree ) )projection_strategy
= ot.LeastSquaresStrategy ()algo = ot.FunctionalChaosAlgorithm( X, Y,
distribution , adaptiveStrategy ,projection_strategy
)algo.run()_______________________________________________
OpenTURNS users mailing list
[email protected]
http://openturns.org/mailman/listinfo/users
_______________________________________________
OpenTURNS users mailing list
[email protected]
http://openturns.org/mailman/listinfo/users