-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix affine system corner case #223
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is again only some heuristics.
The following does not work both in master
and here.
julia> @system x' = 2 * f(x)
ERROR: ArgumentError: if there is only one term on the right-hand side, the state needs to be contained
Co-authored-by: Christian Schilling <[email protected]>
Yes and no. You could call It might be worth to gather information on how the |
@@ -139,7 +139,9 @@ end | |||
end | |||
|
|||
@testset "@system for affine continuous systems" begin | |||
@test @system(x' = A*x + c) == AffineContinuousSystem(A, c) | |||
b = [1.0] | |||
@test @system(x' = x + b) == AffineContinuousSystem(I(1), b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just checked that the vector form doesn't work (i'll open an issue):
julia> b = rand(10); @system(x' = x + b)
ERROR: AssertionError: checksquare(A) == length(c)
Stacktrace:
[1] AffineContinuousSystem(::IdentityMultiple{Float64}, ::Array{Float64,1}) at /home/mforets/.julia/dev/MathematicalSystems/src/systems.jl:189
[2] top-level scope at REPL[4]:1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please note that in pple the transformation can be done (without manually specifying dim=10
), because the code would generate I(n)
wheren=length(b)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took me too long to figure out, what you meant by pple 😅
Yes, but from my experience it is a bit akward to get the length from the input vector and return it again in a macro.
closes #221
Adding the condition that the stripped system is only parsed as a black-box system, if
f
is not an addition, multiplication or subtraction.