import numpy as np
from pyrat.algorithm import ASB2008CDC
from pyrat.dynamic_system import NonLinSys
from pyrat.geometry import Zonotope
from pyrat.model import *
from pyrat.util.visualization import plot
system = NonLinSys(Model(vanderpol, [2, 1]))
options = ASB2008CDC.Options()
options.t_end = 3.5
options.step = 0.01
options.tensor_order = 2
options.taylor_terms = 4
options.r0 = [Zonotope([1.4, 2.4], np.diag([0.17, 0.06]))]
options.u = Zonotope.zero(1, 1)
options.u_trans = np.zeros(1)
Zonotope.REDUCE_METHOD = Zonotope.REDUCE_METHOD.GIRARD
Zonotope.ORDER = 50
ti, tp, _, _ = ASB2008CDC.reach(system, options)
tp = [[r.geometry for r in l] for l in tp]
plot(tp, [0, 1])