ElectrochemistryAPI
Index
Ai4EComponentLib.Electrochemistry.CapacitorAi4EComponentLib.Electrochemistry.ConductorAi4EComponentLib.Electrochemistry.ConstantAi4EComponentLib.Electrochemistry.Current_sourceAi4EComponentLib.Electrochemistry.DC2DCAi4EComponentLib.Electrochemistry.GroundAi4EComponentLib.Electrochemistry.InductorAi4EComponentLib.Electrochemistry.Lithium_ion_batteriesAi4EComponentLib.Electrochemistry.MPPT_ControllerAi4EComponentLib.Electrochemistry.OnePortAi4EComponentLib.Electrochemistry.OnePort_keyAi4EComponentLib.Electrochemistry.PEMElectrolyzerAi4EComponentLib.Electrochemistry.PhotovoltaicCellAi4EComponentLib.Electrochemistry.PinAi4EComponentLib.Electrochemistry.RealInputAi4EComponentLib.Electrochemistry.RealOutputAi4EComponentLib.Electrochemistry.ResistorAi4EComponentLib.Electrochemistry.SecreteAi4EComponentLib.Electrochemistry.Super_capacityAi4EComponentLib.Electrochemistry.TwoPortAi4EComponentLib.Electrochemistry.Voltage_sourceAi4EComponentLib.Electrochemistry.charge_controllerAi4EComponentLib.Electrochemistry.electronic_loadAi4EComponentLib.Electrochemistry.vari_Resistor
Electrochemistry Components
Ai4EComponentLib.Electrochemistry.Capacitor — MethodCapacitor(; name, C, v_start)
Creates an ideal capacitor.
States:
v(t): [V] The voltage across the capacitor, given byD(v) ~ p.i / C
Connectors:
pPositive pinnNegative pin
Parameters:
C: [F] Capacitancev_start: [V] Initial voltage of capacitor
Ai4EComponentLib.Electrochemistry.Conductor — MethodConductor(; name, G)
Creates an ideal conductor.
States:
See OnePort
Connectors:
pPositive pinnNegative pin
Parameters:
G: [S] Conductance
Ai4EComponentLib.Electrochemistry.Constant — MethodConstant(; name, U)
Generate constant signal.
Parameters:
U: Constant output value
Connectors:
u
Ai4EComponentLib.Electrochemistry.Current_source — MethodCurrent_source(; name)
Acts as an ideal current source with no internal resistance.
States:
See OnePort
Connectors:
pPositive pinnNegative pinuRealInput Input for the current control signal, i.e. `I ~ p.i
Ai4EComponentLib.Electrochemistry.DC2DC — MethodDC2DC(; 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 conversionoutput_type: type of "boost" includesvoltageorcurrentornonevalue: the value of outport
Connectors:
in.pPositive pin of the solar panelin.nNegative pin of the solar panelout.pPositive pin of the batteryout.nNegative pin of the battery
Ai4EComponentLib.Electrochemistry.Ground — MethodGround(; name)
Ground node with the potential of zero and connector g. Every circuit must have one ground node.
From ModelingToolkitStandardLibrary.jl
Connectors:
g
Ai4EComponentLib.Electrochemistry.Inductor — MethodInductor(; name, L, i_start)
Creates an ideal Inductor.
States:
See OnePort
Connectors:
pPositive pinnNegative pin
Parameters:
L: [H] Inductancei_start: [A] Initial current through inductor
Ai4EComponentLib.Electrochemistry.Lithium_ion_batteries — MethodLithium_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 voltagei_b: [A] Load currentv_s: [V] Voltage through the short transient RCv_f: [V] Voltage through the long transient RCv_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:
pPositive pinnNegative 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.
Ai4EComponentLib.Electrochemistry.MPPT_Controller — MethodMPPT_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.pPositive pin of the solar panelin.nNegative pin of the solar panelout.pPositive pin of the batteryout.nNegative pin of the battery
Ai4EComponentLib.Electrochemistry.OnePort — MethodOnePort(; 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 componentp.v - n.vi(t): [A] The current passing through positive pin
Parameters:
v_start: [V] Initial voltage across the componenti_start: [A] Initial current through the component
Connectors:
pPositive pinnNegative pin
Ai4EComponentLib.Electrochemistry.OnePort_key — MethodOnePort_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"
Ai4EComponentLib.Electrochemistry.PEMElectrolyzer — MethodPEMElectrolyzer(; 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 Electrolyzeri(t): [A] Current through the Electrolyzern_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 slopeI_0: Exchange Current Densityn: Number of electrolyzers in seriesu_0: Equilibrium potentialR_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:
pPositive pinnNegative 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.
Ai4EComponentLib.Electrochemistry.PhotovoltaicCell — MethodPhotovoltaicCell(; name, I_ph, I_0, a, R_s, R_sh)
Component: PhotovoltaicCell with 5 Paramenters
States:
v(t): [V] Voltage across the Celli(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:
pPositive pinnNegative 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.
Ai4EComponentLib.Electrochemistry.Pin — MethodPin(; name)
A pin in an analog circuit.
From ModelingToolkitStandardLibrary.jl
States:
v(t): [V] The voltage at this pini(t): [A] The current passing through this pin
Ai4EComponentLib.Electrochemistry.RealInput — MethodRealInput(; name, nin, u_start)
Connector with one input signal of type Real.
Parameters:
nin=1: Number of inputsu_start=0: Initial value foru
States:
u: Value of of the connector; if nin=1 this is a scalar
Ai4EComponentLib.Electrochemistry.RealOutput — MethodRealOutput(; name, nout, u_start)
Connector with one output signal of type Real.
Parameters:
nout=1: Number of inputsu_start=0: Initial value foru
States:
u: Value of of the connector; if nout=1 this is a scalar
Ai4EComponentLib.Electrochemistry.Resistor — MethodResistor(; name, R)
Creates an ideal Resistor following Ohm's Law.
States:
See OnePort
Connectors:
pPositive pinnNegative pin
Parameters:
R: [Ω] Resistance
Ai4EComponentLib.Electrochemistry.Secrete — MethodSecrete(data; name, output_type)
Generate secrete signal.
Parameters:
data_name: the name of datafileoutput_type: the type of sample time includessorminorhourorday
Connectors:
u
Ai4EComponentLib.Electrochemistry.Super_capacity — MethodSuper_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 voltagei_b: [A] Load currentv_0: [V] Voltage through the capacity of the first branchv_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:
pPositive pinnNegative 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/
Ai4EComponentLib.Electrochemistry.TwoPort — MethodTwoPort(; 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 portsp1.v - n1.vv2(t): [V] The voltage across second portsp2.v - n2.vi1(t): [A] The current passing through positive pinp1i2(t): [A] The current passing through positive pinp2
Parameters:
v1_start: [V] Initial voltage across p1 and n1v2_start: [V] Initial voltage across p2 and n2i2_start: [A] Initial current through p1i2_start: [A] Initial current through p2
Connectors:
p1First positive pinp2Second positive pinn1First negative pinn2Second Negative pin
Ai4EComponentLib.Electrochemistry.Voltage_source — MethodVoltage_source(; name)
Acts as an ideal voltage source with no internal resistance.
States:
See OnePort
Connectors:
pPositive pinnNegative pinuRealInput Input for the voltage control signal, i.e.V ~ p.v - n.v
Ai4EComponentLib.Electrochemistry.charge_controller — Methodcharge_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 changedvalue: The value of current aftertime
Connectors:
pPositive pinnNegative pin
Ai4EComponentLib.Electrochemistry.electronic_load — Methodelectronic_load(; name)
Simulated load.
Connectors:
u
Ai4EComponentLib.Electrochemistry.vari_Resistor — Methodvari_Resistor(; name, R)
Creates an Resistor whose value increases with time.
States:
See OnePort
Connectors:
pPositive pinnNegative pin
Parameters:
R: [Ω] Resistance