-
Notifications
You must be signed in to change notification settings - Fork 3
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
Revise constraint! #166
Comments
I have added |
💔
❤️ |
@PierreMartinon did an ugly thing with the computations of the dimensions inside the |
Yeah
Agreed, I did it the quick and dirty way. Definitely room for improvement.
I use it in CTDirect but you can remove it for clarity, no problem.
Not sure what you mean but these 6 are fine for me yes.
I wonder if there may be some misunderstanding here @ocots @jbcaillau Ipopt calls 'box' constraints the very simple form LB <= X <= UB, ie where the constraint function is the variable itself, f:(x,u,v)->(x,u,v) in OCP notations. Everything else goes into the nonlinear constraints LB <= F(X) <= UB. Do we have the same 2 categories in the OCP ? What confuses me is, when you say 'range', do you refer to the indices (argument rg of constraints) or the box (lb,ub) ? |
nlp_constraints actually no ? |
Right. |
gouzi @PierreMartinon the blame was on you, not on poor cotsee 🥹... I'm on it. |
✅ kept
Sorry, should've been more explicit:
Currently updating all this, I can provide aliases in |
@PierreMartinon actually, you already have everything you need just retrieving the size of the bounds returned (together with the functions and ranges) by return (ξl, ξ, ξu), (ηl, η, ηu), (ψl, ψ, ψu), (ϕl, ϕ, ϕu), (θl, θ, θu), (ul, uind, uu), (xl, xind, xu), (vl, vind, vu)
dim_state_con = length(ηl) # same as ηf (this is now @assert-ed) And it would not be very nice (though not crazily costly) to provide individual getters for these informations (one dictionnary run for each info) that can be retrieved once and for all. @ocots I am leveraging this to remove NB. Another step would be to allow in place computations form within |
@ocots replacing julia> x[1:1] = 1
ERROR: ArgumentError: indexed assignment with a single value to possibly many locations is not supported; perhaps use broadcasting `.=` instead? [...]
julia> x[1:1] .= 1
1-element view(::Vector{Int64}, 1:1) with eltype Int64:
1
julia> x[1:2] .= [1, 2]
2-element view(::Vector{Int64}, 1:2) with eltype Int64:
1
2 |
@ocots please review and merge #165 @PierreMartinon closing and going to control-toolbox/CTDirect.jl#120 |
Of course, that's what I did before. The point was to add getters for these dimensions in CTBase ;-) |
@ocots Following this commit:
nlp_constraints
to do it! (does a lot of other things)I suggest to (i) remove the notion of path constraint (sum control + state + mixed, not used, as far as I know), (ii) stick more strictly to the classification we introduced::initial, :final, :boundary, :state, :control, :mixed, :variable
I am having a look at it.
EDIT: path constraint used by @PierreMartinon in
CTDirect.jl
. keeping it.The text was updated successfully, but these errors were encountered: