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

Adding Hybrid System features #395

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

Adding Hybrid System features #395

wants to merge 26 commits into from

Conversation

johnaoga
Copy link
Collaborator

@johnaoga johnaoga commented Nov 13, 2024

@blegat
Copy link
Collaborator

blegat commented Nov 13, 2024

My main concern is how you link the reset map and the guard of a transition in case you have several transitions with the same source mode and same target mode

@constraint(model, guard(mode == 0, mode == 1) => {T <= T_r + δ})
@constraint(model, reset_map(mode == 0, mode == 1) => {Δx == ...})

Maybe we could do something like

t = Transition(model, mode, 0, 1)
@constraint(t, T <= T_r + δ)
@constraint(t, Δx == ...)

This would allow to use JuMP macros to define the guard and reset maps and we just have to define JuMP.add_constraint(::Transition, ...)
If we want to be fancy, we can then add some syntactic sugar to do

add_transition!(model, mode, 0, 1) do t
    @constraint(t, T <= T_r + δ)
    @constraint(t, Δx == ...)
end

where t would also be of type Transition but it looks a bit nicer.
The Transition constructor will also get an argument to specify what type of switching it is.

@johnaoga
Copy link
Collaborator Author

I like this transition thing pretty much, let's go with that.

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