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

Support nonzero scaling for C derivatives #82

Open
vineetbansal opened this issue Jun 21, 2022 · 1 comment
Open

Support nonzero scaling for C derivatives #82

vineetbansal opened this issue Jun 21, 2022 · 1 comment
Assignees

Comments

@vineetbansal
Copy link
Contributor

Unless we set scaling=0 in the derivative unit tests, we observe different results in derivatives w.r.t. the Python implementation. Some helpful comments from Bart:

It makes sense that scaling has a special effect on the C side since data is rescaled there. However, the C side should unscale the results before returning them. Otherwise the differentiation will not work.

For the backward (adjoint) derivative, the results have the shape of the data. I suspect you just need to unscale them using the unscale_data function. (and use (dP, dq, dA, dl, du) instead of (P, q, A, l, u).

For the forward derivative, I believe you should use unscale_solution over (dx, dy) instead of (x, y).

@vineetbansal vineetbansal self-assigned this Jun 21, 2022
@vineetbansal
Copy link
Contributor Author

Update on this: scaling=0 is no longer a requirements for the unit tests. However, this is being done by unscaling P/q/l/u on the C side of things. A better/faster way may have to be found.

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