Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)