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

Allow to apply Domain callbacks to specified equations only #31

Open
BeastyBlacksmith opened this issue Feb 1, 2018 · 2 comments
Open

Comments

@BeastyBlacksmith
Copy link

Currently Domain callbacks apply to all equations simultaneously. In many use cases you only want to apply them for some equations ( think of a position that should always stay positive but the velocity still should be able to become negative ).

@ChrisRackauckas
Copy link
Member

This can be done with an idxs argument for which indices to apply to, and using views in the actual callback. Should be a pretty easy addition.

@devmotion
Copy link
Member

This should be possible with GeneralDomainCallback. You can e.g. define the residual function such that the residuals for unconstrained states are always 0, that residuals of negative states are 0 if they are negative (u < 0) and u if u > 0, and that residuals of positive states are 0 if they are positive and -u if u < 0.

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

3 participants