jonathf / chaospy

Chaospy - Toolbox for performing uncertainty quantification.
https://chaospy.readthedocs.io/
MIT License
433 stars 87 forks source link

Transform dependent distribution #412

Open hamzabuw opened 1 year ago

hamzabuw commented 1 year ago

Hi,

I am trying to implement intrusive Galerkin for Arrhenius equation with dependent kinetic variables. I see that in the docs the transform() function is used on samples obtained from independent _distributionr.

Since in intrusive Galerkin, I am not generating samples but solving the reformulated equation of systems, how can I transform my distribution from dependent to independent? Or is this unreasonable? To my knowledge, the reformulated system of equations would stay the same, but only the polynomial generation and statistical moments have to generated by a transformed independent distribution.

So far using the same function transform() for a distribution gives an error: ValueError: setting an array element with a sequence. The requested array would exceed the maximum number of dimension of 32.

Thank you in advance.

Best regards, Hamza

jonathf commented 1 year ago

That is a hard topic. Transforming from dependent to independent is possible in many cases, but assuming that transformation created, your equation complexity is likely going to be too complicated to handle using intrusive Galerkin. At the very least, you can not use Chaospy to help you with the reformulation.

As for the specific error, you mind posting you operating system, and the version of Python, Chaospy and Numpoly? Also post the full traceback so I know what part of the code is causing it.