Changeset 13734


Ignore:
Timestamp:
Oct 11, 2019 7:58:28 PM (5 weeks ago)
Author:
Christian Andersson
Message:

Updated tests. Related to ticket:5854

Location:
branches/dev-cw-pyfmi/Python/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-cw-pyfmi/Python/src/pyjmi/examples/if_example_2.py

    r4648 r13734  
    4949    t = res['time']
    5050   
    51     assert N.abs(res.final('x') - 3.5297217)    < 1e-3
    52     assert N.abs(res.final('u') - (-0.2836621)) < 1e-3
     51    assert N.abs(res.final('x') - 3.5297217)    < 1e-2, N.abs(res.final('x') - 3.5297217)
     52    assert N.abs(res.final('u') - (-0.2836621)) < 1e-2, N.abs(res.final('u') - (-0.2836621))
    5353
    5454    if with_plots:
  • branches/dev-cw-pyfmi/Python/src/tests_jmodelica/optimization/test_casadi_collocation.py

    r12770 r13734  
    366366        opts["CVode_options"]["rtol"] = 1e-6
    367367        opts["CVode_options"]["atol"] = 1e-8 * model.nominal_continuous_states
     368        opts["CVode_options"]["maxh"] = 0.0
     369        opts["ncp"] = 0
    368370        init_res = model.simulate(final_time=300, input=('Tc', u_traj),
    369371                                  options=opts)
     
    21252127        opts["CVode_options"]["rtol"] = 1e-6
    21262128        opts["CVode_options"]["atol"] = 1e-8 * model.nominal_continuous_states
     2129        opts["CVode_options"]["maxh"] = 0.0
     2130        opts["ncp"] = 0
    21272131        res = model.simulate(start_time=0., final_time=150., input=opt_input,
    21282132                             options=opts)
  • branches/dev-cw-pyfmi/Python/src/tests_jmodelica/simulation/test_assimulo_interface_fmi.py

    r13366 r13734  
    20022002        opts["CVode_options"]["rtol"] = 1e-4
    20032003        opts["CVode_options"]["atol"] = 1e-6
     2004        opts["CVode_options"]["maxh"] = 0.0
     2005        opts["ncp"] = 0
    20042006        res = bounce.simulate(start_time=2.,final_time=5.,options=opts)
    20052007
     
    20202022        opts["CVode_options"]["rtol"] = 1e-4
    20212023        opts["CVode_options"]["atol"] = 1e-6
     2024        opts["CVode_options"]["maxh"] = 0.0
     2025        opts["ncp"] = 0
    20222026        res = bounce.simulate(final_time=3., options=opts)
    20232027       
     
    20332037        opt["CVode_options"]["rtol"] = 1e-4
    20342038        opt["CVode_options"]["atol"] = 1e-6
     2039        opt["CVode_options"]["maxh"] = 0.0
     2040        opt["ncp"] = 0
    20352041        res = bounce.simulate(final_time=3., options=opt)
    20362042       
     
    20592065        opts["CVode_options"]["rtol"] = 1e-4
    20602066        opts["CVode_options"]["atol"] = 1e-6
     2067        opts["CVode_options"]["maxh"] = 0.0
     2068        opts["ncp"] = 0
    20612069        res = bounce.simulate(final_time=3., options=opts)
    20622070
     
    20702078        #Writing continuous
    20712079        bounce = load_fmu('bouncingBall.fmu', path_to_fmus_me1)
    2072         #bounce.initialize(options={'initialize':False})
    20732080        res = bounce.simulate(final_time=3.,
    2074             options={'initialize':True,'CVode_options':{'iter':'FixedPoint','rtol':1e-6,'atol':1e-6}})
     2081            options={'initialize':True,'ncp':0, 'CVode_options':{'maxh':0.0, 'iter':'FixedPoint','rtol':1e-6,'atol':1e-6}})
    20752082   
    20762083        nose.tools.assert_almost_equal(res.solver.rtol, 0.00000100, 7)
     
    20922099        opts["CVode_options"]["rtol"] = 1e-4
    20932100        opts["CVode_options"]["atol"] = 1e-6
    2094         #bounce.initialize()
     2101        opts["CVode_options"]["maxh"] = 0.0
     2102        opts["ncp"] = 0
    20952103        res = bounce.simulate(final_time=3., options=opts)
    20962104       
     
    20992107       
    21002108        bounce.reset()
    2101         #bounce.initialize()
    2102        
     2109
    21032110        nose.tools.assert_almost_equal(bounce.get('h'), 1.00000,5)
    21042111       
  • branches/dev-cw-pyfmi/Python/src/tests_jmodelica/test_delay.py

    r10318 r13734  
    3838def simulate(fmu, final_time, maxh = None):
    3939    opts = fmu.simulate_options()     
    40     opts['solver'] = 'CVode'           
     40    opts['solver'] = 'CVode'
     41    opts['ncp'] = 0
     42    opts['CVode_options']['maxh'] = 0.0
    4143    if maxh is not None:
    4244        opts['CVode_options']['maxh'] = maxh
  • branches/dev-cw-pyfmi/Python/src/tests_jmodelica/test_fmi_2.py

    r13338 r13734  
    988988        assert opts['initialize']
    989989        assert opts['with_jacobian'] == "Default"
    990         assert opts['ncp'] == 0
    991990
    992991        #Test the result file
Note: See TracChangeset for help on using the changeset viewer.