-
Notifications
You must be signed in to change notification settings - Fork 6
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
Default values #195
Comments
By the way, how do we organize the default values ? I find it a bit confusing to redefine default values at multiple levels. We could
|
So here: https://github.com/control-toolbox/CTBase.jl/pull/222/files I let This is fine for me also. |
Can you take a look at the end of this comment: control-toolbox/CTBase.jl#222 (comment) With |
You are right for the default values. We already do that here: https://github.com/control-toolbox/CTFlows.jl/blob/main/src/default.jl I will just add a file with the specific default values with docstrings in |
To keep track: # ------------------------------------------------------------------------------------
# Direct methods
"""
$(TYPEDSIGNATURES)
Used to set the default grid size.
The default value is `100`.
"""
__grid_size() = 100
"""
$(TYPEDSIGNATURES)
Used to set the default time grid.
The default value is `nothing`.
"""
__time_grid() = nothing
"""
$(TYPEDSIGNATURES)
Used to set the default tolerance.
The default value is `1e-8`.
"""
__tolerance() = 1e-8
"""
$(TYPEDSIGNATURES)
Used to set the default maximum of iterations.
The default value is `1000`.
"""
__max_iterations() = 1000
# ------------------------------------------------------------------------------------
# IPOPT
"""
$(TYPEDSIGNATURES)
Used to set the default value of the print level of Ipopt for the direct method.
The default va lue is `5`.
"""
__ipopt_print_level() = 5
"""
$(TYPEDSIGNATURES)
Used to set the default value of the μ strategy of Ipopt for the direct method.
The default value is `adaptive`.
"""
__ipopt_mu_strategy() = "adaptive"
"""
$(TYPEDSIGNATURES)
Used to set the default value of the linear solver of Ipopt for the direct method.
The default value is `mumps`.
"""
__ipopt_linear_solver() = "mumps"
# ------------------------------------------------------------------------------------
# MadNLP
"""
$(TYPEDSIGNATURES)
Used to set the default value of the linear solver of MadNLP for the direct method.
The default value is `umfpack`.
"""
__madnlp_linear_solver() = "umfpack" and @testset "Default value for direct solver" begin
@test CTBase.__grid_size_direct() isa Integer
@test isnothing(CTBase.__time_grid_direct())
@test CTBase.__tolerance_direct() < 1
@test CTBase.__max_iterations_direct() isa Integer
@test CTBase.__linear_solver_direct() isa Symbol
end
@testset "Default value of the print level of ipopt for the direct method" begin
@test CTBase.__ipopt_print_level() isa Integer
@test CTBase.__ipopt_print_level() ≤ 12
@test CTBase.__ipopt_print_level() ≥ 0
end
@testset "Default value of the mu strategy of ipopt for the direct method" begin
@test CTBase.__ipopt_mu_strategy() isa String
end |
@ocots I added the default.jl file and tests in |
Replace default values by the ones defined in
CTBase.jl
when the new release is released: control-toolbox/CTBase.jl#220.CTDirect.jl/src/CTDirect.jl
Line 17 in a9ae483
The text was updated successfully, but these errors were encountered: