Skip to content

feat: allow calling generate_control_function with unsimplified system #3699

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

Merged

Conversation

AayushSabharwal
Copy link
Member

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Add any other context about the problem here.

Copy link
Contributor

@baggepinnen baggepinnen left a comment

Choose a reason for hiding this comment

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

This functionality is tested in downstream/test_disturbance_model.jl, it would be nice to verify that those passes since I don't think they run at the moment?

isempty(inputs) && @warn("No unbound inputs were found in system.")
if !iscomplete(sys)
Copy link
Contributor

Choose a reason for hiding this comment

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

sys may be complete without being mtkcompiled?

Copy link
Contributor

Choose a reason for hiding this comment

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

ModelingToolkit.isscheduled is for structural simplification, you can complete without that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I assumed the user may provide a handwritten model in the correct format that they complete without running mtkcompile. If this is not a case we want to handle, then I can just use isscheduled.

@AayushSabharwal
Copy link
Member Author

test_disturbance_model.jl relies on ControlSystemsMTK, so it cannot run at the moment.

@AayushSabharwal AayushSabharwal force-pushed the as/generate-control-func branch from cbb4f22 to 7b87047 Compare June 9, 2025 06:08
@AayushSabharwal
Copy link
Member Author

This PR is also necessary to make docs pass

@ChrisRackauckas ChrisRackauckas merged commit 88bd570 into SciML:master Jun 9, 2025
38 of 49 checks passed
@AayushSabharwal AayushSabharwal deleted the as/generate-control-func branch June 9, 2025 07:27
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.

4 participants