Exemplo n.º 1
0
 def test_evolve_constant_load(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'constant_load')
     ptree.put_double('load', 120)
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertAlmostEqual(device.get_voltage()/device.get_current(), -120)
Exemplo n.º 2
0
 def test_hold(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'hold')
     evolve_one_time_step = TimeEvolution.factory(ptree)
     device.evolve_one_time_step_constant_voltage(0.1, 1.4)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_voltage(), 1.4)
Exemplo n.º 3
0
 def test_evolve_constant_voltage(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'constant_voltage')
     ptree.put_double('voltage', 2.1)
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_voltage(), 2.1)
Exemplo n.º 4
0
 def test_evolve_constant_current(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'constant_current')
     ptree.put_double('current', 100e-3)
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_current(), 100e-3)
Exemplo n.º 5
0
 def test_hold(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'hold')
     evolve_one_time_step = TimeEvolution.factory(ptree)
     device.evolve_one_time_step_constant_voltage(0.1, 1.4)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_voltage(), 1.4)
Exemplo n.º 6
0
 def test_evolve_constant_current(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'constant_current')
     ptree.put_double('current', 100e-3)
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_current(), 100e-3)
Exemplo n.º 7
0
 def test_evolve_constant_voltage(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'constant_voltage')
     ptree.put_double('voltage', 2.1)
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_voltage(), 2.1)
Exemplo n.º 8
0
 def test_evolve_constant_load(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'constant_load')
     ptree.put_double('load', 120)
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertAlmostEqual(device.get_voltage() /
                            device.get_current(), -120)
Exemplo n.º 9
0
 def test_rest(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'rest')
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_current(), 0.0)
Exemplo n.º 10
0
 def test_rest(self):
     ptree = PropertyTree()
     ptree.put_string('mode', 'rest')
     evolve_one_time_step = TimeEvolution.factory(ptree)
     evolve_one_time_step(device, 0.1)
     self.assertEqual(device.get_current(), 0.0)