Skip to content
Discussion options

You must be logged in to vote

here's the MWE:

model = InfiniteModel(KNITRO.Optimizer);
@infinite_parameter(model, t  [0., 24.], supports = collect(0.:1.:24.),
                        derivative_method = FiniteDifference(Backward()))
@variable(model, 0.2 .≤ SoCev[n  1:2] .≤ 1, Infinite(t))
@expression(model, ΔSoC[n  1:2], SoCev[n] .- 0.85)
γ = ones(2,length(0.:1.:24.)); γ[:,10:15] .= 0.;
@parameter_function(model, γf[n  1:2] == (t) -> γ[n, round(Int,t+1)])
@objective(model, Min, (sum((γf[n].* ΔSoC[n]).^2 for n  1:2), t))
optimize!(model)
=======================================
           Academic License
       (NOT FOR COMMERCIAL USE)
         Artelys Knitro 14.2.0
=======================================

No sta…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@pulsipher
Comment options

Answer selected by DarioSlaifsteinSk
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants