def test__create_integrator_explicit(self): # Make system 1 x = SX.sym('x') t = SX.sym('t') tau = SX.sym('tau') ode = SX(1) sys = DAESystem(x=x, ode=ode, tau=tau, t=t) # Test sys._create_integrator(integrator_type='explicit')
def test__create_integrator_alg_implicit(self): x = SX.sym('x') y = SX.sym('y') t = SX.sym('t') tau = SX.sym('tau') ode = SX(1) alg = y - (5 - t) sys = DAESystem(x=x, y=y, ode=ode, alg=alg, tau=tau, t=t) # Test sys._create_integrator(integrator_type='implicit')
def test__create_integrator_collocation(self): # Make system 1 x = SX.sym('x') y = SX.sym('y') t = SX.sym('t') tau = SX.sym('tau') ode = SX(1) alg = y - (5 - t) sys = DAESystem(x=x, y=y, ode=ode, alg=alg, tau=tau, t=t) # Test sys._create_integrator(integrator_type='collocation')
def test__create_integrator_w_name(self): # Make system 1 x = SX.sym('x') y = SX.sym('y') t = SX.sym('t') tau = SX.sym('tau') ode = SX(1) alg = y - (5 - t) sys = DAESystem(x=x, y=y, ode=ode, alg=alg, tau=tau, t=t) # Test sys._create_integrator(options={"name": "integrator"})
def test__create_integrator_w_integrator_options(self): # Make system 1 x = SX.sym('x') y = SX.sym('y') t = SX.sym('t') tau = SX.sym('tau') ode = SX(1) alg = y - (5 - t) sys = DAESystem(x=x, y=y, ode=ode, alg=alg, tau=tau, t=t) # Test OLD_INTEGRATOR_OPTION = copy.copy(config.INTEGRATOR_OPTIONS) config.INTEGRATOR_OPTIONS = {'abstol': 1e-10} sys._create_integrator(options={'reltol': 1e-10}) config.INTEGRATOR_OPTIONS = OLD_INTEGRATOR_OPTION