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
`f_oop` will have an extra state corresponding to the integrator in the disturbance model. This state will not be affected by any input, but will affect the dynamics from where it enters, in this case it will affect additively from `model.torque.tau.u`.
Copy file name to clipboardExpand all lines: src/systems/diffeqs/odesystem.jl
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -472,7 +472,7 @@ Generates a function that computes the observed value(s) `ts` in the system `sys
472
472
- `eval_expression = false`: If true and `expression = false`, evaluates the returned function in the module `eval_module`
473
473
- `output_type = Array` the type of the array generated by a out-of-place vector-valued function
474
474
- `param_only = false` if true, only allow the generated function to access system parameters
475
-
- `inputs = nothing` additinoal symbolic variables that should be provided to the generated function
475
+
- `inputs = Any[]` additional symbolic variables that should be provided to the generated function
476
476
- `checkbounds = true` checks bounds if true when destructuring parameters
477
477
- `op = Operator` sets the recursion terminator for the walk done by `vars` to identify the variables that appear in `ts`. See the documentation for `vars` for more detail.
478
478
- `throw = true` if true, throw an error when generating a function for `ts` that reference variables that do not exist.
@@ -502,8 +502,8 @@ For example, a function `g(op, unknowns, p..., inputs, t)` will be the in-place
502
502
an array of inputs `inputs` is given, and `param_only` is false for a time-dependent system.
503
503
"""
504
504
functionbuild_explicit_observed_function(sys, ts;
505
-
inputs =nothing,
506
-
disturbance_inputs =nothing,
505
+
inputs =Any[],
506
+
disturbance_inputs =Any[],
507
507
disturbance_argument =false,
508
508
expression =false,
509
509
eval_expression =false,
@@ -576,13 +576,13 @@ function build_explicit_observed_function(sys, ts;
576
576
else
577
577
(unknowns(sys),)
578
578
end
579
-
if inputs===nothing
579
+
ifisempty(inputs)
580
580
inputs = ()
581
581
else
582
582
ps =setdiff(ps, inputs) # Inputs have been converted to parameters, remove those from the parameter list
583
583
inputs = (inputs,)
584
584
end
585
-
ifdisturbance_inputs !==nothing
585
+
if!isempty(disturbance_inputs)
586
586
# Disturbance inputs may or may not be included as inputs, depending on disturbance_argument
# inside the linear region, the function is identity
190
192
@unpack u, y = sat
191
-
lsys, ssys=linearize(sat, [u], [y])
193
+
lsys =linearize(sat, [u], [y])
192
194
@testisempty(lsys.A) # there are no differential variables in this system
193
195
@testisempty(lsys.B)
194
196
@testisempty(lsys.C)
195
197
@test lsys.D[] ==1
196
198
197
-
@test_skip lsyss, _= ModelingToolkit.linearize_symbolic(sat, [u], [y]) # Code gen replaces ifelse with if statements causing symbolic evaluation to fail
199
+
@test_skip lsyss = ModelingToolkit.linearize_symbolic(sat, [u], [y]) # Code gen replaces ifelse with if statements causing symbolic evaluation to fail
0 commit comments