Skip to content

121 dev return names of examodel state control variable and dynamic constraint#124

Merged
jbcaillau merged 5 commits intomainfrom
121-dev-return-names-of-examodel-state-control-variable-and-dynamic-constraint
Jul 25, 2025
Merged

121 dev return names of examodel state control variable and dynamic constraint#124
jbcaillau merged 5 commits intomainfrom
121-dev-return-names-of-examodel-state-control-variable-and-dynamic-constraint

Conversation

@jbcaillau
Copy link
Copy Markdown
Member

@jbcaillau jbcaillau commented Jul 25, 2025

closes #121

@jbcaillau jbcaillau marked this pull request as draft July 25, 2025 12:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 25, 2025

Breakage test results
Date: 2025-07-25 20:10:38

Name Latest Stable
OptimalControl.jl compat: v0.5.1 compat: v0.2.5

@jbcaillau jbcaillau marked this pull request as ready for review July 25, 2025 19:48
@jbcaillau
Copy link
Copy Markdown
Member Author

@ocots please review

@ocots
Copy link
Copy Markdown
Member

ocots commented Jul 25, 2025

@jbcaillau Ok so it misses multipliers to boundary and path constraints. The rest seems fine for me.

The signature of the method build a solution, that @PierreMartinon uses in CTDirect, is:

function build_solution(
    ocp::Model,
    T::Vector{Float64},
    X::TX,
    U::TU,
    v::Vector{Float64},
    P::TP;
    objective::Float64,
    iterations::Int,
    constraints_violation::Float64,
    message::String,
    status::Symbol,
    successful::Bool,
    path_constraints_dual::TPCD=__constraints(),
    boundary_constraints_dual::Union{Vector{Float64},Nothing}=__constraints(),
    state_constraints_lb_dual::Union{Matrix{Float64},Nothing}=__constraints(),
    state_constraints_ub_dual::Union{Matrix{Float64},Nothing}=__constraints(),
    control_constraints_lb_dual::Union{Matrix{Float64},Nothing}=__constraints(),
    control_constraints_ub_dual::Union{Matrix{Float64},Nothing}=__constraints(),
    variable_constraints_lb_dual::Union{Vector{Float64},Nothing}=__constraints(),
    variable_constraints_ub_dual::Union{Vector{Float64},Nothing}=__constraints(),
) where {
    TX<:Union{Matrix{Float64},Function},
    TU<:Union{Matrix{Float64},Function},
    TP<:Union{Matrix{Float64},Function},
    TPCD<:Union{Matrix{Float64},Function,Nothing},
}

@jbcaillau
Copy link
Copy Markdown
Member Author

exactly. for now seems ok. another hint that we must integrate upgrades between separate repose more seemlessly

@jbcaillau jbcaillau merged commit a73ac29 into main Jul 25, 2025
8 checks passed
@ocots
Copy link
Copy Markdown
Member

ocots commented Jul 25, 2025

@jbcaillau But I am afraid that the plot will bug if there should be dual variables that are missing.

@jbcaillau
Copy link
Copy Markdown
Member Author

be confident

@ocots
Copy link
Copy Markdown
Member

ocots commented Jul 25, 2025

@jbcaillau
Copy link
Copy Markdown
Member Author

@ocots

  • i can pass zeros with the proper size for the missing multipliers
  • plus the default is to not plot path and boundary multipliers, right?

@ocots
Copy link
Copy Markdown
Member

ocots commented Jul 25, 2025

@ocots

  • i can pass zeros with the proper size for the missing multipliers

It is better to provide anything because it won't be plotted in that case. It is better than plotting a zero value.

  • plus the default is to not plot path and boundary multipliers, right?

Path constraints are plotted by default if there exist.
Boundary multipliers are printed if any.

@jbcaillau jbcaillau mentioned this pull request Jul 25, 2025
@jbcaillau jbcaillau deleted the 121-dev-return-names-of-examodel-state-control-variable-and-dynamic-constraint branch July 25, 2025 20:42
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.

[Dev] Return getters for exa state, control, variable and dynamic constraint multipliers

2 participants