-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add option to include disturbance args in generate_control_function
#3273
Conversation
Co-authored-by: Aayush Sabharwal <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The updates did not make the test pass. Looking at the generated function julia> f[1]
RuntimeGeneratedFunction(#=in ModelingToolkit=#, #=using ModelingToolkit=#, :((ˍ₋arg1, ˍ₋arg2, ___mtkparameters___, ˍ₋arg4)->begin
#= /home/fredrikb/.julia/packages/SymbolicUtils/jf8aQ/src/code.jl:385 =#
#= /home/fredrikb/.julia/packages/SymbolicUtils/jf8aQ/src/code.jl:386 =#
#= /home/fredrikb/.julia/packages/SymbolicUtils/jf8aQ/src/code.jl:387 =#
begin
begin
begin
begin
begin
#= /home/fredrikb/.julia/packages/SymbolicUtils/jf8aQ/src/code.jl:480 =#
(SymbolicUtils.Code.create_array)(typeof(ˍ₋arg1), nothing, Val{1}(), Val{(1,)}(), (+)((+)(ˍ₋arg2[1], (*)(-1, ˍ₋arg1[1])), (^)(ˍ₋arg4[1], 2)))
end
end
end
end
end
end)) it looks like |
It turns out that it works correctly with |
Ah, right |
104d651
to
a79f4c2
Compare
looks good now, the test failures appear to be old |
Yeah these failures are "expected". I have plans to fix two of them. |
This PR adds the option to include the disturbance inputs as input arguments for the generated function. This is useful when designing state estimators where the noise model is non-additive.
@AayushSabharwal the PR includes a test, which is currently failing, likely because there is a modification to
wrap_array_vars
required.wrap_array_vars
appears long and complicated without any comments or documentation, what does this function do and can it be made easier to extend?