Skip to content
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

First derivatives of curves give inaccurate results under complex step. #52

Open
anilyil opened this issue Nov 20, 2022 · 0 comments
Open

Comments

@anilyil
Copy link
Contributor

anilyil commented Nov 20, 2022

Description

The getDerivative method in the pyCurve class returns inaccurate derivatives when it is run under complex step mode. This routine is supposed to produce the first derivatives, and if the input coefficients have complex parts, it returns the second derivative in the complex part of the output. However, these complex routines are hand differentiated and differ slightly from the original routines.

One side effect of this, is that the even the real part of the first derivative it returns appears to be wrong when the "complex" routines are used. This can be verified by comparing a FD check on the function value, vs the first derivative with all real coefficients, vs the first derivative with complex coefficients.

I will write a test for this, and if there is actually a bug, will try to fix it. The issue might also be caused by me messing up the data types so the values are not passed properly between fortran and python.

If these type of bugs do exist, then it might also explain the behavior described in #51

Steps to reproduce issue

WIP: will add a test that demonstrates this behavior before fixing this.

Current behavior

Expected behavior

Code versions

  • Operating System:
  • Python:
  • OpenMPI:
  • CGNS:
  • PETSc:
  • Compiler:
  • This repository:
@anilyil anilyil mentioned this issue Nov 20, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant