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

MTKModel: Provision to specify the type of System #3526

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ven-k
Copy link
Member

@ven-k ven-k commented Apr 2, 2025

Type of the system can be specified via:

@mtkmodel ModelName::SystemType begin
    ...
end

By default it is ODESystem.

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

Closes #3498

@ven-k ven-k changed the title Provision to specify the type of System MTKModel: Provision to specify the type of System Apr 2, 2025
@ven-k ven-k force-pushed the vkb/system-type branch from aaaa8e0 to e2a95f7 Compare April 2, 2025 14:18
@ven-k ven-k force-pushed the vkb/system-type branch from e2a95f7 to 85b2bca Compare April 2, 2025 15:13
@ChrisRackauckas
Copy link
Member

Instead of this, can we just target System? Is it smart enough to handle DiscreteSystem at this point @AayushSabharwal

@ven-k
Copy link
Member Author

ven-k commented Apr 4, 2025

I found only one method of System which returns ODESystem. But being able to just call it would be convenient.

System is an exported function.
And now it is used to build ODESystem by default
@AayushSabharwal
Copy link
Member

Is it smart enough to handle DiscreteSystem at this point

No, System always creates ODESystem. SDEs are handled in structural simplification.

@ven-k ven-k marked this pull request as ready for review April 4, 2025 06:35
@ven-k
Copy link
Member Author

ven-k commented Apr 6, 2025

The test failures on Julia-Pre version are unrelated to this PR.

I've leveraged System in the macro; so once System is updated no additional changes are required to the macro.

This PR is ready for review (and to decide whether we want to add @mtkmodel ModelName::SystemType begin syntax)

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.

@mtkmodel macro for discrete-time systems
3 participants