Hi Armando, I cannot reproduce the problem : your script works fine on my computer, both with OT 1.11 and 1.12 in Windows.
I might be wrong, but it may happen that invisible characters were present in the string of the formula. These invisible characters appear when we copy/paste from a PDF. Best regards, Michaël Michaël BAUDIN Ingénieur - Chercheur EDF – R&D Département PRISME 6, quai Watier 78401 CHATOU [email protected]<mailto:[email protected]> Tél. : 01 30 87 81 82 Fax : 01 30 87 82 13 De : [email protected] [mailto:[email protected]] De la part de [email protected] Envoyé : vendredi 14 décembre 2018 17:36 À : [email protected] Objet : [ot-users] Error creating a PCE model from a design experiment 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, pi import openturns as ot # Definition of the Ishigami function dimension = 3 a = 7.0 b = 0.1 input_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_validation Y = 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 thm degree = 6 adaptiveStrategy = ot.FixedStrategy (productBasis , enumerateFunction . getStrataCumulatedCardinal ( degree ) ) projection_strategy = ot.LeastSquaresStrategy () algo = ot.FunctionalChaosAlgorithm( X, Y, distribution , adaptiveStrategy ,projection_strategy ) algo.run() Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse. Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message. Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus. ____________________________________________________ This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message. E-mail communication cannot be guaranteed to be timely secure, error or virus-free.
_______________________________________________ OpenTURNS users mailing list [email protected] http://openturns.org/mailman/listinfo/users
