## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• 07:47

schillic on gh-pages

build based on 9184ca9 (compare)

• 07:35

schillic on gh-pages

build based on 3a6cd33 (compare)

• 07:34
lucaferranti synchronize #3036
• 07:34

lucaferranti on lf-spz-linmap

Apply suggestions from code rev… (compare)

• 07:19
lucaferranti edited #3036
• 07:18
lucaferranti synchronize #3036
• 07:18

lucaferranti on lf-spz-linmap

• Aug 08 15:26

schillic on gh-pages

build based on 0790e4a (compare)

• Aug 08 15:12
lucaferranti synchronize #3036
• Aug 08 15:12

lucaferranti on lf-spz-linmap

fix docstrings (compare)

• Aug 08 13:52
lucaferranti edited #3028
• Aug 08 13:40
lucaferranti review_requested #3036
• Aug 08 13:40
lucaferranti review_requested #3036
• Aug 08 13:40
lucaferranti opened #3036
• Aug 08 13:40

lucaferranti on lf-spz-linmap

update linear map for polynomia… (compare)

• Aug 08 13:37

schillic on gh-pages

build based on eb7fa20 (compare)

• Aug 08 13:25
schillic updated the wiki
• Aug 08 13:25

schillic on lf-spz-rename

• Aug 08 13:25
schillic closed #3031
• Aug 08 13:25

schillic on master

rename genmat methods for spz Merge pull request #3035 from J… (compare)

Marcelo Forets
@mforets
it represents the lazy union
Xinyi Yu
@Xinyi-Yu
I see. Then I can use $\subseteq$ function to check for box in union of boxes!
Things are connected!
Thank you so much!
Christian Schilling
@schillic
for intervals the ⊆ should actually already work
Christian Schilling
@schillic
i tried now on another computer and cannot reproduce the error anymore :(
Christian Schilling
@schillic
aha, that error message just occurs when you are not on the right branch
Xinyi Yu
@Xinyi-Yu
I see. It works now. Thank you so much!
Xinyi Yu
@Xinyi-Yu
Hello, everyone, I'm happy to share that $\subseteq$ function works very well in my current one-dimensional case, and I will test two-dimensional case recently. Also, I am wondering could you help me with two quick questions.
1. can we plot a rectangle with different patterns rather than colors only, e.g., north west lines as follows
2. the result of LazySets.Interval(0, 7) ∪ LazySets.Interval(5, 7) has two elements, (0, 7) and (5, 7). Actually, it should be only one (0, 7). The disadvantage of two elements here is that if we want to plot this result with alpha=0.5, darker color will appear at region (5,7) due to the overlap.
Marcelo Forets
@mforets
hmm i guess Plots should have something to choose how to fill the shapes? ?
Xinyi Yu
@Xinyi-Yu
Got it! I'll check docment of Plots.
Xinyi Yu
@Xinyi-Yu
I found it, changing attribute fillstyle. Thank you
Marcelo Forets
@mforets
:thumbsup:
Christian Schilling
@schillic
@Xinyi-Yu: the changes are now available in the latest release of LazySets
Xinyi Yu
@Xinyi-Yu
Got it! It is a great tool and works very well. Thank you so much.
Xinyi Yu
@Xinyi-Yu
Hello everyone, I guess I found one case that $\subseteq$ function doesn't work but it is in the set operation table list in the document. Could you please help me to check it? P = VPolygon([[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]), Q = UnionSetArray([Hyperrectangle([0.0, 0.0],[3.0, 3.0])]), P ⊆ Q
Christian Schilling
@schillic
which document do you mean?
yes, the current implementation only applies to hyperrectangles, but it is actually straightforward to generalize it to polyhedra. i added the code in JuliaReach/LazySets.jl#3012 (you can just define it in your script)
Xinyi Yu
@Xinyi-Yu
The document I mean is website. Maybe I misunderstood it.
Thanks for your great help. It works now. I want to share that it does not support input - UnionSetArray of hyperrectangle. The reason is that isdisjoint of VPolygon and Hyperrectangle doesn't work. I also found the same problem in intersection function several days ago.
After changing input hyperrectangle to HPolyhedron by writing a small function, then they all work very well now.
Christian Schilling
@schillic
ah, yes, UnionSetArray is not a LazySet, and that table is not really up to date
isdisjoint(::VPolygon, ::Hyperrectangle) works for me and so does intersection(::VPolygon, ::Hyperrectangle). do you have examples?
Xinyi Yu
@Xinyi-Yu
Oh, sorry. It's my fault. One is Int64 and one is Float64......
I have another small question. I guess I didn't find the correct method.
I want to find the reachable set at next time with initial state X0 and input U under discrete function f as follows.
@taylorize function f(x⁺, x, u)
x⁺[1] = u[1]
x⁺[2] = u[2]
x⁺[3] = x[1]*x[2]
return x⁺
end
X0 = Hyperrectangle([0,0,0], [1,2,1])
U = Hyperrectangle([0,0],[1,1])
I am trying to construct a ivp as follows and then how to solve it? It seems simple solve doesn't work. (I'm not sure). Or, is there a better way?
@taylorize function f(x⁺, x, p, t)
x⁺[1] = x[4]
x⁺[2] = x[5]
x⁺[3] = x[1]*x[2]
x⁺[4] = zero(x[1])
x⁺[5] = zero(x[1])
return x⁺
end
X0 = Hyperrectangle([0,0,0, 0,0], [1,2,1,1,1])
prob = @ivp(x⁺ = f(x), dim:5, x(0) ∈ X0)
Christian Schilling
@schillic
yeah, sorry about the Int and Float64 thing. we should improve that
unfortunately, we do not support solve for discrete systems, only for continuous systems (i guess the reason is that we never needed it). technically discrete systems are easier to handle than continuous systems, but it is still a bit of work
Xinyi Yu
@Xinyi-Yu
I see. Thank you so much for your explanation.
Marcelo Forets
@mforets

