-
-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8561598
commit e968272
Showing
14 changed files
with
147 additions
and
5 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
docs/source/models/submodels/external_circuit/current_control_external_circuit.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Current control external circuit | ||
================================ | ||
|
||
.. autoclass:: pybamm.external_circuit.CurrentControl | ||
:members: | ||
|
5 changes: 5 additions & 0 deletions
5
.../source/models/submodels/external_circuit/function_control_external_circuit.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Function control external circuit | ||
================================= | ||
|
||
.. autoclass:: pybamm.external_circuit.FunctionControl | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
External circuit | ||
================ | ||
|
||
Models to enforce different boundary conditions (as imposed by an imaginary external | ||
circuit) such as constant current, constant voltage, constant power, or any other | ||
relationship between the current and voltage | ||
|
||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
current_control_external_circuit | ||
function_control_external_circuit | ||
power_control_external_circuit | ||
voltage_control_external_circuit |
6 changes: 6 additions & 0 deletions
6
docs/source/models/submodels/external_circuit/power_control_external_circuit.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Power control external circuit | ||
============================== | ||
|
||
.. autoclass:: pybamm.external_circuit.PowerControl | ||
:members: | ||
|
6 changes: 6 additions & 0 deletions
6
docs/source/models/submodels/external_circuit/voltage_control_external_circuit.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Voltage control external circuit | ||
================================ | ||
|
||
.. autoclass:: pybamm.external_circuit.VoltageControl | ||
:members: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
25 changes: 25 additions & 0 deletions
25
tests/unit/test_models/test_submodels/test_external_circuit/test_current_control.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# Test current control submodel | ||
# | ||
|
||
import pybamm | ||
import tests | ||
import unittest | ||
|
||
|
||
class TestCurrentControl(unittest.TestCase): | ||
def test_public_functions(self): | ||
param = pybamm.standard_parameters_lithium_ion | ||
submodel = pybamm.external_circuit.CurrentControl(param) | ||
std_tests = tests.StandardSubModelTests(submodel) | ||
std_tests.test_all() | ||
|
||
|
||
if __name__ == "__main__": | ||
print("Add -v for more debug output") | ||
import sys | ||
|
||
if "-v" in sys.argv: | ||
debug = True | ||
pybamm.settings.debug_mode = True | ||
unittest.main() |
26 changes: 26 additions & 0 deletions
26
tests/unit/test_models/test_submodels/test_external_circuit/test_function_control.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Test function control submodel | ||
# | ||
import numpy as np | ||
import pybamm | ||
import tests | ||
import unittest | ||
|
||
|
||
class TestFunctionControl(unittest.TestCase): | ||
def test_public_functions(self): | ||
param = pybamm.standard_parameters_lithium_ion | ||
submodel = pybamm.external_circuit.FunctionControl(param) | ||
variables = {"Terminal voltage [V]": pybamm.Scalar(0)} | ||
std_tests = tests.StandardSubModelTests(submodel, variables) | ||
std_tests.test_all() | ||
|
||
|
||
if __name__ == "__main__": | ||
print("Add -v for more debug output") | ||
import sys | ||
|
||
if "-v" in sys.argv: | ||
debug = True | ||
pybamm.settings.debug_mode = True | ||
unittest.main() |
26 changes: 26 additions & 0 deletions
26
tests/unit/test_models/test_submodels/test_external_circuit/test_power_control.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Test power control submodel | ||
# | ||
|
||
import pybamm | ||
import tests | ||
import unittest | ||
|
||
|
||
class TestPowerControl(unittest.TestCase): | ||
def test_public_functions(self): | ||
param = pybamm.standard_parameters_lithium_ion | ||
submodel = pybamm.external_circuit.PowerControl(param) | ||
variables = {"Terminal voltage [V]": pybamm.Scalar(0)} | ||
std_tests = tests.StandardSubModelTests(submodel, variables) | ||
std_tests.test_all() | ||
|
||
|
||
if __name__ == "__main__": | ||
print("Add -v for more debug output") | ||
import sys | ||
|
||
if "-v" in sys.argv: | ||
debug = True | ||
pybamm.settings.debug_mode = True | ||
unittest.main() |
26 changes: 26 additions & 0 deletions
26
tests/unit/test_models/test_submodels/test_external_circuit/test_voltage_control.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Test voltage control submodel | ||
# | ||
|
||
import pybamm | ||
import tests | ||
import unittest | ||
|
||
|
||
class TestVoltageControl(unittest.TestCase): | ||
def test_public_functions(self): | ||
param = pybamm.standard_parameters_lithium_ion | ||
submodel = pybamm.external_circuit.VoltageControl(param) | ||
variables = {"Terminal voltage [V]": pybamm.Scalar(0)} | ||
std_tests = tests.StandardSubModelTests(submodel, variables) | ||
std_tests.test_all() | ||
|
||
|
||
if __name__ == "__main__": | ||
print("Add -v for more debug output") | ||
import sys | ||
|
||
if "-v" in sys.argv: | ||
debug = True | ||
pybamm.settings.debug_mode = True | ||
unittest.main() |