Skip to content

Commit 53c94fa

Browse files
committed
doc: clear error for bounded parameters
1 parent 1d566e4 commit 53c94fa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/src/manual/mtk.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ function generate_f_h(model, inputs, outputs)
8282
return nothing
8383
end
8484
ic = initial_conditions(io_sys)
85-
p_map = Dict(sym => ic[sym] for sym in p_sym)
85+
p_map = try
86+
Dict(sym => ic[sym] for sym in p_sym)
87+
catch err
88+
if err isa KeyError # the key presumably appears in `bindings(io_sys)`:
89+
error("Non-constant parameter values are not supported (a.k.a. bindings)")
90+
else
91+
rethrow()
92+
end
93+
end
8694
p = ModelingToolkit.varmap_to_vars(p_map, p_sym)
8795
return f!, h!, p, x_sym, p_sym, nu, nx, ny
8896
end

0 commit comments

Comments
 (0)