overapproximate(qm::QuadraticMap{N, <:AbstractZonotope}, ::Type{<:Zonotope}) where {N}

(see this page) to propagate the set under f

you could also use sparse polynomial zonotopes..

Xinyi Yu
@Xinyi-Yu
Xinyi Yu
@Xinyi-Yu

Thanks for your help again @mforets . It works for above simple example, but for one item with both x[1] and x[1]*x[2] as follows, it seems that quadraticmap doesn't work.

x_next[1] = x[1] + x[1]*x[2]
x_next[2] = x[2] + x[1]^2

I also tried to solve it by SimpleSparsePolynomialZonotope. It can deal with x[1] + x[1]*x[2], but the default interval of x[1] and x[2] are both [-1,1] and can not change. If I want to consider [25, 30] x [-5,0], it seems too complex to adjust the parameters in SimpleSparsePolynomialZonotope.

Is there a way to solve this case?
Xinyi Yu
@Xinyi-Yu
This is the third case study in our work (maybe also the last one). The first two is well demonstrated by JuliaReach and LazySets and they are 1-d and 2-d simple systems respectively. I can say JuliaReach is the most complete tool in this field I have ever seen, although it is still under developing. In the third case, we want to use a more complex system. For discrete system, it seems hard to compute the reachable set one time instant later, as I said above.
We have an alternative, using continuous systems. Then the question becomes: After solving @ivp, sol = solve(prob, T=10.0), how to get the solution at a specific time from sol, e.g., the solution at instant t=3? I didn't find the answer since the document of Flowpipe is still empty now.
Marcelo Forets
@mforets

it seems that quadraticmap doesn't work.

what do you mean that it doesn't work? can you elaborate?

did you try writing x1' = x1 + x1*x2 and x2' = x2 + x1*x1 as a linear map plus a quadratic map?

the interest about the sparse polynomial zonotope (for this purpose you can try SimpleSparsePolynomialZonotope) is that the quadratic map is computed without approximation
the linear part is the identity, and the quadratic map is given by Q1 = [0 1; 0 0] and Q2 = [1 0; 0 0]
Marcelo Forets
@mforets
assuming that we can write I * X + QuadraticMap([Q1, Q2], X) , such set can be either:
• approximated using SingleSparsePolynomialZonotope (since it uses minkowski sum)
• computed exactly using the exact_sum SparsePolynomialZonotope, which will be added in an upcoming PR

It can deal with x[1] + x[1]*x[2], but the default interval of x[1] and x[2] are both [-1,1] and can not change

Ah, I think I understood what you meant by that. If you want to handle the linear terms as generators, that is also possible. I was proposing to add the linear terms with the quadratic part using set operations. This is cleaner, since you don't have to manually adjust the weights of the generators.

Xinyi Yu
@Xinyi-Yu
Yeah, I can write it as I * X + QuadraticMap([Q1, Q2], X). The advantage of SingleSparsePolynomialZonotope is that It can also deal with higher-order terms, not just quadratic terms. However, if I want to consider the X domain which is not [-1,1], it is too complex to adjust the weights of generators, especially for high order term.
If you want to handle the linear terms as generators, that is also possible. I was proposing to add the linear terms with the quadratic part using set operations.
Glad to hear that. If we can add the linear terms with the quadratic part, it seems we can compute all the reachable set of quadratic discrete-time system. I am wondering when will you (or your group) be able to finish it?
Despite all of this, it seems there is still a long way to achieve reachable set of any polynomial discrete-time system. But I totally understand it, since it is still under developing. Actually, I also tried a tool called CORA in matlab, in which nonlieanr discrete-time system reachable set computation has been well developed. However, except from reachable set computation, I also need some set operations like intersection, union, issubset, in. I can say JuliaReach is the most suitable tool for me to finish our work, but unfortunately I was stuck in this reachable set computation of discrete-time system now.
Xinyi Yu
@Xinyi-Yu
Furthermore, for continous-time system, after solving @ivp, sol = solve(prob, T=10.0), is there any methods to get the solution at a specific time from sol, e.g., the solution at instant t=3?
Christian Schilling
@schillic
@Xinyi-Yu if you used the TMJets algorithm (standard for nonlinear problems), you can just use evaluate(sol, 3.0) as in the example here
for the linear algorithms i think there is no such convenience functionality, but it can be done with some tricks
Xinyi Yu
@Xinyi-Yu
I see! Thank you so much! I'll try it tomorrow.
Marcelo Forets
@mforets
Hi @blegat, just FYI there is a new major LazySets release. Now Union and UnionSetArray subtype LazySet.
So @Xinyi-Yu I hear that you've tried with SimpleSparsePolynomialZonotope, but I'm not sure I understand the issue you mention about adjusting weights.
Besides, we have a now a new set type called SparsePolynomialZonotope which can handle set sums in an exact fashion, so it should give more precise results than the SimpleSparsePolynomialZonotope.
Xinyi Yu
@Xinyi-Yu
I see. Thank you for this information!
Benoît Legat
@blegat
Thanks! We'll try to use that in Dionysos