Skip to content

Control parameter specification for AbstractODESystem, DiscreteSystem #1059

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
merged 12 commits into from
Jul 2, 2021
Merged

Control parameter specification for AbstractODESystem, DiscreteSystem #1059

merged 12 commits into from
Jul 2, 2021

Conversation

cadojo
Copy link
Contributor

@cadojo cadojo commented Jun 18, 2021

Adds control parameter specification, related to #1041. Also adds a control Jacobian cached reference and an associated function. If the calculate_jacobian function generates a state space model A matrix, then the new calculate_control_jacobian function calculates the B matrix.

@ChrisRackauckas @YingboMa what do you think about this design? Thoughts before I proceed? Should I proceed? The rules are...

  1. Control parameters are specified with a kwarg to ODESystem, and are empty by default
  2. Control parameters must be some subset of the parameters of a system (I think this makes sense, since we don't want the control parameters to have their own dynamics)
  3. Users can call calculate_control_jacobian to calculate the Jacobian of the system's dynamics with respect to the control parameters, not with respect to the state variables as is the case in calculate_jacobian

It would be nice to add a generate_statespace function to produce expressions for calculating the tuple A,B. That way, users can easily linearize an ODESystem about any operating point.

@ChrisRackauckas
Copy link
Member

Analogues of this same functionality should be added to SDESystem and DiscreteSystem.

@cadojo
Copy link
Contributor Author

cadojo commented Jun 26, 2021

Added a simple spring-mass-damper test for the control Jacobian, which should pass. Is there anything else y'all would recommend for this PR? I'm thinking a future PR could add the capability of replacing the control parameters with functions in ODEFunction so you can simulate control laws, but I won't be able to help with that until August or so.

@ChrisRackauckas
Copy link
Member

I think this looks good, though note CI is failing. @YingboMa what do you think of the design?

@cadojo cadojo marked this pull request as ready for review June 28, 2021 16:00
@cadojo cadojo changed the title Control parameter specification for AbstractODESystems Control parameter specification for AbstractODESystem, DiscreteSystem Jun 28, 2021
@cadojo
Copy link
Contributor Author

cadojo commented Jun 28, 2021

I don't think the DataDrivenDiffEq integration test failure is related to this PR. Could someone confirm?

@ChrisRackauckas
Copy link
Member

Yes, unrelated. That's the Symbolic arrays stuff.

@cadojo
Copy link
Contributor Author

cadojo commented Jun 30, 2021

I've added the control input to the DiscreteSystem test, hopefully that meets the code coverage requirements.

Edit: Is this code coverage failure an issue with merging this PR? I can try to add more tests, but adding the new control = ... keyword argument to DiscreteSystem tests did not increase (or change at all) the codecov/patch statistic.

@ChrisRackauckas
Copy link
Member

What happens with the controls when the ODEProblem is built? Looks like nothing?

@ChrisRackauckas
Copy link
Member

I guess let's move one step at a time. The ODEProblem step needs a solution to #1088 .

@ChrisRackauckas
Copy link
Member

Now if we do this, we should put a deprecation warning on ControlSystem and remove it.

@cadojo
Copy link
Contributor Author

cadojo commented Jul 1, 2021

Now if we do this, we should put a deprecation warning on ControlSystem and remove it.

Should this be done in this PR?

@ChrisRackauckas
Copy link
Member

Do it in the next.

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.

3 participants