ElectrochemistryAPI

Index

Electrochemistry Components

Ai4EComponentLib.Electrochemistry.CapacitorMethod
Capacitor(; name, C, v_start)

Creates an ideal capacitor.

States:

  • v(t): [V] The voltage across the capacitor, given by D(v) ~ p.i / C

Connectors:

  • p Positive pin
  • n Negative pin

Parameters:

  • C: [F] Capacitance
  • v_start: [V] Initial voltage of capacitor
source
Ai4EComponentLib.Electrochemistry.DC2DCMethod
DC2DC(; name, n, output_type, value)

Component: DC2DC

DC2DC is a device that converts electrical energy of one voltage value into electrical energy of another voltage value in a direct current circuit.

Parameters:

  • n: efficiency of conversion
  • output_type: type of "boost" includes voltage or current or none
  • value: the value of outport

Connectors:

  • in.p Positive pin of the solar panel
  • in.n Negative pin of the solar panel
  • out.p Positive pin of the battery
  • out.n Negative pin of the battery
source
Ai4EComponentLib.Electrochemistry.Lithium_ion_batteriesMethod
Lithium_ion_batteries(
;
    name,
    R_0,
    R_s,
    R_f,
    R_sd,
    C_s,
    C_f,
    C_b,
    SOC2OC
)

Component: lithiumionbatteries with 8 Paramenters

States:

  • v_b: [V] Load voltage
  • i_b: [A] Load current
  • v_s: [V] Voltage through the short transient RC
  • v_f: [V] Voltage through the long transient RC
  • v_soc: [V] Voltage representing SOC(0~1)
  • v_oc: [V] Open circuit voltage

Paramenters:

  • R_0: Series resistor
  • R_s: Short transient resistor
  • R_f: Long transient resistor
  • R_sd: Self-discharge resistor
  • C_s: Short transient capacity
  • C_f: Long transient capacity
  • C_b: Usable capacity
  • SOC2OC: The fitting function of vsoc and voc

Connectors:

  • p Positive pin
  • n Negative pin

Reference: M. Chen, G.A. Rincon-Mora, Accurate electrical battery model capable of predicting runtime and i-v performance, IEEE Trans. Energy Convers. 21 (2) (2006) 504–511, https://doi.org/10.1109/TEC.2006.874229.

source
Ai4EComponentLib.Electrochemistry.MPPT_ControllerMethod
MPPT_Controller(; name, Sampling_time)

Component: MPPT_controller

The MPPT controller can detect the generating voltage of the solar panel in real time, and track the maximum voltage current value (VI), so that the system can charge the battery at the maximum power output.

Parameters:

  • Sampling_time: Voltage sampling time

Connectors:

  • in.p Positive pin of the solar panel
  • in.n Negative pin of the solar panel
  • out.p Positive pin of the battery
  • out.n Negative pin of the battery
source
Ai4EComponentLib.Electrochemistry.OnePortMethod
OnePort(; name, v_start, i_start)

Component with two electrical pins p and n and current i flows from p to n.

From ModelingToolkitStandardLibrary.jl

States:

  • v(t): [V] The voltage across component p.v - n.v
  • i(t): [A] The current passing through positive pin

Parameters:

  • v_start: [V] Initial voltage across the component
  • i_start: [A] Initial current through the component

Connectors:

  • p Positive pin
  • n Negative pin
source
Ai4EComponentLib.Electrochemistry.OnePort_keyMethod
OnePort_key(; name, v_start, i_start)

Component with two electrical pins p and n and current i flows from p to n.

The component does exactly the same thing as the "OnePort" but its variables can not be simplified in the function "structural_simplify"

source
Ai4EComponentLib.Electrochemistry.PEMElectrolyzerMethod
PEMElectrolyzer(; name, τ, I_0, n, u_0, R_sol)

Component: PEMElectrolyzer(Proton Exchange Membranes Electrolyzer)

I-U in Electrolyzer:

\[U_{cell}=U_{0}-\tau \times \sinh \left(\frac{I}{I_{0}(T)}\right)+I \times R_{\text{sol}}(T)\]

Molar Yield of Hydrogen and Oxygen, Molar consumption of water:

\[\begin{aligned} \dot{n}_{H_{2} O} &=\frac{n_{c} I_{e l}}{2 \cdot F} \\ \dot{n}_{H_{2}} &=\frac{n_{c} I_{e l}}{2 \cdot F} \cdot \eta_{f} \\ \dot{n}_{O_{2}} &=\frac{n_{c} I_{e l}}{2 \cdot F} \cdot \eta_{f} \end{aligned}\]

Mass yield of hydrogen[1]:

\[\frac{\mathrm{d}^{2} \dot{m}}{\mathrm{~d} t^{2}}=-2 \zeta \cdot \omega_{n} \frac{\mathrm{d} \dot{m}}{\mathrm{~d} t}-\omega_{n}{ }^{2} \dot{m}+\omega_{n}{ }^{2} M_{H_{2}} n_{H_{2}}\]

States:

  • v(t): [V] Voltage across the Electrolyzer
  • i(t): [A] Current through the Electrolyzer
  • n_H_2(t): [mol/s] Molar Yield of Hydrogen
  • η_f(t): Faraday efficiency, here $η_f = 1$
  • m_H_2(t): [g/s] Mass yield of hydrogen
  • ∂_m_H_2: Derivative of hydrogen mass yield

Parameters:

  • τ: Tafel slope
  • I_0: Exchange Current Density
  • n: Number of electrolyzers in series
  • u_0: Equilibrium potential
  • R_sol: Solution resistance

Inside Variables:

  • ωₙ: Natural frequency of Hydrogen production [1]
  • ζ: Damping ratio of Hydrogen production [1]
  • molarMassH2: [g/mol] Molar mass of hydrogen

Connectors:

  • p Positive pin
  • n Negative pin

Reference:

  • [1]Espinosa-López M, Darras C, Poggi P, et al. Modelling and experimental validation of a 46 kw pem high pressure water electrolyzer[J]. Renewable energy, 2018, 119:160-173.
source
Ai4EComponentLib.Electrochemistry.PhotovoltaicCellMethod
PhotovoltaicCell(; name, I_ph, I_0, a, R_s, R_sh)

Component: PhotovoltaicCell with 5 Paramenters

States:

  • v(t): [V] Voltage across the Cell
  • i(t): [A] Current through the Cell

Paramenters:

  • I_ph: Photocurrent
  • I_0: Reverse saturation current
  • a: Correction factor
  • R_s: Series resistance
  • R_sh: Ohmic resistance

Connectors:

  • p Positive pin
  • n Negative pin

Reference: De Soto W, Klein S A, Beckman W A. Improvement and validation of a model for photovoltaic array performance[J]. Solar energy, 2006, 80(1):78-88.

source
Ai4EComponentLib.Electrochemistry.RealInputMethod
RealInput(; name, nin, u_start)

Connector with one input signal of type Real.

Parameters:

  • nin=1: Number of inputs
  • u_start=0: Initial value for u

States:

  • u: Value of of the connector; if nin=1 this is a scalar
source
Ai4EComponentLib.Electrochemistry.RealOutputMethod
RealOutput(; name, nout, u_start)

Connector with one output signal of type Real.

Parameters:

  • nout=1: Number of inputs
  • u_start=0: Initial value for u

States:

  • u: Value of of the connector; if nout=1 this is a scalar
source
Ai4EComponentLib.Electrochemistry.SecreteMethod
Secrete(data; name, output_type)

Generate secrete signal.

Parameters:

  • data_name: the name of datafile
  • output_type: the type of sample time includes s or min or hour or day

Connectors:

  • u
source
Ai4EComponentLib.Electrochemistry.Super_capacityMethod
Super_capacity(; name, R_0, C_0, K_v, R_2, C_2, R_EPR)

Component: Super_capacity with 6 Paramenters

States:

  • v_b: [V] Load voltage
  • i_b: [A] Load current
  • v_0: [V] Voltage through the capacity of the first branch
  • v_2: [V] Voltage through the capacity of the second branch

Paramenters:

  • R_0: Series resistor of the first branch
  • C_0: Constant capacity of the first branch
  • K_v: Proportionality coefficient term
  • R_2: Series resistor of the second branch
  • C_2: Constant capacity of the second branch
  • REPR: selfdischarge resistor

Connectors:

  • p Positive pin
  • n Negative pin

Reference: R. Faranda, M. Gallina, D.T. Son, A new simplified model of double-layer capacitors, in: Proceedings of the IEEE International Conference on Clean Electrical Power (ICEEP), May 21–23, 2007.https://ieeexplore.ieee.org/abstract/document/4272459/

source
Ai4EComponentLib.Electrochemistry.TwoPortMethod
TwoPort(; name, v1_start, v2_start, i1_start, i2_start)

Component with four electrical pins p1, n1, p2 and n2 Current i1 flows from p1 to n1 and i2 from p2 to n2.

States:

  • v1(t): [V] The voltage across first ports p1.v - n1.v
  • v2(t): [V] The voltage across second ports p2.v - n2.v
  • i1(t): [A] The current passing through positive pin p1
  • i2(t): [A] The current passing through positive pin p2

Parameters:

  • v1_start: [V] Initial voltage across p1 and n1
  • v2_start: [V] Initial voltage across p2 and n2
  • i2_start: [A] Initial current through p1
  • i2_start: [A] Initial current through p2

Connectors:

  • p1 First positive pin
  • p2 Second positive pin
  • n1 First negative pin
  • n2 Second Negative pin
source
Ai4EComponentLib.Electrochemistry.charge_controllerMethod
charge_controller(; name, time, value)

Component: charge_controller

The charge controller can maintain a constant current and change the current at a specific time.

Parameters:

  • time: The time the current is changed
  • value: The value of current after time

Connectors:

  • p Positive pin
  • n Negative pin
source