Skip to content

Constant Power

This page documents the Constant Power (DCP) method.

Experimental

Classes with the experimental_ prefix are things that we're still working on or trying to understand. That means these classes are subject to change.

We welcome any feedback and suggestions before making them a permanent part of PyPalmSens.

pypalmsens.energy.experimental_ConstantPower

Discharge at Constant Power.

Note: This method is experimental and may be subject to change.

This method implements a single step for discharging a battery or capacitor at a constant power rate (Volt x Ampère).

This simulates the demand of electronic devices when performing a specific task, i.e. a smartphone playing a video. While the battery is discharging, its voltage drops and the demanded current increases in order to maintain the set power.

The applied current is refreshed at the defined time interval.

The discharge is finished when the lower target voltage is reached (the lower cut-off voltage limit) or after the defined duration.

Send live I-V versus time at a defined time interval. The discharge current is converted to positive values.

Supported devices:

  • Nexus
  • EmStat4 series (EmStat4S, EmStat4X, MultiEmStat4)

Methods:

  • render

    Render the template with model parameters.

  • to_methodscript

    Convert to MethodSCRIPT class.

Attributes:

  • id (Literal['dcp']) –

    Unique method identifier.

  • power (int) –

    Constant power in Watt (negative for discharging).

  • cutoff (int) –

    A cut-off potential in mV to finish the discharge step.

  • duration (int) –

    The total duration of the experiment in s (if the cut-off limit currents not met).

  • interval (int) –

    The interval time in s of each data point.

  • cell_on_ocp (bool) –

    Turns cell on with the measured OCP (Nexus only).

  • mains_frequency (Literal[50, 60]) –

    Set the DC mains filter in Hz.

id class-attribute instance-attribute

id: Literal['dcp'] = 'dcp'

Unique method identifier.

power class-attribute instance-attribute

power: int = -200

Constant power in Watt (negative for discharging).

cutoff class-attribute instance-attribute

cutoff: int = 2500

A cut-off potential in mV to finish the discharge step.

duration class-attribute instance-attribute

duration: int = Field(3600, ge=0)

The total duration of the experiment in s (if the cut-off limit currents not met).

interval class-attribute instance-attribute

interval: int = Field(1, ge=0)

The interval time in s of each data point.

cell_on_ocp class-attribute instance-attribute

cell_on_ocp: bool = False

Turns cell on with the measured OCP (Nexus only).

mains_frequency class-attribute instance-attribute

mains_frequency: Literal[50, 60] = 50

Set the DC mains filter in Hz.

Adjusts sampling on instrument to account for mains frequency. Set to 50 Hz or 60 Hz depending on your region (default: 50).

render

render() -> str

Render the template with model parameters.

Returns:

  • script ( str ) –

    Complete MethodScript code for this method.

Source code in src/pypalmsens/_methods/energy.py
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def render(self) -> str:
    """Render the template with model parameters.

    Returns
    -------
    script : str
        Complete MethodScript code for this method.
    """
    template = env.get_template(self._template)
    return template.render(
        model=self,
        timestamp=datetime.today().replace(microsecond=0),
        version=__version__,
    )

to_methodscript

to_methodscript() -> MethodScript

Convert to MethodSCRIPT class.

Returns:

Source code in src/pypalmsens/_methods/energy.py
39
40
41
42
43
44
45
46
47
48
def to_methodscript(self) -> MethodScript:
    """Convert to MethodSCRIPT class.

    Returns
    -------
    method: MethodScript
        MethodScript class.
    """
    script = self.render()
    return MethodScript(script=script)