Beispiel #1
0
    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')
Beispiel #2
0
    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')
Beispiel #3
0
    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')
Beispiel #4
0
    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"})
Beispiel #5
0
    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