Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/inputoutput.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ has_var(ex, x) = x ∈ Set(get_variables(ex))
disturbance_inputs = disturbances(sys);
implicit_dae = false,
simplify = false,
split = true,
)

For a system `sys` with inputs (as determined by [`unbound_inputs`](@ref) or user specified), generate functions with additional input argument `u`
Expand Down Expand Up @@ -198,10 +199,11 @@ function generate_control_function(sys::AbstractSystem, inputs = unbound_inputs(
simplify = false,
eval_expression = false,
eval_module = @__MODULE__,
split = true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing this argument with default true is likely breaking considering that the existing default in mtkcompile is false?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked against MTK for the default.

sys::AbstractSystem; additional_passes = [], simplify = false, split = true,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I must have confused the meaning of split in my head, sorry about the noise then :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I dislike having multiple places where a default is defined/ repeated since that can be error prone)

I don't know what pattern mtk follows for these cases if it has one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split=true is whether to use MTKParameters while putting everything into one vector. This has been the default for a bit now.

kwargs...)
isempty(inputs) && @warn("No unbound inputs were found in system.")
if !isscheduled(sys)
sys = mtkcompile(sys; inputs, disturbance_inputs)
sys = mtkcompile(sys; inputs, disturbance_inputs, split)
end
if disturbance_inputs !== nothing
# add to inputs for the purposes of io processing
Expand Down
Loading