Thevenin (moirae.models.thevenin)#

Interface to the Thevenin package

class moirae.models.thevenin.TheveninModel(isothermal: bool = False)#

Bases: CellModel

Connection between Moirae and an ECM model implemented via Thevenin.

Parameters:

isothermal – Whether to treat the system as isothermal

calculate_terminal_voltage(new_inputs: InputQuantities, transient_state: TheveninTransient, asoh: TheveninASOH) OutputQuantities#

Compute expected output (terminal voltage, etc.) of the cell.

Parameters:
  • new_inputs – Inputs at the current time step

  • transient_state – Current transient state

  • asoh – Health parameters of the cell

Returns:

Estimates for all measurable outputs of a cell

update_transient_state(previous_inputs: TheveninInput, new_inputs: TheveninInput, transient_state: TheveninTransient, asoh: TheveninASOH) TheveninTransient#

Update the transient state of a chemical cell

Parameters:
  • previous_inputs – Inputs at the last time step

  • new_inputs – Inputs at the current time step

  • transient_state – Current transient state

  • asoh – Health parameters of the cell

Returns:

A new transient state

Transient and State of Health (moirae.models.thevenin.state)#

Representations for the parameters of a Thenevin model

pydantic model moirae.models.thevenin.state.TheveninASOH#

Bases: HealthVariable

Parameters which describe the parameters of a Thevenin circuit

These parameters match the parameters required to build a thevenin.Model.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Config:
  • arbitrary_types_allowed: bool = True

  • use_attribute_docstrings: bool = True

Fields:
Validators:
  • _check_rc_elements » all fields

field a_therm: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 1#

Heat loss area. Units: m^2

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

Validated by:
field c: Tuple[SOCTempDependentHealth, ...] [Optional]#

Capacitance in all RC elements. Units: F

Validated by:
field c_p: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 1150.0#

Specific heat capacity. Units: J/kg/K

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

Validated by:
field capacity: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 1.0#

Maximum battery capacity. Units: A-hr

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

Validated by:
field ce: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 1.0#

Coulomb efficiency

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

Validated by:
field gamma: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 50.0#

Hysteresis approach rate

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

Validated by:
field h_thermal: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 12#

Convective coefficient. Units: W/m^2/K

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

Validated by:
field m_hyst: SOCDependentHealth [Optional]#

Maximum magnitude of hysteresis. Units: V

Validated by:
field mass: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 0.1#

Total battery mass of a battery. Units: kg

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

Validated by:
field ocv: SOCDependentHealth [Optional]#

Open circuit voltage. Units: V

Validated by:
field r: Tuple[SOCTempDependentHealth, ...] [Optional]#

Resistance all resistors, including both the series resistor and those in RC elements. Units: Ohm

Constraints:
  • min_length = 1

Validated by:
property num_rc_elements: int#
pydantic model moirae.models.thevenin.state.TheveninTransient#

Bases: GeneralContainer

Transient state of the ECM circuit

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field cell_temperature: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 25.0#

Temperature of the battery. Units: °C

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

field eta: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = ()#

Overpotential for the RC elements. Units: V

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

field hyst: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 0.0#

Hysteresis voltage. Units: V

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

field soc: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 0.0#

State of charge for the battery system

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none

classmethod from_asoh(asoh: TheveninASOH, soc: float = 0.0, temp: float = 25.0) TheveninTransient#

Create a transient state appropriate for the circuit defined in a TheveninASOH.

Parameters:
  • asoh – Circuit definition

  • soc – Starting SOC

  • temp – Starting temperature (units: K)

Returns:

A state with the desired SOC, temperature, and all RC elements fully discharged.

Inputs and Outputs (moirae.models.thevenin.ins_outs)#

Inputs and outputs from a Thevenin model

pydantic model moirae.models.thevenin.ins_outs.TheveninInput#

Bases: InputQuantities

Inputs for the Thevenin model

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Config:
  • arbitrary_types_allowed: bool = True

Fields:
field t_inf: _encode_ndarray, return_type=PydanticUndefined, when_used=json-unless-none)] = 25.0#

Environmental temperature (units: °C)

Constraints:
  • func = <function _encode_ndarray at 0x7f7b73e99900>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json-unless-none