File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -397,6 +397,11 @@ function input_indices(model::Optimizer)
397
397
end
398
398
399
399
function setup! (model:: Optimizer )
400
+ if any (isnothing, model. dynamic)
401
+ error (" Missing dynamics. i.e. ∂(x) = f(x, u) or Δ(x) = f(x, u)" )
402
+ end
403
+
404
+ println (" >>Setting up the model" )
400
405
input_index = 0
401
406
state_index = 0
402
407
model. nlp_model = MOI. Nonlinear. Model ()
@@ -420,6 +425,7 @@ function setup!(model::Optimizer)
420
425
vars = MOI. VariableIndex .(eachindex (model. lower))
421
426
model. evaluator = MOI. Nonlinear. Evaluator (model. nlp_model, backend, vars)
422
427
MOI. initialize (model. evaluator, Symbol[])
428
+ println (" >>Model setup complete" )
423
429
return
424
430
end
425
431
Original file line number Diff line number Diff line change @@ -146,6 +146,14 @@ function discretized_system(
146
146
end
147
147
148
148
function build_abstraction (concrete_system, model)
149
+ if isnothing (model. state_grid)
150
+ error (" Please set the `state_grid`." )
151
+ end
152
+
153
+ if isnothing (model. input_grid)
154
+ error (" Please set the `input_grid`." )
155
+ end
156
+
149
157
Xfull = DO. DomainList (model. state_grid)
150
158
DO. add_set! (Xfull, concrete_system. X, DO. INNER)
151
159
Ufull = DO. DomainList (model. input_grid)
You can’t perform that action at this time.
0 commit comments