You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iv = b ==:t?get_t(mod, b) :generate_var(b, :variables)
288
287
prev_iv =get!(dict, :independent_variable) do
289
288
iv
290
289
end
@@ -306,6 +305,20 @@ function generate_var!(dict, a, b, varclass;
306
305
var
307
306
end
308
307
308
+
# Use the `t` defined in the `mod`. When it is unavailable, generate a new `t` with a warning.
309
+
functionget_t(mod, t)
310
+
try
311
+
get_var(mod, t)
312
+
catch e
313
+
if e isa UndefVarError
314
+
@warn("Could not find a predefined `t` in `$mod`; generating a new one within this model.\nConsider defining it or importing `t` (or `t_nounits`, `t_unitful` as `t`) from ModelingToolkit.")
0 commit comments