@@ -240,33 +240,33 @@ kc = KNITRO.KN_new_lm(lm)
240
240
241
241
KNITRO. KN_add_vars (kc, n)
242
242
243
- ! isempty (initial_guess) && KNITRO. KN_set_var_primal_init_values (kc, initial_guess)
243
+ ! isempty (initial_guess) && KNITRO. KN_set_var_primal_init_values_all (kc, initial_guess)
244
244
245
- KNITRO. KN_set_var_lobnds (kc, collect (Cint, ind_h .- 1 ), zeros (M)) # `h` bounds
246
- KNITRO. KN_set_var_lobnds (kc, collect (Cint, ind_v .- 1 ), fill (1 / 1e4 , M)) # `v` bounds
245
+ KNITRO. KN_set_var_lobnds (kc, M, collect (Cint, ind_h .- 1 ), zeros (M)) # `h` bounds
246
+ KNITRO. KN_set_var_lobnds (kc, M, collect (Cint, ind_v .- 1 ), fill (1 / 1e4 , M)) # `v` bounds
247
247
248
- KNITRO. KN_set_var_lobnds (kc, collect (Cint, ind_θ .- 1 ), fill (deg2rad (- 89 ), M)) # `θ` lower bounds
249
- KNITRO. KN_set_var_upbnds (kc, collect (Cint, ind_θ .- 1 ), fill (deg2rad (89 ), M)) # `θ` upper bounds
248
+ KNITRO. KN_set_var_lobnds (kc, M, collect (Cint, ind_θ .- 1 ), fill (deg2rad (- 89 ), M)) # `θ` lower bounds
249
+ KNITRO. KN_set_var_upbnds (kc, M, collect (Cint, ind_θ .- 1 ), fill (deg2rad (89 ), M)) # `θ` upper bounds
250
250
251
- KNITRO. KN_set_var_lobnds (kc, collect (Cint, ind_γ .- 1 ), fill (deg2rad (- 89 ), M)) # `γ` lower bounds
252
- KNITRO. KN_set_var_upbnds (kc, collect (Cint, ind_γ .- 1 ), fill (deg2rad (89 ), M)) # `γ` upper bounds
251
+ KNITRO. KN_set_var_lobnds (kc, M, collect (Cint, ind_γ .- 1 ), fill (deg2rad (- 89 ), M)) # `γ` lower bounds
252
+ KNITRO. KN_set_var_upbnds (kc, M, collect (Cint, ind_γ .- 1 ), fill (deg2rad (89 ), M)) # `γ` upper bounds
253
253
254
- KNITRO. KN_set_var_lobnds (kc, collect (Cint, ind_α .- 1 ), fill (deg2rad (- 90 ), M)) # `α` lower bounds
255
- KNITRO. KN_set_var_upbnds (kc, collect (Cint, ind_α .- 1 ), fill (deg2rad (90 ), M)) # `α` upper bounds
254
+ KNITRO. KN_set_var_lobnds (kc, M, collect (Cint, ind_α .- 1 ), fill (deg2rad (- 90 ), M)) # `α` lower bounds
255
+ KNITRO. KN_set_var_upbnds (kc, M, collect (Cint, ind_α .- 1 ), fill (deg2rad (90 ), M)) # `α` upper bounds
256
256
257
- KNITRO. KN_set_var_lobnds (kc, collect (Cint, ind_β .- 1 ), fill (deg2rad (- 89 ), M)) # `β` lower bounds
258
- KNITRO. KN_set_var_upbnds (kc, collect (Cint, ind_β .- 1 ), fill (deg2rad (1 ), M)) # `β` upper bounds
257
+ KNITRO. KN_set_var_lobnds (kc, M, collect (Cint, ind_β .- 1 ), fill (deg2rad (- 89 ), M)) # `β` lower bounds
258
+ KNITRO. KN_set_var_upbnds (kc, M, collect (Cint, ind_β .- 1 ), fill (deg2rad (1 ), M)) # `β` upper bounds
259
259
260
- KNITRO. KN_set_var_fxbnds (kc, collect (Cint, ind_t .- 1 ), fill (1.00 , M)) # Fix time steps
260
+ KNITRO. KN_set_var_fxbnds (kc, M, collect (Cint, ind_t .- 1 ), fill (1.00 , M)) # Fix time steps
261
261
262
262
# Fix initial and final conditions
263
263
ind_fixed_vars = [ind_h[1 ]: ind_ψ[1 ]; [ind_h[end ], ind_v[end ], ind_γ[end ]]]
264
264
val_fixed_vars = [hₛ, ϕₛ, θₛ, vₛ, γₛ, ψₛ, hₜ, vₜ, γₜ]
265
- KNITRO. KN_set_var_fxbnds (kc, collect (Cint, ind_fixed_vars .- 1 ), val_fixed_vars)
265
+ KNITRO. KN_set_var_fxbnds (kc, length (val_fixed_vars), collect (Cint, ind_fixed_vars .- 1 ), val_fixed_vars)
266
266
267
267
KNITRO. KN_add_cons (kc, m_dyn)
268
268
269
- KNITRO. KN_set_con_eqbnds (kc, collect (Cint, ind_con_dyn .- 1 ), zeros (m_dyn)) # defects
269
+ KNITRO. KN_set_con_eqbnds (kc, m_dyn, collect (Cint, ind_con_dyn .- 1 ), zeros (m_dyn)) # defects
270
270
271
271
# This callback does not evaluate the objective function. As such,
272
272
# we pass `false` as the second argument to `KN_add_eval_callback()`.
0 commit comments