-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lagrange polynomials #45
Comments
The Lagrange polynomials have been experimental so far, but should work fine. What you have found is a bug. I've made a quickfix and I it seems to solve the problem. Please let me know if it works as it should now. |
Hi again and sorry for the late reply, I have run the following tests:
Best, |
Are you getting the following output?
If not are you sure you have updated your verision of the repo. If not:
|
Sorry about that. I pushed it directly to I merged the changes to the |
Hi again, one small thing that I noticed: if one gives as input an array with just one point, then the result is not the expected one, e.g.: I would have expected a constant, e.g. 1.0. Thanks for your time and effort and best regards, |
Thank you. I made the fix for the single point as well now, and added it to development. I consider the issue as close. If that is not the case, feel free to reopen. |
Hi there!
I was trying to use the lagrange_polynomial function which is in chaospy/orthogonal.py. I assume that those are the Lagrange basis polynomials. I have encountered the following issues:
Calling chaospy.orthogonal.lagrange_polynomial([0,1]) (or with any number combination, as long as there is a zero in there) results in the error "raise numpy.linalg.LinAlgError("invertable matrix") LinAlgError: invertable matrix".
Calling chaospy.orthogonal.lagrange_polynomial([1, 2]) results in the polynomials [-q0^2+2.0q0, 0.5q0^2-0.5q0]. However, using the definition of Lagrange polynomials, e.g. https://en.wikipedia.org/wiki/Lagrange_polynomial, one should get [-q0+2.0, q0-1.0].
Therefore, I would like to ask what exactly am I missing in how chaospy constructs Lagrange polynomials?
Best regards,
Dimitris
The text was updated successfully, but these errors were encountered: