ScEpTIC.emulator.energy.buffer package
Submodules
ScEpTIC.emulator.energy.buffer.capacitor module
- class ScEpTIC.emulator.energy.buffer.capacitor.CapacitorModel(capacitance, voltage_upper_bound, energy_upper_bound)
Bases:
EnergyBufferModel
Capacitor model E = 1/2 C V^2
- calculate_recharge_energy_to_voltage(v_target)
Calculates the energy required to reach the voltage v_target :param v_target: the target voltage :return: the energy required to recharge the energy buffer to v_target
- calculate_recharge_time_to_voltage(v_target, v_supply, eq_r)
Calculates the time required to reach the voltage v_target :param v_target: the target voltage :param v_supply: the voltage of the power supply :param eq_r: the equivalent resistance of the circuit :return: the time required to recharge the energy buffer to v_target
- get_energy_charge(v_supply, t_elapsed, R)
Returns the amount of energy that the energy buffer would recharge from v_supply :param v_supply: voltage of the energy source :param t_elapsed: time elapsed :param R: circuit equivalent resistance
- get_nominal_size()
- Returns:
the energy buffer size in textual representation
- get_size()
- Returns:
the capacitance
- update(voltage_intervals, e_drawn, charge_r, elapsed_time, preserve_voltage=False)
Updates the voltage of the energy buffer (discharge / charge cycles) Note: if discharge is not enabled, the energy buffer level remains constant :param voltage_intervals: list of (voltage, time) :param e_drawn: energy drawn :param charge_r: equivalent resistance of the system when the energy buffer is going to be charged :param elapsed_time: elapsed time :param preserve_voltage: do not update the voltage :return: the energy harvested
- update_size(capacitance, keep_energy_level=False)
Updates the capacitor size :param capacitance: new capacitance :param keep_energy_level: updates the voltage of the capacitor (keeps the energy level)
Module contents
- class ScEpTIC.emulator.energy.buffer.EnergyBufferModel(voltage_upper_bound, energy_upper_bound)
Bases:
VoltageSource
Model of an energy buffer
- calculate_recharge_energy_to_voltage(v_target)
Calculates the energy required to reach the voltage v_target :param v_target: the target voltage :return: the energy required to recharge the energy buffer to v_target
- calculate_recharge_time_to_voltage(v_target, v_supply, eq_r)
Calculates the time required to reach the voltage v_target :param v_target: the target voltage :param v_supply: the voltage of the power supply :param eq_r: the equivalent resistance of the circuit :return: the time required to recharge the energy buffer to v_target
- disable_discharge()
Enable the energy buffer discharge
- enable_discharge()
Enable the energy buffer discharge
- execute_full_refill()
Sets the energy buffer to the maximum level
- get_energy()
- Returns:
current energy level
- get_energy_charge(v_supply, t_elapsed, R)
Returns the amount of energy that the energy buffer would recharge from v_supply :param v_supply: voltage of the energy source :param t_elapsed: time elapsed :param R: circuit equivalent resistance
- get_max_voltage()
- Returns:
the maximum voltage supported by the energy buffer
- get_nominal_size()
- Returns:
the energy buffer size in textual representation
- get_size()
- Returns:
the energy buffer size
- get_usable_energy()
- Returns:
The remaining usable energy (i.e., the one from current voltage level to the voltage lower bound)
- get_usable_voltage()
- Returns:
The difference between current voltage and the voltage lower bound
- get_voltage()
- Returns:
current voltage level
- increment_energy(e)
Increments the energy buffer energy by e and updates the voltage :param e: energy to increment
- increment_voltage(v)
Increments the energy buffer voltage by v and updates the energy level :param v: voltage to increment
- set_energy(new_energy)
Sets the energy buffer energy to e and updates the voltage Note: if new_energy > energy_upper_bound, new_energy = energy_upper_bound
- set_energy_lower_bound(e_min)
Sets the energy lower bound to e_min and updates the voltage lower bound. The energy lower bound corresponds to the energy that cannot be used for useful computation due to a voltage level below the MCU minimum operating voltage :param e_min: minimum energy (string with multiplier or float)
- set_voltage(new_voltage)
Sets the energy buffer voltage to v and updates the energy level Note: if new_voltage > voltage_upper_bound, new_voltage = voltage_upper_bound
- set_voltage_lower_bound(v_min)
Sets the voltage lower bound to v_min and updates the energy lower bound. The voltage lower bound usually corresponds to the voltage at which the MCU shuts down and specifies the level of the energy buffer that cannot be used for useful computation :param v_min: minimum voltage (string with multiplier or float)
- update(voltage_intervals, e_drawn, charge_r, elapsed_time, preserve_voltage=False)
Updates the voltage of the energy buffer (discharge / charge cycles) Note: if discharge is not enabled, the energy buffer level remains constant :param voltage_intervals: list of (voltage, time) :param e_drawn: energy drawn :param charge_r: equivalent resistance of the system when the energy buffer is going to be charged :param elapsed_time: elapsed time :param preserve_voltage: do not update the voltage :return: the energy harvested
- update_size(size)
Updates the energy buffer size :param size: new size