Esempio n. 1
0
# Initialize symbolic variables
x1, x2, u = sp.symbols('x1,x2,u')

umax = 1
data = { # dynamics
		'x_vars': [x1, x2],
		'u_vars': [u],
		'vector_field': [1, u], 
		
		# domains
		'X': [(x1-(2))*(2-x1), (x2-(-2))*(2-x2)],
		'U': [(u-(-umax))*(umax-u)],
		
		# specification
		'K': [(x1-(-0))*(1-x1), (x2-(-1))*(1-x2)],
		
		# parameters
		'maxdeg' : 10, 
		'tol': 1e-10, 
		'r': 0,  # currently not used
		'alpha': 0.05}


rho = compute_reach_not(data)
fig1 = plt.figure(1)
plot2d_invariance(rho, data, [(umax,), (-umax,)], fig1.gca())

fig2 = plt.figure(2)
plot2d_surf(rho, data, fig2.gca(projection='3d'))

plt.show()
Esempio n. 2
0
tmax = 1
d1max = 0.25
d2max = 0.1
data = { # dynamics
		'x_vars': [x1, x2],
		'd_vars': [d1, d2],
		'vector_field': [-(0.2+d1)*x1-x2, x1-0.2*x2+d2], 
		
		# domains
		'X': [(x1-(-2))*(2-x1), (x2-(-2))*(2-x2)],
		'D': [(d1-(-d1max))*(d1max-d1), (d2-(-d2max))*(d2max-d2)],
		
		# specification
		'K': [(x1-(-1.5))*(1.5-x1), (x2-(-1.5))*(1.5-x2)],
		
		# parameters
		'maxdeg' : 10, 
		'tol': 1e-10, 
		'r': 0,  # currently not used
		'alpha': 0.05}


rho = compute_inv_mosek_not(data)
fig1 = plt.figure(1)
plot2d_invariance(rho, data, list(product([-d1max, d1max], [-d2max, d2max])), fig1.gca())

fig2 = plt.figure(2)
plot2d_surf(rho, data, fig2.gca(projection='3d'))

plt.show()