Last active
April 27, 2019 09:30
-
-
Save aa25desh/a14ebdaf27f8b8f765fa3a672d688144 to your computer and use it in GitHub Desktop.
Task. Add a new section in the LazySets manual
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LazySets | |
Z1=rand(Zonotope,dim=1,num_generators=2) | |
Z2=rand(Zonotope,dim=3,num_generators=5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Plots | |
Z=rand(Zonotope,dim=2,num_generators=4) | |
plot(Z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ZP = Zonotope([1.0, 0.0], [0.1 0.0; 0.0 0.1]) | |
[1.0, 0.2] ∈ ZP | |
∈([1.0, 0.1], ZP) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z.center | |
Z.generators | |
dim(Z) | |
constraints_list(Z) | |
ngens(Z) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z = rand(Zonotope) | |
Z ⊆ Z | |
[Singleton(vi) ⊆ Z for vi in vertices_list(Z)] | |
Zonotope(Z.center, Z.generators/2) ⊆ Z | |
BallInf(zeros(2), 0.1) ⊕ Z.center ⊆ Z | |
BallInf(zeros(2), 1.0) ⊕ Z.center ⊆ Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z2=rand(Zonotope,dim=1,num_generators=1) | |
Z1=rand(Zonotope,dim=2,num_generators=1) | |
CartesianProduct(Z1,Z2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A1=rand(Zonotope,dim=3,num_generators=5) | |
A2=rand(Zonotope,dim=2,num_generators=7) | |
Plot(A2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z1 = rand(Zonotope) | |
Z2 = rand(Zonotope) | |
minkowski_sum(Z1,Z2) isa Zonotope | |
scale(4,Z1) | |
translate(Z1,[1.,2.]) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert(HPolytope,Z1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z = rand(Zonotope) | |
rand(2, 2) * Z # linear map | |
rand(2, 2) * Z ⊕ rand(2) # affine map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using LazySets.Approximations | |
Z1=Zonotpe([0.,0.],[[1.,0],[0.,1.],[1.,1.]]) | |
plot(Z1) | |
C=overapproximate(Z1,Zonotope) | |
plot!(C) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z=Zonotope([0.,0.],[[1.,0.],[0.,1.]]) | |
plot(Z) | |
Z1=Zonotope([0.,0.],[[1.,0],[0.,1.],[1.,1.]]) #add line joining [-[1.,1.] ,[1.,1.]] | |
plot!(Z1) | |
L1 = LineSegment(-[1., 0.], [1.0, 0.0]) | |
plot(L1) | |
L2 = LineSegment(-[0., 1.], [0., 1.]) | |
plot!(L2) | |
L3 = LineSegment(-[1.,1.] ,[1.,1.]) | |
plot!(L3) | |
plot!(L1 ⊕ L2 ⊕ L3, 1e-3) # Zonotope |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d=rand(1,2) | |
d = [0. 1.; 1. 0.] | |
ZL=Zonotope([0.,0.],[[1.,1.],[1.,0.]]) | |
T= linear_map(d,ZL) | |
plot(d) | |
plot!(ZL) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S=rand(Zonotope,dim=2,num_generators=10) | |
reduce_order(S, 4) | |
plot(S) | |
E=reduce_order(S,3) | |
plot!(E) | |
reduce_order(S,2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Z=Zonotope([0.,0.],[[1.,0.],[0.,1.]]) | |
plot(Z) | |
Z1=Zonotpe([0.,0.],[[1.,0],[0.,1.],[1.,1.]]) | |
plot!(Z1) | |
D=CH(Z1,Z2) | |
plot!(D) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M,N=split(S,1) | |
plot(M) | |
plot!(N) | |
M,N=split(S,3) | |
plot(M) | |
plot!(N) | |
M,N=split(S,5) | |
plot(M) | |
plot!(N) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment