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

Implement adjoint! function #109

Merged
merged 2 commits into from
Feb 26, 2021
Merged

Implement adjoint! function #109

merged 2 commits into from
Feb 26, 2021

Conversation

frapac
Copy link
Member

@frapac frapac commented Feb 26, 2021

  • add a new function adjoint! to compute the adjoint of the constraints
  • refactor AutoDiff.hessian! to use adjoint!
  • fix evaluation of adjoint for reactive_power_constraints

* currently implemented for `power_balance` and
  `reactive_power_constraints`
* homogeneize signature for AutoDiff.Hessian
@frapac frapac mentioned this pull request Feb 26, 2021
18 tasks
adj_aij = cos_val*adj_cos_val
adj_aij += -sin_val*adj_sin_val
adj_aij = coef_cos * cos_val * adj_inj
adj_aij += coef_sin * sin_val * adj_inj
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could change this to

        adj_aij =   cos_val*adj_sin_val
        adj_aij += -sin_val*adj_cos_va

That would be like an AD machine would write it.

@michel2323 michel2323 merged commit 35df3f2 into ms/adjoint Feb 26, 2021
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

Successfully merging this pull request may close these issues.

2 participants