Skip to content
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

Analysis of deterministic affine dynamics #378

Closed
schillic opened this issue Dec 2, 2020 · 6 comments · Fixed by #382
Closed

Analysis of deterministic affine dynamics #378

schillic opened this issue Dec 2, 2020 · 6 comments · Fixed by #382
Assignees

Comments

@schillic
Copy link
Member

schillic commented Dec 2, 2020

Is this really not supported?

julia> b = [1.0]
1-element Array{Float64,1}:
 1.0

julia> prob = @ivp(x' = x + b, x(0)  Singleton([1.0]))
InitialValueProblem{LinearControlContinuousSystem{Float64,IdentityMultiple{Float64},IdentityMultiple{Float64}},Singleton{Float64,Array{Float64,1}}}(LinearControlContinuousSystem{Float64,IdentityMultiple{Float64},IdentityMultiple{Float64}}([1.0], [1.0]), Singleton{Float64,Array{Float64,1}}([1.0]))

julia> sol = solve(prob, T=4.0)
ERROR: ArgumentError: the system type LinearControlContinuousSystem{Float64,IdentityMultiple{Float64},IdentityMultiple{Float64}} is currently not supported

Side note (probably an issue with MathematicalSystems):

julia> prob = @ivp(x' = -x + b, x(0)  Singleton([1.0]))
ERROR: LoadError: Base.Meta.ParseError("\"*\" is not a unary operator")
Stacktrace:
 [1] @ivp(::LineNumberNode, ::Module, ::Vararg{Any,N} where N) at .julia/dev/MathematicalSystems/src/macros.jl:970
in expression starting at REPL[19]:1
caused by [exception 1]
Base.Meta.ParseError("\"*\" is not a unary operator")
@mforets
Copy link
Member

mforets commented Dec 2, 2020

true, that kind of system was not supported. we always specified state and input constraints, which in this case should be set by default as univesal set, i added this in #379

there is a new error now,

julia> sol = solve(prob, T=4.0)
ERROR: AssertionError: radius must not be negative
Stacktrace:
 [1] macro expansion at /home/mforets/.julia/dev/LazySets/src/Assertions/Assertions.jl:23 [inlined]
 [2] Hyperrectangle(::Array{Float64,1}, ::Array{Float64,1}; check_bounds::Bool) at /home/mforets/.julia/dev/LazySets/src/Sets/Hyperrectangle.jl:91
 [3] Hyperrectangle at /home/mforets/.julia/dev/LazySets/src/Sets/Hyperrectangle.jl:88 [inlined]
 [4] _symmetric_interval_hull(::LinearMap{Float64,Universe{Float64},Float64,IdentityMultiple{Float64}}) at /home/mforets/.julia/dev/ReachabilityAnalysis/src/Flowpipes/setops.jl:387
 [5] sih(::LinearMap{Float64,Universe{Float64},Float64,IdentityMultiple{Float64}}, ::Val{:concrete}) at /home/mforets/.julia/dev/ReachabilityAnalysis/src/Continuous/discretization.jl:250
 [6] discretize(::InitialValueProblem{ConstrainedLinearControlContinuousSystem{Float64,IdentityMultiple{Float64},IdentityMultiple{Float64},Universe{Float64},ConstantInput{Universe{Float64}}},Singleton{Float64,Array{Float64,1}}}, ::Float64, ::Forward{Val{:base},Val{:interval},Val{:concrete},Val{false}}) at /home/mforets/.julia/dev/ReachabilityAnalysis/src/Continuous/discretization.jl:316
 [7] post(::INT{Float64,Forward{Val{:base},Val{:interval},Val{:concrete},Val{false}}}, ::InitialValueProblem{LinearControlContinuousSystem{Float64,IdentityMultiple{Float64},IdentityMultiple{Float64}},Singleton{Float64,Array{Float64,1}}}, ::IntervalArithmetic.Interval{Float64}; Δt0::IntervalArithmetic.Interval{Float64}, kwargs::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol},NamedTuple{(:T,),Tuple{Float64}}}) at /home/mforets/.julia/dev/ReachabilityAnalysis/src/Algorithms/INT/post.jl:29
 [8] solve(::InitialValueProblem{LinearControlContinuousSystem{Float64,IdentityMultiple{Float64},IdentityMultiple{Float64}},Singleton{Float64,Array{Float64,1}}}; kwargs::Base.Iterators.Pairs{Symbol,Float64,Tuple{Symbol},NamedTuple{(:T,),Tuple{Float64}}}) at /home/mforets/.julia/dev/ReachabilityAnalysis/src/Continuous/solve.jl:61
 [9] top-level scope at REPL[13]:1

@mforets
Copy link
Member

mforets commented Dec 2, 2020

Side note (probably an issue with MathematicalSystems):

yes, i think this one is reported JuliaReach/MathematicalSystems.jl#194

@mforets
Copy link
Member

mforets commented Dec 2, 2020

i take back JuliaReach/MathematicalSystems.jl#221 , that normalization does not apply (because U is the universal set, so discretization fails). on the other hand i think that the proper fix is to make the @ivp macro be more precise, as proposed in JuliaReach/MathematicalSystems.jl#221

@mforets
Copy link
Member

mforets commented Dec 2, 2020

this is an alternative for the OP:

julia> A = hcat(1.0); b = [1.0];

julia> prob = @ivp(AffineContinuousSystem(A, b), x(0)  [1.0]);

julia> sol = solve(prob, T=4.0);

@schillic
Copy link
Member Author

schillic commented Dec 2, 2020

So it is not a problem of this package, sorry. From my side this can be closed.

@mforets
Copy link
Member

mforets commented Dec 11, 2020

The OP is now fixed on the MathematicalSystems.jl side, and we can do

prob = @ivp(x' = x + [1.0], x(0)  Singleton([1.0]))
sol = solve(prob, T=4.0)
plot(sol, vars=(0, 1))

Screenshot from 2020-12-11 17-41-23

i'll add this example as a test before closing the issue.

@mforets mforets self-assigned this Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants