Skip to content
Energy Systems

energy-systems-ai999x

Power systems and load flow, three-phase power, transformers and machines, solar photovoltaics, wind power, batteries, fuel cells and hydrogen.

79capabilities
10topics
79formulas typeset
8worked examples below
1.0.0version
About this model

What Energy Systems does

Energy Systems (energy-systems-ai999x) is an offline Python package for energy systems. It covers power systems and load flow, three-phase power, transformers and machines, solar photovoltaics, wind power, batteries, fuel cells and hydrogen.

It has 79 capabilities — 79 computational procedures — in 10 topics, the largest being Power systems, Solar resource, Photovoltaics, Wind power, Transformers and Batteries. Ask a question in words with ask(), or call a capability by name with typed inputs with solve(). Every answer carries its value and unit, the steps that produced it and the formula in LaTeX.

When a question is not determined — a value is missing, an input is out of range, or the request is outside the package — it says so and names what it needs, instead of guessing. It runs on an ordinary CPU without a network connection (Python >=3.10), and the same question always gets the same answer.

Install

pip install energy-systems-ai999x
hf download AI999X/energy-systems-ai999x --local-dir energy-systems-ai999x

What it covers

Batteries4Battery pack series-parallel sizing · Battery terminal voltage under constant current (one-RC equivalent circuit) · Peukert exponent and run time at a new discharge current …Fuel cells3Electrical power of a fuel-cell or electrolyser stack · Hydrogen fuel-cell stack: consumption, power and efficiency · Water electrolyser: hydrogen production and energy per kilogramHydrogen3Hydrogen stored in a tank at pressure (real gas) · Isentropic (adiabatic) compression of hydrogen · Minimum (isothermal) work to compress hydrogenMachines4Induction motor breakdown (maximum) torque and starting torque · Induction motor performance from its equivalent circuit · Synchronous generator internal EMF, power angle and regulation …Photovoltaics14Combined PV system losses (PVWatts) · Incidence angle modifier (ASHRAE) · Incidence angle modifier from Fresnel reflection and absorption …Power systems18AC load flow by Newton-Raphson · Base impedance and per-unit impedance · Critical clearing angle and time (equal-area criterion) …Solar resource18Angle of incidence of the sun on a tilted surface · Clear-sky global horizontal irradiance (Haurwitz) · Clear-sky irradiance (Ineichen-Perez with Linke turbidity) …Three-phase power1Balanced three-phase power from line quantitiesTransformers5Load for maximum transformer efficiency · Load sharing between two transformers in parallel · Transformer parameters from open-circuit and short-circuit tests …Wind power9Actuator-disc (momentum theory) rotor performance · Air density at hub height · Annual energy production from a power curve and a Weibull distribution …
Try it

Worked examples

Each question below was put to energy-systems-ai999x and the answer shown is the one it returned, with the steps it took.

Three-phase powerm.ask(…)

Three-phase power: VL = 400 V, IL = 50 A, pf = 0.8, connection = star

P = 27712.81292 W
Q = 20784.60969 var
S = 34641.01615 VA
V_phase = 230.9401077 V
I_phase = 50 A
Show the steps
  1. Balanced three-phase power from line quantities
    P = \sqrt3\,V_L I_L\cos\phi,\quad Q = \sqrt3\,V_L I_L\sin\phi
    with VL = 400 V, IL = 50 A, pf = 0.8, connection = star
    → P = 27712.81292 W, Q = 20784.60969 var, S = 34641.01615 VA, V_phase = 230.9401077 V, I_phase = 50 A
Solar resourcem.ask(…)

Solar position: latitude = 40, longitude = -105, n = 172, clock = 13:00, utc_offset = -7

declination_deg = 23.45204607
eot_min = -1.343724732
hour_angle_deg = 14.66406882
zenith_deg = 20.66003785
elevation_deg = 69.33996215
azimuth_deg = 221.165265
Show the steps
  1. Sun position at a place and local time
    \cos\theta_z = \cos\phi\cos\delta\cos\omega + \sin\phi\sin\delta,\quad \omega = 15^\circ(t_s - 12)
    with latitude = 40, longitude = -105, n = 172, clock = 13, utc_offset = -7
    → declination_deg = 23.45204607, eot_min = -1.343724732, hour_angle_deg = 14.66406882, zenith_deg = 20.66003785, elevation_deg = 69.33996215, azimuth_deg = 221.165265
Wind powerm.ask(…)

Power in the wind: rho = 1.225 kg/m^3, D = 80 m, v = 10 m/s, cp = 0.4

P_wind = 3078760.801 W
P_betz = 1824450.845 W
power_density = 612.5
area = 5026.548246 m^2
P = 1231504.32 W
Show the steps
  1. Power in the wind and the Betz limit
    P = \tfrac12\rho A v^3,\quad P_{max} = \tfrac{16}{27}\cdot\tfrac12\rho A v^3
    with rho = 1.225 kg/m^3, D = 80 m, v = 10 m/s, cp = 0.4
    → P_wind = 3078760.801 W, P_betz = 1824450.845 W, power_density = 612.5 W, area = 5026.548246 m^2, P = 1231504.32 W
Hydrogenm.ask(…)

Hydrogen tank: V = 125 L, p = 700 bar, T = 15 degC

rho = 40.17216108 kg/m^3
Z = 1.466169638
mass = 5.021520135 kg
rho_ideal = 58.89920286 kg/m^3
mass_ideal = 7.362400358 kg
ideal_over_real = 1.466169638
Show the steps
  1. Hydrogen stored in a tank at pressure (real gas)
    p = \rho R T\left(1 + \delta\,\frac{\partial\alpha^r}{\partial\delta}\right),\quad Z = \frac{p}{\rho R T}
    with V = 125 L, p = 700 bar, T = 15 degC
    → rho = 40.17216108 kg/m^3, Z = 1.466169638 kg, mass = 5.021520135 kg, rho_ideal = 58.89920286 kg/m^3, mass_ideal = 7.362400358 kg, ideal_over_real = 1.466169638 kg, energy_LHV_kWh = 167.3289261 kg
Power systemsm.solve(…)
m.solve("energy_economic_dispatch", costs="500 5.3 0.004 200 450; 400 5.5 0.006 150 350; 200 5.8 0.009 100 225", demand=800)
lambda_ = 8.5
P = [400, 250, 150]
cost = 6682.5
Show the steps
  1. Economic dispatch with quadratic costs and limits
    \frac{dC_i}{dP_i} = b_i + 2c_iP_i = \lambda\ \ (P_{min} < P_i < P_{max}),\quad \sum_i P_i = D
    with costs = [500 5.3 0.004 200 450; 400 5.5 0.006 150 350; 200 5.8 0.009 100 225], demand = 800
    → lambda_ = 8.5, P = [400, 250, 150], cost = 6682.5
Batteriesm.ask(…)

Battery pack sizing: V_target = 48 V, E_target = 10 kWh, V_cell = 3.2 V, Q_cell = 100 Ah

N_series = 15
N_parallel = 3
N_cells = 45
V_pack = 48 V
E_pack_kWh = 14.4
Q_pack_Ah = 300
Show the steps
  1. Battery pack series-parallel sizing
    N_s = \left\lceil\frac{V_{pack}}{V_{cell}}\right\rceil,\quad N_p = \left\lceil\frac{E_{pack}}{N_s V_{cell} Q_{cell}}\right\rceil
    with V_target = 48 V, E_target = 10 kWh, V_cell = 3.2 V, Q_cell = 360000 C
    → N_series = 15, N_parallel = 3, N_cells = 45, V_pack = 48 V, E_pack_kWh = 14.4, Q_pack_Ah = 300
Fuel cellsm.ask(…)

Electrolyser: I = 192970.66424 A, N = 1, V_cell = 2 V

H2_kg_s = 0.00201588 kg/s
H2_kg_h = 7.257168
O2_kg_s = 0.0159994 kg/s
H2O_kg_s = 0.01801528 kg/s
specific_energy_kWh_per_kg = 53.18070747
efficiency_HHV = 0.7405944347
Show the steps
  1. Water electrolyser: hydrogen production and energy per kilogram
    \frac{E}{m_{H_2}} = \frac{2FV_{cell}}{\eta_F M_{H_2}}
    with I = 192970.6642 A, N = 1, V_cell = 2 V
    → H2_kg_s = 0.00201588 kg/s, H2_kg_h = 7.257168, O2_kg_s = 0.0159994 kg/s, H2O_kg_s = 0.01801528 kg/s, specific_energy_kWh_per_kg = 53.18070747, efficiency_HHV = 0.7405944347, efficiency_LHV = 0.6265874685
Machinesm.ask(…)

Induction motor breakdown torque: VL = 460 V, f = 60 Hz, poles = 4, R1 = 0 ohm, X1 = 1 ohm, R2 = 0.2 ohm, X2 = 1 ohm, Xm = 1e12 ohm, connection = star

s_maxT = 0.1
T_max = 280.6432163 N*m
T_start = 55.57291412 N*m
I_start = 132.1315476 A
V_th = 265.5811238 V
R_th = 0 ohm
Show the steps
  1. Induction motor breakdown (maximum) torque and starting torque
    s_{max} = \frac{R_2}{\sqrt{R_{th}^2 + (X_{th} + X_2)^2}},\quad T_{max} = \frac{3V_{th}^2}{2\omega_s\left[R_{th} + \sqrt{R_{th}^2 + (X_{th}+X_2)^2}\right]}
    with VL = 460 V, f = 60 Hz, poles = 4, R1 = 0 ohm, X1 = 1 ohm, R2 = 0.2 ohm, X2 = 1 ohm, Xm = 1e+12 ohm, connection = star
    → s_maxT = 0.1 N*m, T_max = 280.6432163 N*m, T_start = 55.57291412 N*m, I_start = 132.1315476 A, V_th = 265.5811238 V, R_th = 0 ohm, X_th = 1 ohm
Use it

From Python or the command line

Every snippet was run as shown; the output under it is what it printed.

import energy_systems_ai999x as m

a = m.ask("Three-phase power: VL = 400 V, IL = 50 A, pf = 0.8, connection = star")
print(a.outcome)
print(a.values)
for step in a.steps:
    print(step["name"])
Output
SOLVED
{'P': 27712.8129211, 'Q': 20784.6096908, 'S': 34641.0161514, 'V_phase': 230.940107676, 'I_phase': 50.0}
Balanced three-phase power from line quantities
Figures

Computed, not drawn by hand

Every value in these figures was computed by the package, each point a run of solve(); in a notebook, plot() and plot_relation() draw a capability's curves the same way.

Photovoltaic module: current–voltage curve and maximum power

\frac{dP}{dV} = 0,\quad FF = \frac{I_{mp}V_{mp}}{I_{sc}V_{oc}}
Photovoltaic module: current–voltage curve and maximum powerCurrent–voltage curve of a PV module (single-diode model: photocurrent 9 A, saturation current 1.0000e-10 A, Rs = 0.3 Ω, Rsh = 400 Ω), computed by the package at 81 voltages. The shaded rectangle is the maximum power the package finds, P = 335.252 W at V = 39.6025 V, I = 8.46542 A; it fills 0.778276 of Isc × Voc (8.99326 A × 47.8984 V), the fill factor.0204002.557.5MPP 39.6025 V, 8.46542 Amaximum power Vmp × Imp = 335.252 Wcurrent I(V)Isc and VocV — module voltage [V]I — current [A]
Current–voltage curve of a PV module (single-diode model: photocurrent 9 A, saturation current 1.0000e-10 A, Rs = 0.3 Ω, Rsh = 400 Ω), computed by the package at 81 voltages. The shaded rectangle is the maximum power the package finds, P = 335.252 W at V = 39.6025 V, I = 8.46542 A; it fills 0.778276 of Isc × Voc (8.99326 A × 47.8984 V), the fill factor.

Wind turbine power curve

P(v) = P_i + (P_{i+1} - P_i)\frac{v - v_i}{v_{i+1} - v_i}
Wind turbine power curveWind turbine output against wind speed from the tabulated power curve (speeds 3, 5, 8, 12, 25 m/s, powers 0, 150, 800, 2000, 2000 kW), computed by the package at 121 speeds from 0 to 30 m/s: nothing below cut-in at 3 m/s, rated 2000 kW up to cut-out at 25 m/s, nothing above. Marked: v = 6.5 m/s, P = 475 kW.01020300500100015002000cut-in 3 m/scut-out 25 m/s475 kWpower curvetabulated pointsv — wind speed at hub height [m/s]P — electrical output [kW]
Wind turbine output against wind speed from the tabulated power curve (speeds 3, 5, 8, 12, 25 m/s, powers 0, 150, 800, 2000, 2000 kW), computed by the package at 121 speeds from 0 to 30 m/s: nothing below cut-in at 3 m/s, rated 2000 kW up to cut-out at 25 m/s, nothing above. Marked: v = 6.5 m/s, P = 475 kW.

The Sun's path across the sky: polar sky chart

\cos\theta_z = \cos\phi\cos\delta\cos\omega + \sin\phi\sin\delta,\quad \omega = 15^\circ(t_s - 12)
The Sun's path across the sky: polar sky chartThe Sun's path across the sky at latitude 40°, longitude -105° (UTC-7) on three days: azimuth around the rim (N at the top) and elevation inward (rings at 0°, 30° and 60°), computed by the package every 15 minutes while the Sun is up; dots every 2 h of clock time. Highest computed elevations: 21 June 73.4496°, 22 March 50.2928°, 21 December 26.5781°. Marked: 21 June at 13 h, elevation 69.34°, azimuth 221.165°.elev. 60°elev. 30°elev. 0°NESW6 h8 h10 h12 h14 h16 h18 h69.34°21 June22 March21 Decembersky chart: centre = overhead, rim = horizon
The Sun's path across the sky at latitude 40°, longitude -105° (UTC-7) on three days: azimuth around the rim (N at the top) and elevation inward (rings at 0°, 30° and 60°), computed by the package every 15 minutes while the Sun is up; dots every 2 h of clock time. Highest computed elevations: 21 June 73.4496°, 22 March 50.2928°, 21 December 26.5781°. Marked: 21 June at 13 h, elevation 69.34°, azimuth 221.165°.

Economic dispatch: three generators sharing a load

\frac{dC_i}{dP_i} = b_i + 2c_iP_i = \lambda\ \ (P_{min} < P_i < P_{max}),\quad \sum_i P_i = D
Economic dispatch: three generators sharing a loadEconomic dispatch of 3 generators with quadratic cost curves (rows a, b, c, Pmin, Pmax: 500 5.3 0.004 200 450; 400 5.5 0.006 150 350; 200 5.8 0.009 100 225) meeting a demand of 800 MW: the package returns outputs 400, 250, 150 MW (bars, dashed lines the limits) at a common incremental cost λ = 8.5 per MWh, total cost 6682.5 per hour.0100200300400unit 1unit 2unit 3400 MW250 MW150 MWlimitsdispatched outputgeneratoroutput [MW]
Economic dispatch of 3 generators with quadratic cost curves (rows a, b, c, Pmin, Pmax: 500 5.3 0.004 200 450; 400 5.5 0.006 150 350; 200 5.8 0.009 100 225) meeting a demand of 800 MW: the package returns outputs 400, 250, 150 MW (bars, dashed lines the limits) at a common incremental cost λ = 8.5 per MWh, total cost 6682.5 per hour.

Wind speed with height: the shear profile as arrows

v_2 = v_1\,\frac{\ln\left((h_2 - 0.7d)/z_0\right)}{\ln\left((h_1 - 0.7d)/z_0\right)}
Wind speed with height: the shear profile as arrowsWind speed at nine heights extrapolated from 5 m/s measured at 10 m, drawn as arrows whose length is the speed: logarithmic law (roughness length 1 m) and power law (exponent 0.333333), each computed by the package. At 100 m: 10 and 10.7722 m/s; at 150 m: 10.8805 and 12.3311 m/s.0510050100150logarithmic lawpower lawv — wind speed [m/s]h — height above ground [m]
Wind speed at nine heights extrapolated from 5 m/s measured at 10 m, drawn as arrows whose length is the speed: logarithmic law (roughness length 1 m) and power law (exponent 0.333333), each computed by the package. At 100 m: 10 and 10.7722 m/s; at 150 m: 10.8805 and 12.3311 m/s.
Formulas

The mathematics inside

12 of its 79 formulas; every one is in the capability browser below.

Balanced three-phase power from line quantities
P = \sqrt3\,V_L I_L\cos\phi,\quad Q = \sqrt3\,V_L I_L\sin\phi
Sun position at a place and local time
\cos\theta_z = \cos\phi\cos\delta\cos\omega + \sin\phi\sin\delta,\quad \omega = 15^\circ(t_s - 12)
Power in the wind and the Betz limit
P = \tfrac12\rho A v^3,\quad P_{max} = \tfrac{16}{27}\cdot\tfrac12\rho A v^3
Hydrogen stored in a tank at pressure (real gas)
p = \rho R T\left(1 + \delta\,\frac{\partial\alpha^r}{\partial\delta}\right),\quad Z = \frac{p}{\rho R T}
Economic dispatch with quadratic costs and limits
\frac{dC_i}{dP_i} = b_i + 2c_iP_i = \lambda\ \ (P_{min} < P_i < P_{max}),\quad \sum_i P_i = D
Battery pack series-parallel sizing
N_s = \left\lceil\frac{V_{pack}}{V_{cell}}\right\rceil,\quad N_p = \left\lceil\frac{E_{pack}}{N_s V_{cell} Q_{cell}}\right\rceil
Water electrolyser: hydrogen production and energy per kilogram
\frac{E}{m_{H_2}} = \frac{2FV_{cell}}{\eta_F M_{H_2}}
Induction motor breakdown (maximum) torque and starting torque
s_{max} = \frac{R_2}{\sqrt{R_{th}^2 + (X_{th} + X_2)^2}},\quad T_{max} = \frac{3V_{th}^2}{2\omega_s\left[R_{th} + \sqrt{R_{th}^2 + (X_{th}+X_2)^2}\right]}
Battery terminal voltage under constant current (one-RC equivalent circuit)
V_t(t) = V_{oc} - IR_0 - IR_1\left(1 - e^{-t/R_1C_1}\right)
Isentropic (adiabatic) compression of hydrogen
s(p_2, T_2) = s(p_1, T_1),\quad w = h_2 - h_1
Induction motor performance from its equivalent circuit
T_{ind} = \frac{3 I_2^2 R_2/s}{\omega_s},\quad n_s = \frac{120 f}{p}
Capabilities

Every capability, with an example

Search by name, formula, input or topic. Each capability opens to show what it takes, what it returns, when it applies, and a question it answered.

79 capabilities

Batteries 4

Battery pack series-parallel sizingenergy_battery_pack_sizing

The number of cells in series to reach a pack voltage and of strings in parallel to reach a pack energy, with the resulting pack voltage, energy and capacity (fewest cells; nominal values).

N_s = \left\lceil\frac{V_{pack}}{V_{cell}}\right\rceil,\quad N_p = \left\lceil\frac{E_{pack}}{N_s V_{cell} Q_{cell}}\right\rceil

Inputs

  • V_target required nominal pack voltage [V]
  • E_target required pack energy (Wh or kWh) [J]
  • V_cell nominal cell voltage [V]
  • Q_cell cell capacity (Ah accepted) [C]

Returns

  • N_series cells in series
  • N_parallel strings in parallel
  • N_cells total cells
  • V_pack nominal pack voltage [V]
  • E_pack_kWh pack energy in kWh
  • Q_pack_Ah pack capacity in Ah

Applies when

  • nominal voltages and capacities
  • a target met within 1e-9 counts as met

Example

m.ask("Battery pack sizing: V_target = 48 V, E_target = 10 kWh, V_cell = 3.2 V, Q_cell = 100 Ah")
→ N_series = 15, N_parallel = 3, N_cells = 45, V_pack = 48 V, E_pack_kWh = 14.4, Q_pack_Ah = 300
Battery terminal voltage under constant current (one-RC equivalent circuit)energy_battery_rc_discharge

Terminal voltage, polarization (RC) voltage, energy delivered and heat generated after a constant-current discharge of duration t, for a cell modelled as an open-circuit voltage with a series resistance R0 and one R1 || C1 branch (constant OCV).

V_t(t) = V_{oc} - IR_0 - IR_1\left(1 - e^{-t/R_1C_1}\right)

Inputs

  • OCV open-circuit voltage (held constant) [V]
  • R0 series (ohmic) resistance [ohm]
  • R1 polarization resistance [ohm]
  • C1 polarization capacitance [F]
  • I discharge current [A]
  • t time since the current step [s]

Returns

  • V_terminal terminal voltage [V]
  • V_rc voltage across the RC branch [V]
  • E_delivered energy delivered to the load [J]
  • E_Wh energy delivered in Wh
  • heat heat generated in R0 and R1 [J]
  • tau time constant R1 C1 [s]

Applies when

  • constant open-circuit voltage over the interval (short pulse or flat OCV curve)
  • RC branch initially relaxed

Example

m.ask("Battery RC model: OCV = 4 V, R0 = 10 mohm, R1 = 20 mohm, C1 = 1000 F, I = 10 A, t = 0 s")
→ V_terminal = 3.9 V, V_rc = 0 V, E_delivered = 0 J, E_Wh = 0, heat = 0 J, tau = 20 s
Peukert exponent and run time at a new discharge currentenergy_peukert

Peukert's law t = C_p/I^k fitted (least squares on the logarithms) to two or more constant-current discharge tests, then the run time and delivered capacity at another current.

t = \frac{C_p}{I^k}\;\Rightarrow\; \ln t = \ln C_p - k\ln I

Inputs

  • currents test discharge currents in A vector
  • times run time of each test in hours vector
  • I new discharge current [A]

Returns

  • k Peukert exponent
  • C_p Peukert capacity C_p in A^k h
  • runtime_h run time at I in hours
  • capacity_Ah capacity delivered at I in Ah

Applies when

  • at least two tests at different currents
  • constant temperature and cut-off voltage

Example

m.ask("Peukert: currents = [1, 10], times = [100, 10], I = 5 A")
→ k = 1, C_p = 100, runtime_h = 20, capacity_Ah = 100
State of charge by coulomb countingenergy_coulomb_counting

The state of charge of a battery after a sequence of constant currents over equal time steps (positive on discharge), by coulomb counting SOC = SOC0 - integral(I dt)/Q, with its lowest and highest value and the charge delivered.

SOC(t) = SOC_0 - \frac{1}{Q}\int_0^t I\,dt

Inputs

  • SOC0 initial state of charge (fraction or %)
  • Q capacity (Ah, mAh, C) [C]
  • currents current in each time step in A (positive on discharge) vector
  • dt length of each time step [s]

Returns

  • SOC final state of charge
  • SOC_min lowest state of charge
  • SOC_max highest state of charge
  • charge_out net charge delivered [C]
  • charge_out_Ah net charge delivered in Ah

Applies when

  • 0 <= SOC0 <= 1
  • Q, dt > 0
  • the state of charge stays within 0 to 100%
  • no coulombic losses

Example

m.ask("Coulomb counting: SOC0 = 90%, Q = 50 Ah, currents = [10, 20, -5], dt = 1 h")
→ SOC = 0.4, SOC_min = 0.3, SOC_max = 0.9, charge_out = 90000 C, charge_out_Ah = 25

Fuel cells 3

Electrical power of a fuel-cell or electrolyser stackenergy_stack_electrical_power

The electrical power P = N I V_cell delivered by a fuel-cell stack (or drawn by an electrolyser stack) of N cells in series at a current and an average cell voltage, and the stack voltage.

P = N\,I\,V_{cell}

Inputs

  • I stack current [A]
  • N number of cells in series integer
  • V_cell average cell voltage [V]

Returns

  • P electrical power N I V_cell [W]
  • P_kW electrical power in kW
  • V_stack stack voltage N V_cell [V]

Applies when

  • cells in series carrying the same current
  • 0 < V_cell <= 5 V

Example

m.ask("Stack electrical power: I = 200 A, N = 100, V_cell = 0.7 V")
→ P = 14000 W, P_kW = 14, V_stack = 70 V
Hydrogen fuel-cell stack: consumption, power and efficiencyenergy_fuel_cell_stack

Hydrogen and oxygen consumption, water production (Faraday's law), efficiency on the lower and higher heating value and heat released of a hydrogen fuel-cell stack of N cells at a current and cell voltage.

\dot n_{H_2} = \frac{N I}{2F},\quad \eta_{LHV} = \frac{N I V_{cell}}{\dot n_{H_2}\,\Delta h_{LHV}}

Inputs

  • I stack current [A]
  • N number of cells in series integer
  • V_cell average cell voltage [V]
  • utilization fuel utilization (fraction or %, default 1) optional

Returns

  • H2_kg_s hydrogen consumed [kg/s]
  • H2_g_h hydrogen consumed in g/h
  • H2_fed_kg_s hydrogen fed (consumed/utilization) [kg/s]
  • O2_kg_s oxygen consumed [kg/s]
  • H2O_kg_s water produced [kg/s]
  • efficiency_LHV efficiency on the lower heating value
  • efficiency_HHV efficiency on the higher heating value
  • heat_LHV heat released (water vapour product) [W]

Applies when

  • hydrogen/oxygen cell, 2 electrons per H2
  • heating values at 25 degC

Example

m.ask("Fuel-cell stack: I = 192970.66424 A, N = 1, V_cell = 0.7 V")
→ H2_kg_s = 0.00201588 kg/s, H2_g_h = 7257.17, H2_fed_kg_s = 0.00201588 kg/s, O2_kg_s = 0.0159994 kg/s, H2O_kg_s = 0.0180153 kg/s, efficiency_LHV = 0.558581, efficiency_HHV = 0.472593, heat_LHV = 106747 W
Water electrolyser: hydrogen production and energy per kilogramenergy_electrolyser

Hydrogen and oxygen production, water consumption, specific energy (kWh per kg H2) and efficiency on the higher and lower heating value of a water electrolyser of N cells.

\frac{E}{m_{H_2}} = \frac{2FV_{cell}}{\eta_F M_{H_2}}

Inputs

  • I stack current [A]
  • N number of cells in series integer
  • V_cell cell voltage (1.23 to 3 V) [V]
  • faradaic Faradaic (current) efficiency, fraction or % (default 1) optional

Returns

  • H2_kg_s hydrogen produced [kg/s]
  • H2_kg_h hydrogen produced in kg/h
  • O2_kg_s oxygen produced [kg/s]
  • H2O_kg_s water consumed [kg/s]
  • specific_energy_kWh_per_kg electricity per kg of hydrogen in kWh/kg
  • efficiency_HHV efficiency on the higher heating value
  • efficiency_LHV efficiency on the lower heating value

Applies when

  • water electrolysis, 2 electrons per H2
  • heating values at 25 degC

Example

m.ask("Electrolyser: I = 192970.66424 A, N = 1, V_cell = 2 V")
→ H2_kg_s = 0.00201588 kg/s, H2_kg_h = 7.25717, O2_kg_s = 0.0159994 kg/s, H2O_kg_s = 0.0180153 kg/s, specific_energy_kWh_per_kg = 53.1807, efficiency_HHV = 0.740594, efficiency_LHV = 0.626587

Hydrogen 3

Hydrogen stored in a tank at pressure (real gas)energy_hydrogen_tank

Density, compressibility factor, stored mass and energy (lower heating value) of compressed hydrogen in a tank at a pressure and temperature, by the Leachman (2009) equation of state for normal hydrogen, compared with the ideal-gas estimate.

p = \rho R T\left(1 + \delta\,\frac{\partial\alpha^r}{\partial\delta}\right),\quad Z = \frac{p}{\rho R T}

Inputs

  • V internal tank volume [m^3]
  • p gas pressure (absolute) [Pa]
  • T gas temperature [K]

Returns

  • rho hydrogen density (real gas) [kg/m^3]
  • Z compressibility factor
  • mass stored hydrogen mass [kg]
  • rho_ideal ideal-gas density p M/(R T) [kg/m^3]
  • mass_ideal ideal-gas mass [kg]
  • ideal_over_real ideal-gas over real density (= Z)
  • energy_LHV_kWh stored chemical energy (LHV) in kWh

Applies when

  • 1 kPa <= p <= 1500 bar
  • 200 K <= T <= 700 K
  • normal hydrogen, uniform state

Example

m.ask("Hydrogen tank: V = 1 m^3, p = 700 bar, T = 288.15 K")
→ rho = 40.1722 kg/m^3, Z = 1.46617, mass = 40.1722 kg, rho_ideal = 58.8992 kg/m^3, mass_ideal = 58.8992 kg, ideal_over_real = 1.46617, energy_LHV_kWh = 1338.63
Isentropic (adiabatic) compression of hydrogenenergy_hydrogen_isentropic_compression

Outlet temperature and work per kilogram of a reversible adiabatic compression of hydrogen from (p1, T1) to p2, from the full Leachman equation of state (real gas, variable heat capacity).

s(p_2, T_2) = s(p_1, T_1),\quad w = h_2 - h_1

Inputs

  • p1 inlet pressure [Pa]
  • T1 inlet temperature [K]
  • p2 outlet pressure [Pa]

Returns

  • T2 outlet temperature [K]
  • w compression work per kg (h2 - h1) [J/kg]
  • w_kWh_per_kg work in kWh/kg

Applies when

  • reversible adiabatic, single stage
  • outlet temperature below 1000 K

Example

m.ask("Hydrogen isentropic compression: p1 = 30 bar, T1 = 300 K, p2 = 100 bar")
→ T2 = 423.294 K, w = 1.83321e+06 J/kg, w_kWh_per_kg = 0.509226
Minimum (isothermal) work to compress hydrogenenergy_hydrogen_isothermal_compression

The reversible isothermal work per kilogram to compress hydrogen from p1 to p2 at temperature T (the integral of v dp, equal to the Gibbs-energy rise) for the real gas (Leachman equation of state) and the ideal gas.

w = \int_{p_1}^{p_2} v\,dp = g(p_2,T) - g(p_1,T),\quad w_{ideal} = \frac{RT}{M}\ln\frac{p_2}{p_1}

Inputs

  • p1 initial pressure [Pa]
  • p2 final pressure [Pa]
  • T compression temperature [K]

Returns

  • w real-gas isothermal work per kg [J/kg]
  • w_kWh_per_kg the same in kWh/kg
  • w_ideal ideal-gas work R T ln(p2/p1)/M [J/kg]
  • real_over_ideal real over ideal work

Applies when

  • reversible and isothermal
  • 200 K <= T <= 700 K, pressures up to 1500 bar

Example

m.ask("Hydrogen isothermal compression: p1 = 1 bar, p2 = 2 bar, T = 300 K")
→ w = 858386 J/kg, w_kWh_per_kg = 0.238441, w_ideal = 857663 J/kg, real_over_ideal = 1.00084

Machines 4

Induction motor breakdown (maximum) torque and starting torqueenergy_induction_max_torque

The slip at maximum torque, the maximum (breakdown) torque, the starting torque and current, and the Thevenin equivalent of the stator and magnetizing branch, for a three-phase induction motor.

s_{max} = \frac{R_2}{\sqrt{R_{th}^2 + (X_{th} + X_2)^2}},\quad T_{max} = \frac{3V_{th}^2}{2\omega_s\left[R_{th} + \sqrt{R_{th}^2 + (X_{th}+X_2)^2}\right]}

Inputs

  • VL line voltage [V]
  • f supply frequency [Hz]
  • poles number of poles (even) integer
  • R1 stator resistance per phase [ohm]
  • X1 stator leakage reactance per phase [ohm]
  • R2 rotor resistance per phase referred to the stator [ohm]
  • X2 rotor leakage reactance referred to the stator [ohm]
  • Xm magnetizing reactance per phase [ohm]
  • connection stator connection choice

Returns

  • s_maxT slip at maximum torque
  • T_max maximum (pull-out) torque [N*m]
  • T_start starting torque (s = 1) [N*m]
  • I_start starting line current [A]
  • V_th Thevenin voltage per phase [V]
  • R_th Thevenin resistance [ohm]
  • X_th Thevenin reactance [ohm]

Applies when

  • constant parameters (no deep-bar or saturation effects)

Example

m.ask("Induction motor breakdown torque: VL = 460 V, f = 60 Hz, poles = 4, R1 = 0 ohm, X1 = 1 ohm, R2 = 0.2 ohm, X2 = 1 ohm, Xm = 1e12 ohm, connection = star")
→ s_maxT = 0.1, T_max = 280.643 N*m, T_start = 55.5729 N*m, I_start = 132.132 A, V_th = 265.581 V, R_th = 0 ohm, X_th = 1 ohm
Induction motor performance from its equivalent circuitenergy_induction_motor

Line and rotor currents, power factor, air-gap and converted power, induced torque, output and efficiency of a three-phase induction motor at a slip, from its per-phase equivalent circuit.

T_{ind} = \frac{3 I_2^2 R_2/s}{\omega_s},\quad n_s = \frac{120 f}{p}

Inputs

  • VL line voltage [V]
  • f supply frequency [Hz]
  • poles number of poles (even) integer
  • R1 stator resistance per phase [ohm]
  • X1 stator leakage reactance per phase [ohm]
  • R2 rotor resistance per phase referred to the stator [ohm]
  • X2 rotor leakage reactance referred to the stator [ohm]
  • Xm magnetizing reactance per phase [ohm]
  • slip slip (0 < s <= 1)
  • connection stator connection choice
  • P_rot rotational (friction, windage and core) loss, default 0 [W] optional

Returns

  • I_line line current [A]
  • I2 rotor current referred to the stator [A]
  • pf power factor
  • P_in input power [W]
  • P_ag air-gap power [W]
  • P_conv converted (developed) power [W]
  • T induced torque [N*m]
  • P_out output power [W]
  • efficiency_pct efficiency in percent

Applies when

  • steady state, balanced supply
  • 0 < slip <= 1

Example

m.ask("Induction motor: VL = 460 V, f = 60 Hz, poles = 4, R1 = 0.641 ohm, X1 = 1.106 ohm, R2 = 0.332 ohm, X2 = 0.464 ohm, Xm = 26.3 ohm, slip = 2.2%, connection = star")
→ I_line = 18.8919 A, I2 = 16.171 A, pf = 0.832122, P_in = 12525.1 W, P_ag = 11838.8 W, P_conv = 11578.4 W, T = 62.8068 N*m, P_out = 11578.4 W, efficiency_pct = 92.4409
Synchronous generator internal EMF, power angle and regulationenergy_synchronous_generator

The internal (excitation) EMF, power angle and voltage regulation of a star-connected cylindrical-rotor synchronous generator delivering a current at a power factor, from its synchronous reactance and armature resistance.

\mathbf E_A = \mathbf V_\phi + (R_A + jX_S)\mathbf I_A

Inputs

  • VL terminal line voltage [V]
  • IL armature (line) current [A]
  • pf power factor
  • Xs synchronous reactance per phase [ohm]
  • Ra armature resistance per phase (default 0) [ohm] optional
  • pf_type lagging (default) or leading choice optional

Returns

  • E_line internal EMF (line value) [V]
  • E_phase internal EMF per phase [V]
  • delta_deg power (torque) angle in degrees
  • regulation_pct voltage regulation (E - V)/V in percent
  • P real power output [W]
  • Q reactive power output in var [var]

Applies when

  • cylindrical rotor (no saliency), star connection, unsaturated

Example

m.ask("Synchronous generator: VL = 173.20508075688772 V, IL = 10 A, pf = 1, Xs = 10 ohm")
→ E_line = 244.949 V, E_phase = 141.421 V, delta_deg = 45, regulation_pct = 41.4214, P = 3000 W, Q = 0 var
Synchronous speed, rotor speed and slip of an AC machineenergy_synchronous_speed

The synchronous speed n_s = 120 f/P of an AC machine and, with the slip, the rotor speed n = n_s (1 - s) (or, with the rotor speed, the slip) and the rotor (slip) frequency.

n_s = \frac{120 f}{P},\quad n = n_s(1 - s)

Inputs

  • f supply frequency [Hz]
  • poles number of poles (even) integer
  • s slip (fraction or %, optional) optional
  • n_r rotor speed (rpm, optional) [rad/s] optional

Returns

  • n_sync_rpm synchronous speed in rpm
  • omega_sync synchronous speed in rad/s [rad/s]
  • n_rotor_rpm rotor speed in rpm
  • slip slip (n_s - n)/n_s
  • slip_frequency rotor current frequency s f [Hz]

Applies when

  • f > 0
  • even number of poles
  • at most one of slip and rotor speed

Example

m.ask("Synchronous speed: f = 50 Hz, poles = 4")
→ n_sync_rpm = 1500, omega_sync = 157.08 rad/s

Photovoltaics 14

Combined PV system losses (PVWatts)energy_pvwatts_losses

The total system loss of a PV system from its individual loss percentages, combined multiplicatively as in PVWatts: 1 - prod(1 - L_i); unstated losses take the PVWatts defaults (soiling 2%, shading 3%, snow 0%, mismatch 2%, wiring 2%, connections 0.5%, light-induced degradation 1.5%, nameplate 1%, age 0%, availability 3%).

L = 1 - \prod_i (1 - L_i)

Inputs

  • soiling soiling loss as a fraction or a percentage (default 2.0%) optional
  • shading shading loss as a fraction or a percentage (default 3.0%) optional
  • snow snow loss as a fraction or a percentage (default 0.0%) optional
  • mismatch mismatch loss as a fraction or a percentage (default 2.0%) optional
  • wiring wiring loss as a fraction or a percentage (default 2.0%) optional
  • connections connections loss as a fraction or a percentage (default 0.5%) optional
  • lid lid loss as a fraction or a percentage (default 1.5%) optional
  • nameplate_rating nameplate rating loss as a fraction or a percentage (default 1.0%) optional
  • age age loss as a fraction or a percentage (default 0.0%) optional
  • availability availability loss as a fraction or a percentage (default 3.0%) optional

Returns

  • total_loss total loss as a fraction
  • performance_factor product of (1 - loss)
  • total_loss_pct total loss in percent

Applies when

  • each loss between 0 and 100%

Example

m.ask("PVWatts losses: soiling = 0%, shading = 0%, snow = 0%, mismatch = 0%, wiring = 0%, connections = 0%, lid = 0%, nameplate_rating = 0%, age = 0%, availability = 10%")
→ total_loss = 0.1, performance_factor = 0.9, total_loss_pct = 10
Incidence angle modifier (ASHRAE)energy_iam_ashrae

The fraction of beam irradiance transmitted into a PV module at an angle of incidence, by the ASHRAE model IAM = 1 - b0 (1/cos(theta) - 1), floored at 0.

IAM = 1 - b_0\left(\frac{1}{\cos\theta} - 1\right)

Inputs

  • aoi angle of incidence in degrees
  • b0 ASHRAE coefficient (default 0.05) optional

Returns

  • iam incidence angle modifier

Applies when

  • 0 <= aoi <= 180

Example

m.ask("Incidence angle modifier (ASHRAE): aoi = 60")
→ iam = 0.95
Incidence angle modifier from Fresnel reflection and absorptionenergy_iam_physical

The incidence angle modifier of a glass cover from Fresnel reflection (both polarizations) and absorption in the glass (De Soto / physical model), normalised to normal incidence.

IAM = \frac{\tfrac12\left[(1-r_s)+(1-r_p)\right]e^{-KL/\cos\theta_r}}{(1-r_0)e^{-KL}}

Inputs

  • aoi angle of incidence in degrees
  • n refractive index of the glass (default 1.526) optional
  • K glazing extinction coefficient in 1/m (default 4) optional
  • L glazing thickness (default 2 mm) [m] optional

Returns

  • iam incidence angle modifier

Applies when

  • 0 <= aoi < 90
  • 1 < n < 3

Example

m.ask("Incidence angle modifier (physical): aoi = 0")
→ iam = 1
Inverter AC output and efficiency (PVWatts)energy_pvwatts_inverter

AC output and efficiency of an inverter at a DC input by the PVWatts part-load efficiency curve, with clipping at the AC rating eta_nom P_dc0.

\eta = \frac{\eta_{nom}}{\eta_{ref}}\left(-0.0162\zeta - \frac{0.0059}{\zeta} + 0.9858\right),\ \zeta = \frac{P_{dc}}{P_{dc0}}

Inputs

  • pdc DC input power [W]
  • pdc0 inverter DC input rating [W]
  • eta_nom nominal efficiency (default 0.96) optional
  • eta_ref reference efficiency of the curve (default 0.9637) optional

Returns

  • pac AC output power [W]
  • efficiency conversion efficiency P_ac/P_dc
  • clipped true when the output is limited at the AC rating

Applies when

  • P_dc > 0

Example

m.ask("Inverter output (PVWatts): pdc = 6 kW, pdc0 = 5 kW")
→ pac = 4800 W, efficiency = 0.8, clipped = True
PV array DC power with temperature derating (PVWatts)energy_pvwatts_dc

DC power of a PV array from the effective irradiance and cell temperature (PVWatts): P = (G/1000) P_dc0 (1 + gamma (T_c - 25 degC)).

P_{dc} = \frac{G}{1000}P_{dc0}\left[1 + \gamma(T_c - 25^\circ\mathrm{C})\right]

Inputs

  • G_eff effective (transmitted) irradiance on the cells [W/m^2]
  • T_cell cell temperature [K]
  • pdc0 DC rating at 1000 W/m^2 and 25 degC [W]
  • gamma power temperature coefficient per K (e.g. -0.004, or -0.4%)

Returns

  • pdc DC power [W]
  • pdc_kW DC power in kW

Applies when

  • -0.02 <= gamma <= 0.01 per K

Example

m.ask("PVWatts DC power: G_eff = 800 W/m^2, T_cell = 45 degC, pdc0 = 5 kW, gamma = -0.4%")
→ pdc = 3680 W, pdc_kW = 3.68
PV array output at operating temperatureenergy_pv_array_output

Cell temperature from NOCT and the resulting DC output of an array with a power temperature coefficient, from the plane-of-array irradiance and the air temperature.

P = \frac{G}{1000}P_{dc0}\left[1 + \gamma\left(T_a + \frac{NOCT-20}{800}G - 25\right)\right]

Inputs

  • poa plane-of-array irradiance [W/m^2]
  • T_air ambient air temperature [K]
  • noct nominal operating cell temperature [K]
  • pdc0 array DC rating at STC [W]
  • gamma power temperature coefficient per K (e.g. -0.004, or -0.4%)

Returns

  • T_cell cell temperature [K]
  • T_cell_C cell temperature in degC
  • pdc DC output [W]
  • derate temperature derating factor 1 + gamma (T_c - 25)

Applies when

  • G > 0
  • -0.02 <= gamma <= 0.01 per K

Example

m.ask("PV array output: poa = 800 W/m^2, T_air = 25 degC, noct = 45 degC, pdc0 = 10 kW, gamma = -0.4%")
→ T_cell = 323.15 K, T_cell_C = 50, pdc = 7200 W, derate = 0.9
PV cell and module temperature (Sandia SAPM model)energy_cell_temperature_sapm

Back-of-module and cell temperature by the Sandia Array Performance Model, T_m = G exp(a + b v) + T_a, T_c = T_m + (G/1000) dT, for the standard module/mounting parameter sets.

T_m = G\,e^{a + b v} + T_a,\quad T_c = T_m + \frac{G}{1000}\Delta T

Inputs

  • poa plane-of-array irradiance [W/m^2]
  • T_air ambient air temperature [K]
  • wind wind speed at 10 m [m/s]
  • mount module construction and mounting (Sandia parameter set) choice

Returns

  • T_module_C back-of-module temperature in degC
  • T_cell_C cell temperature in degC
  • T_cell cell temperature [K]

Applies when

  • G >= 0

Example

m.ask("Cell temperature (SAPM): poa = 1000 W/m^2, T_air = 10 degC, wind = 0 m/s, mount = open_rack_glass_glass")
→ T_module_C = 41.117, T_cell_C = 44.117, T_cell = 317.267 K
PV cell temperature from NOCTenergy_cell_temperature_noct

The operating temperature of a PV cell from the plane-of-array irradiance, the air temperature and the module's nominal operating cell temperature (NOCT): T_c = T_a + (NOCT - 20 degC) G/800.

T_c = T_a + \frac{NOCT - 20^\circ\mathrm{C}}{800\ \mathrm{W/m^2}}\,G

Inputs

  • poa plane-of-array irradiance [W/m^2]
  • T_air ambient air temperature [K]
  • noct nominal operating cell temperature (at 800 W/m^2, 20 degC, 1 m/s) [K]

Returns

  • T_cell cell temperature [K]
  • T_cell_C cell temperature in degC

Applies when

  • irradiance >= 0

Example

m.ask("Cell temperature (NOCT): poa = 800 W/m^2, T_air = 25 degC, noct = 45 degC")
→ T_cell = 323.15 K, T_cell_C = 50
PV module maximum power at an irradiance and temperatureenergy_pv_module_at_conditions

Short-circuit current, open-circuit voltage, maximum-power current, voltage and power, and fill factor of a PV module at an irradiance and cell temperature: the De Soto translation of its reference parameters, then the single-diode maximum power point.

P_{mp} = \max_V V\,I(V;\,I_L(G,T), I_0(T), R_s, R_{sh}(G), a(T))

Inputs

  • G effective irradiance [W/m^2]
  • T_cell cell temperature [K]
  • alpha_sc short-circuit current temperature coefficient in A/K
  • a_ref modified ideality factor at reference conditions [V]
  • IL_ref photocurrent at reference conditions [A]
  • I0_ref saturation current at reference conditions [A]
  • Rsh_ref shunt resistance at reference conditions [ohm]
  • Rs series resistance [ohm]
  • EgRef band gap at 25 degC in eV (default 1.121, silicon) optional
  • dEgdT band-gap temperature coefficient in 1/K (default -0.0002677) optional

Returns

  • Isc short-circuit current [A]
  • Voc open-circuit voltage [V]
  • Imp current at maximum power [A]
  • Vmp voltage at maximum power [V]
  • Pmp maximum power [W]
  • FF fill factor

Applies when

  • reference conditions 1000 W/m^2 and 25 degC

Example

m.ask("PV module at conditions: G = 1000 W/m^2, T_cell = 25 degC, alpha_sc = 0.004, a_ref = 1 V, IL_ref = 5 A, I0_ref = 1e-10 A, Rsh_ref = 1e15 ohm, Rs = 0 ohm")
→ Isc = 5 A, Voc = 24.6353 V, Imp = 4.77798 A, Vmp = 21.5208 V, Pmp = 102.826 W, FF = 0.834788
PV module single-diode parameters at operating conditions (De Soto)energy_desoto_parameters

The five single-diode parameters (photocurrent, saturation current, series and shunt resistance, modified ideality factor) of a PV module at an irradiance and cell temperature from its reference-condition values, by the De Soto (2006) model.

I_0 = I_{0,ref}\left(\frac{T}{T_{ref}}\right)^3\exp\left(\frac{E_{g,ref}}{kT_{ref}} - \frac{E_g}{kT}\right)

Inputs

  • G effective irradiance [W/m^2]
  • T_cell cell temperature [K]
  • alpha_sc short-circuit current temperature coefficient in A/K
  • a_ref modified ideality factor at reference conditions [V]
  • IL_ref photocurrent at reference conditions [A]
  • I0_ref saturation current at reference conditions [A]
  • Rsh_ref shunt resistance at reference conditions [ohm]
  • Rs series resistance [ohm]
  • EgRef band gap at 25 degC in eV (default 1.121, silicon) optional
  • dEgdT band-gap temperature coefficient in 1/K (default -0.0002677) optional

Returns

  • IL photocurrent [A]
  • I0 saturation current [A]
  • Rs series resistance [ohm]
  • Rsh shunt resistance [ohm]
  • nNsVth modified ideality factor [V]

Applies when

  • reference conditions 1000 W/m^2 and 25 degC

Example

m.ask("De Soto parameters: G = 1000 W/m^2, T_cell = 25 degC, alpha_sc = 0.004, a_ref = 1.9 V, IL_ref = 9 A, I0_ref = 1e-10 A, Rsh_ref = 400 ohm, Rs = 0.3 ohm")
→ IL = 9 A, I0 = 1e-10 A, Rs = 0.3 ohm, Rsh = 400 ohm, nNsVth = 1.9 V
PV module temperature (Faiman model)energy_cell_temperature_faiman

Module (cell) temperature by the Faiman heat-loss model used in IEC 61853: T = T_a + G/(u0 + u1 v).

T_m = T_a + \frac{G}{u_0 + u_1 v}

Inputs

  • poa plane-of-array irradiance [W/m^2]
  • T_air ambient air temperature [K]
  • wind wind speed at module height [m/s]
  • u0 constant heat-loss coefficient in W/(m^2 K) (default 25) optional
  • u1 wind heat-loss coefficient in W s/(m^3 K) (default 6.84) optional

Returns

  • T_cell module temperature [K]
  • T_cell_C module temperature in degC

Applies when

  • G >= 0
  • u0 > 0

Example

m.ask("Module temperature (Faiman): poa = 1000 W/m^2, T_air = 25 degC, wind = 0 m/s")
→ T_cell = 338.15 K, T_cell_C = 65
PV single-diode model: current at a voltageenergy_single_diode_current

The current (and power) of a PV cell or module at a terminal voltage from the five-parameter single-diode equation I = IL - I0 [exp((V + I Rs)/a) - 1] - (V + I Rs)/Rsh, solved implicitly.

I = I_L - I_0\left[e^{(V + IR_s)/a} - 1\right] - \frac{V + IR_s}{R_{sh}}

Inputs

  • V terminal voltage [V]
  • IL photocurrent (light-generated current) [A]
  • I0 diode saturation current [A]
  • Rs series resistance [ohm]
  • Rsh shunt resistance [ohm]
  • nNsVth modified ideality factor n Ns k T/q [V]

Returns

  • I terminal current [A]
  • P power V I [W]

Applies when

  • IL, I0, Rsh, a > 0
  • Rs >= 0

Example

m.ask("Single-diode current: V = 1 V, IL = 5 A, I0 = 1e-10 A, Rs = 0 ohm, Rsh = 100 ohm, nNsVth = 1 V")
→ I = 4.99 A, P = 4.99 W
PV single-diode model: short-circuit, open-circuit and maximum power pointenergy_single_diode_mpp

Short-circuit current, open-circuit voltage, the maximum power point (current, voltage, power) and the fill factor of a PV cell or module described by the five-parameter single-diode model.

\frac{dP}{dV} = 0,\quad FF = \frac{I_{mp}V_{mp}}{I_{sc}V_{oc}}

Inputs

  • IL photocurrent (light-generated current) [A]
  • I0 diode saturation current [A]
  • Rs series resistance [ohm]
  • Rsh shunt resistance [ohm]
  • nNsVth modified ideality factor n Ns k T/q [V]

Returns

  • Isc short-circuit current [A]
  • Voc open-circuit voltage [V]
  • Imp current at maximum power [A]
  • Vmp voltage at maximum power [V]
  • Pmp maximum power [W]
  • FF fill factor Pmp/(Isc Voc)

Applies when

  • IL, I0, Rsh, a > 0
  • Rs >= 0

Example

m.ask("PV MPP: IL = 5 A, I0 = 1e-10 A, Rs = 0 ohm, Rsh = 1e15 ohm, nNsVth = 1 V")
→ Isc = 5 A, Voc = 24.6353 V, Imp = 4.77798 A, Vmp = 21.5208 V, Pmp = 102.826 W, FF = 0.834788
PV single-diode model: voltage at a currentenergy_single_diode_voltage

The terminal voltage (and power) of a PV cell or module carrying a current, from the five-parameter single-diode equation solved implicitly for V; I = 0 gives the open-circuit voltage.

I = I_L - I_0\left[e^{(V + IR_s)/a} - 1\right] - \frac{V + IR_s}{R_{sh}}

Inputs

  • I terminal current [A]
  • IL photocurrent (light-generated current) [A]
  • I0 diode saturation current [A]
  • Rs series resistance [ohm]
  • Rsh shunt resistance [ohm]
  • nNsVth modified ideality factor n Ns k T/q [V]

Returns

  • V terminal voltage [V]
  • P power V I [W]

Applies when

  • IL, I0, Rsh, a > 0
  • Rs >= 0

Example

m.ask("Single-diode voltage: I = 0 A, IL = 5 A, I0 = 1e-10 A, Rs = 0 ohm, Rsh = 1e15 ohm, nNsVth = 1 V")
→ V = 24.6353 V, P = 0 W

Power systems 18

AC load flow by Newton-Raphsonenergy_newton_load_flow

Bus voltage magnitudes and angles, slack-bus power, PV-bus reactive power and losses of a small network by the Newton-Raphson load flow (per unit; pi-model lines; bus 1 is the slack, generator buses hold their voltage; reactive limits are not enforced).

\begin{bmatrix}\Delta\mathbf P\\ \Delta\mathbf Q\end{bmatrix} = \begin{bmatrix}\mathbf H & \mathbf N\\ \mathbf M & \mathbf L\end{bmatrix}\begin{bmatrix}\Delta\boldsymbol\theta\\ \Delta|\mathbf V|\end{bmatrix}

Inputs

  • lines one row per line: from bus, to bus, r, x, total shunt b (per unit) matrix
  • loads one row per load: bus, P, Q (per unit) matrix
  • gens optional rows per voltage-controlled (PV) generator: bus, P, V (per unit) matrix optional
  • V1 slack-bus voltage magnitude in per unit (default 1.0) optional

Returns

  • V voltage magnitudes in per unit, buses 1..n
  • angle_deg voltage angles in degrees, buses 1..n
  • P_slack slack real power injection (pu)
  • Q_slack slack reactive power injection (pu)
  • P_loss total real power loss (pu)
  • Q_gen reactive power of each PV generator (pu), in the order given

Applies when

  • buses numbered 1..n, bus 1 the slack
  • the load flow converges from a flat start

Example

m.ask("Load flow: lines = [1 2 0 0.5 0], loads = [2 0 0]")
→ V = [1.0, 1.0], angle_deg = [0.0, 0.0], P_slack = 0, Q_slack = 0, P_loss = 0, Q_gen = []
Base impedance and per-unit impedanceenergy_per_unit_impedance

The base impedance Z_base = V_base^2/S_base and base current of a three-phase per-unit system, and an impedance in ohms expressed in per unit.

Z_{base} = \frac{V_{base}^2}{S_{base}},\quad Z_{pu} = \frac{Z}{Z_{base}}

Inputs

  • R resistance per phase (ohm) [ohm]
  • X reactance per phase (ohm) [ohm]
  • S_base three-phase base power (VA) [VA]
  • V_base line-to-line base voltage [V]

Returns

  • Z_base base impedance V_base^2/S_base [ohm]
  • I_base base current S_base/(sqrt(3) V_base) [A]
  • R_pu per-unit resistance
  • X_pu per-unit reactance
  • Z_pu per-unit impedance magnitude

Applies when

  • R, X >= 0, not both 0
  • positive bases
  • three-phase base, line-to-line voltage

Example

m.ask("Per-unit impedance: R = 5 ohm, X = 20 ohm, S_base = 100 MVA, V_base = 132 kV")
→ Z_base = 174.24 ohm, I_base = 437.387 A, R_pu = 0.0286961, X_pu = 0.114784, Z_pu = 0.118317
Critical clearing angle and time (equal-area criterion)energy_critical_clearing

The initial rotor angle, the largest allowable angle and the critical clearing angle of a machine against an infinite bus by the equal-area criterion, for given pre-fault, during-fault and post-fault transfer limits; with H and f, the critical clearing time for a fault that blocks all transfer.

\cos\delta_{cr} = \frac{P_m(\delta_{max}-\delta_0) + P_{max,3}\cos\delta_{max} - P_{max,2}\cos\delta_0}{P_{max,3} - P_{max,2}}

Inputs

  • Pm mechanical input power (pu)
  • Pmax_pre pre-fault transfer limit (pu)
  • Pmax_fault transfer limit during the fault (pu; 0 for a fault at the terminals)
  • Pmax_post post-fault transfer limit (pu)
  • H inertia constant H (MJ/MVA, i.e. seconds), for the clearing time [s] optional
  • f system frequency, for the clearing time [Hz] optional

Returns

  • delta0_deg initial rotor angle in degrees
  • delta_max_deg largest angle before loss of synchronism in degrees
  • delta_cr_deg critical clearing angle in degrees
  • t_cr critical clearing time (Pmax_fault = 0) [s]

Applies when

  • Pmax_fault < Pm < Pmax_pre, Pmax_post
  • classical model (constant voltage behind transient reactance, no damping)

Example

m.ask("Critical clearing: Pm = 1, Pmax_pre = 2, Pmax_fault = 0, Pmax_post = 2")
→ delta0_deg = 30, delta_max_deg = 150, delta_cr_deg = 79.562
DC power flowenergy_dc_power_flow

Bus voltage angles and line flows of a network by the DC (linearised) power flow: lossless lines, flat 1 pu voltages, P_ij = (theta_i - theta_j)/x_ij; bus 1 is the slack (angle 0) and takes the balance.

\mathbf B'\boldsymbol\theta = \mathbf P,\quad P_{ij} = \frac{\theta_i - \theta_j}{x_{ij}}

Inputs

  • lines lines as 'i-j x' with the series reactance x in per unit (buses numbered 1..n) edges
  • P net injections (generation minus load) of buses 2..n in per unit vector

Returns

  • theta_deg bus voltage angles in degrees, buses 1..n
  • flows line flows from the first to the second named bus, per unit, in the order given
  • P_slack slack (bus 1) injection in per unit

Applies when

  • connected network
  • positive reactances
  • bus 1 is the slack

Example

m.ask("DC power flow: lines = 1-2 0.1; 2-3 0.2, P = [0, -1]")
→ theta_deg = [0.0, -5.72957795131, -17.1887338539], flows = [1.0, 1.0], P_slack = 1
Double line-to-ground fault (symmetrical components)energy_dlg_fault

Phase, neutral and sequence currents and phase voltages for a fault from phases b and c to ground through Zf: negative and (zero + 3Zf) networks in parallel.

I_1 = \frac{V_f}{Z_1 + \frac{Z_2(Z_0 + 3Z_f)}{Z_2 + Z_0 + 3Z_f}}

Inputs

  • X1 positive-sequence Thevenin reactance (pu)
  • X2 negative-sequence reactance (pu)
  • X0 zero-sequence reactance (pu)
  • Rf fault resistance (pu, default 0) optional
  • Xf fault reactance (pu, default 0) optional
  • Vf prefault voltage (pu, default 1.0) optional

Returns

  • Ia |I_a| (pu)
  • Ib |I_b| (pu)
  • Ic |I_c| (pu)
  • In neutral (earth) current |3 I_0| (pu)
  • I1 |I_1| (pu)
  • I2 |I_2| (pu)
  • I0 |I_0| (pu)
  • Va |V_a| (pu)
  • Vb |V_b| (pu)
  • Vc |V_c| (pu)

Applies when

  • sequence networks from the Thevenin reactances at the fault
  • prefault no-load voltage Vf

Example

m.ask("DLG fault: X1 = 0.1, X2 = 0.1, X0 = 0.1")
→ Ia = 0, Ib = 10, Ic = 10, In = 10, I1 = 6.66667, I2 = 3.33333, I0 = 3.33333, Va = 1, Vb = 0, Vc = 0
Economic dispatch with quadratic costs and limitsenergy_economic_dispatch

The least-cost outputs of thermal units with costs a + b P + c P^2 ($/h) and output limits that together meet a demand (losses neglected): every unit between its limits runs at the same incremental cost lambda.

\frac{dC_i}{dP_i} = b_i + 2c_iP_i = \lambda\ \ (P_{min} < P_i < P_{max}),\quad \sum_i P_i = D

Inputs

  • costs one row per unit: a ($/h), b ($/MWh), c ($/MW^2 h), Pmin (MW), Pmax (MW) matrix
  • demand total demand in MW

Returns

  • lambda_ system incremental cost in $/MWh
  • P unit outputs in MW, in the order given
  • cost total cost in $/h

Applies when

  • c > 0 for every unit
  • sum Pmin <= demand <= sum Pmax
  • at least one unit between its limits

Example

m.ask("Economic dispatch: costs = [500 5.3 0.004 200 450]; [400 5.5 0.006 150 350]; [200 5.8 0.009 100 225], demand = 800 MW")
→ lambda_ = 8.5, P = [400.0, 250.0, 150.0], cost = 6682.5
Frequency deviation and load sharing under governor droopenergy_droop_sharing

The steady-state frequency drop after a load step and each generator's output change when governors with droop R (per unit on their own rating) share the load, with optional load damping D.

\Delta f = -\frac{\Delta P_L}{\sum_i \frac{S_i}{R_i f_0} + D}

Inputs

  • R droop of each governor in per unit on its own rating (e.g. 0.05) vector
  • ratings rating of each generator in MW vector
  • dP load increase in MW (negative for a load decrease)
  • f0 nominal frequency [Hz]
  • D load damping in MW/Hz (default 0) optional

Returns

  • df frequency change in Hz
  • f new frequency in Hz
  • dP_gen output change of each generator in MW
  • dP_load_damping load relief from damping in MW

Applies when

  • primary control only (no secondary/AGC)
  • R, ratings > 0

Example

m.ask("Droop sharing: R = [0.05, 0.05], ratings = [500, 500], dP = 100 MW, f0 = 50 Hz")
→ df = -0.25, f = 49.75, dP_gen = [50.0, 50.0], dP_load_damping = 0
Geometric mean distance of a three-phase lineenergy_geometric_mean_distance

The geometric mean distance GMD = (D_ab D_bc D_ca)^(1/3) between the phases of a fully transposed three-phase line.

GMD = \sqrt[3]{D_{ab}D_{bc}D_{ca}}

Inputs

  • D_ab distance between phases a and b [m]
  • D_bc distance between phases b and c [m]
  • D_ca distance between phases c and a [m]

Returns

  • GMD geometric mean distance [m]
  • ratio_to_mean GMD divided by the arithmetic mean spacing

Applies when

  • positive spacings that form a triangle (or a straight line)
  • fully transposed line

Example

m.ask("Geometric mean distance: D_ab = 4 m, D_bc = 4 m, D_ca = 8 m")
→ GMD = 5.03968 m, ratio_to_mean = 0.944941
Inductance, capacitance and surge impedance of a three-phase overhead lineenergy_line_parameters

Per-phase inductance, capacitance, reactance, susceptance, surge impedance (and surge-impedance loading at a voltage) of a fully transposed three-phase line from its phase spacings, conductor radius and geometric mean radius, with optional bundled conductors.

L = 2\times10^{-7}\ln\frac{GMD}{GMR}\ \mathrm{H/m},\quad C = \frac{2\pi\varepsilon_0}{\ln(GMD/r)}\ \mathrm{F/m}

Inputs

  • D_ab distance between phases a and b [m]
  • D_bc distance between phases b and c [m]
  • D_ca distance between phases c and a [m]
  • r conductor (outer) radius [m]
  • f system frequency [Hz]
  • gmr conductor geometric mean radius (default r e^(-1/4), a solid round conductor) [m] optional
  • n_bundle subconductors per phase (1 to 4, regular polygon) integer optional
  • spacing distance between neighbouring subconductors of a bundle [m] optional
  • V line voltage for the surge-impedance loading (optional) [V] optional

Returns

  • GMR geometric mean radius of a phase (bundle) [m]
  • L_mH_per_km inductance per phase in mH/km
  • C_nF_per_km capacitance to neutral in nF/km
  • X_ohm_per_km series reactance in ohm/km
  • B_uS_per_km shunt susceptance in uS/km
  • Zc surge impedance of the lossless line sqrt(L/C) [ohm]
  • SIL_MW surge-impedance loading V^2/Zc in MW

Applies when

  • fully transposed line
  • spacings much larger than the conductors
  • ground effect neglected

Example

m.ask("Line parameters: D_ab = 5 m, D_bc = 5 m, D_ca = 5 m, r = 1 cm, f = 50 Hz, gmr = 5 mm")
→ GMR = 0.005 m, L_mH_per_km = 1.38155, C_nF_per_km = 8.95189, X_ohm_per_km = 0.434027, B_uS_per_km = 2.81232, Zc = 392.849 ohm
Line-to-line fault (symmetrical components)energy_ll_fault

Phase and sequence currents and phase voltages for a fault between phases b and c through Zf: positive and negative networks in parallel opposition.

I_b = -I_c = -j\sqrt3\,\frac{V_f}{Z_1 + Z_2 + Z_f}

Inputs

  • X1 positive-sequence Thevenin reactance (pu)
  • X2 negative-sequence reactance (pu)
  • X0 zero-sequence reactance (pu)
  • Rf fault resistance (pu, default 0) optional
  • Xf fault reactance (pu, default 0) optional
  • Vf prefault voltage (pu, default 1.0) optional

Returns

  • Ia |I_a| (pu)
  • Ib |I_b| (pu)
  • Ic |I_c| (pu)
  • In neutral (earth) current |3 I_0| (pu)
  • I1 |I_1| (pu)
  • I2 |I_2| (pu)
  • I0 |I_0| (pu)
  • Va |V_a| (pu)
  • Vb |V_b| (pu)
  • Vc |V_c| (pu)

Applies when

  • sequence networks from the Thevenin reactances at the fault
  • prefault no-load voltage Vf

Example

m.ask("LL fault: X1 = 0.1, X2 = 0.1, X0 = 0.1")
→ Ia = 0, Ib = 8.66025, Ic = 8.66025, In = 0, I1 = 5, I2 = 5, I0 = 0, Va = 1, Vb = 0.5, Vc = 0.5
Long transmission line (exact distributed parameters)energy_long_line

Characteristic impedance, propagation constant, exact ABCD constants and the sending-end quantities, regulation and efficiency of a long three-phase line with uniformly distributed R, X and shunt B (the Ferranti rise appears as a negative regulation at light load).

A = \cosh\gamma l,\ B = Z_c\sinh\gamma l,\ C = \frac{\sinh\gamma l}{Z_c},\quad Z_c = \sqrt{\frac{z}{y}},\ \gamma = \sqrt{zy}

Inputs

  • Vr receiving-end line-to-line voltage [V]
  • P load real power (three-phase) [W]
  • pf load power factor
  • R line resistance per phase (total) [ohm]
  • X line reactance per phase (total) [ohm]
  • B total shunt susceptance of the line per phase [S]
  • pf_type lagging (default) or leading load choice optional

Returns

  • Vs sending-end line voltage [V]
  • delta_deg angle of the sending voltage ahead of the receiving voltage, degrees
  • Is sending-end current [A]
  • Ps sending-end real power [W]
  • losses line losses (three-phase) [W]
  • regulation_pct voltage regulation (V_s/|A| - V_r)/V_r in percent
  • efficiency_pct transmission efficiency in percent
  • A_mag |A| (= |D|)
  • A_angle_deg angle of A in degrees
  • B_mag |B| in ohms [ohm]
  • B_angle_deg angle of B in degrees
  • Zc_mag characteristic (surge) impedance magnitude [ohm]
  • Zc_angle_deg angle of Zc in degrees
  • alpha_l attenuation alpha l in nepers
  • beta_l phase shift beta l in radians

Applies when

  • uniformly distributed parameters
  • balanced load

Example

m.ask("Long line: Vr = 400 kV, P = 1 MW, pf = 1, R = 0 ohm, X = 100 ohm, B = 400 uS")
→ Vs = 392027 V, delta_deg = 0.0362951, Is = 91.7723 A, Ps = 1e+06 W, losses = 0 W, regulation_pct = 2.00641e-05, efficiency_pct = 100, A_mag = 0.980067, A_angle_deg = 0, B_mag = 99.3347 ohm, B_angle_deg = 90, Zc_mag = 500 ohm, Zc_angle_deg = 0, alpha_l = 0, beta_l = 0.2
Medium transmission line (nominal pi)energy_medium_line

ABCD constants of the nominal-pi model and the sending-end voltage, current and power, losses, regulation and efficiency of a medium-length three-phase line feeding a load.

\begin{bmatrix}V_s\\I_s\end{bmatrix} = \begin{bmatrix}1+\frac{ZY}{2} & Z\\ Y\left(1+\frac{ZY}{4}\right) & 1+\frac{ZY}{2}\end{bmatrix}\begin{bmatrix}V_r\\I_r\end{bmatrix}

Inputs

  • Vr receiving-end line-to-line voltage [V]
  • P load real power (three-phase) [W]
  • pf load power factor
  • R line resistance per phase (total) [ohm]
  • X line reactance per phase (total) [ohm]
  • B total shunt susceptance of the line per phase [S]
  • pf_type lagging (default) or leading load choice optional

Returns

  • Vs sending-end line voltage [V]
  • delta_deg angle of the sending voltage ahead of the receiving voltage, degrees
  • Is sending-end current [A]
  • Ps sending-end real power [W]
  • losses line losses (three-phase) [W]
  • regulation_pct voltage regulation (V_s/|A| - V_r)/V_r in percent
  • efficiency_pct transmission efficiency in percent
  • A_mag |A| (= |D|)
  • A_angle_deg angle of A in degrees
  • B_mag |B| in ohms [ohm]
  • B_angle_deg angle of B in degrees

Applies when

  • nominal-pi model (half the shunt admittance at each end)
  • balanced load

Example

m.ask("Medium line: Vr = 132 kV, P = 50 MW, pf = 1, R = 0 ohm, X = 40 ohm, B = 500 uS")
→ Vs = 131555 V, delta_deg = 6.61355, Is = 219.801 A, Ps = 5e+07 W, losses = 0 W, regulation_pct = 0.669903, efficiency_pct = 100, A_mag = 0.99, A_angle_deg = 0, B_mag = 40 ohm, B_angle_deg = 90
Per-unit impedance on a new baseenergy_per_unit_change_of_base

An impedance given in per unit on equipment ratings (S_old, V_old) converted to the per-unit system of the network (S_new, V_new).

Z_{pu,new} = Z_{pu,old}\left(\frac{V_{old}}{V_{new}}\right)^2\frac{S_{new}}{S_{old}}

Inputs

  • R_pu per-unit resistance on the old base
  • X_pu per-unit reactance on the old base
  • S_old old base (equipment rating) in VA [VA]
  • V_old old base voltage (line-to-line) [V]
  • S_new new (system) base power in VA [VA]
  • V_new new base voltage (line-to-line) [V]

Returns

  • R_pu_new per-unit resistance on the new base
  • X_pu_new per-unit reactance on the new base
  • Z_pu_new per-unit impedance magnitude on the new base

Applies when

  • X_pu > 0
  • positive bases

Example

m.ask("Per-unit change of base: R_pu = 0.01, X_pu = 0.1, S_old = 10 MVA, V_old = 11 kV, S_new = 100 MVA, V_new = 11 kV")
→ R_pu_new = 0.1, X_pu_new = 1, Z_pu_new = 1.00499
Power transfer and power angle between two voltagesenergy_power_angle

The power angle needed to transfer P over a lossless reactance X between a sending voltage V2 (generator) and a receiving voltage V1 (infinite bus), the steady-state limit V1 V2/X, the reactive power at both ends and the stability margin.

P = \frac{V_1V_2}{X}\sin\delta,\quad P_{max} = \frac{V_1V_2}{X}

Inputs

  • V1 receiving (infinite-bus) line voltage [V]
  • V2 sending (generator) line voltage [V]
  • X transfer reactance per phase [ohm]
  • P real power transferred (three-phase) [W]

Returns

  • delta_deg power angle (V2 ahead of V1) in degrees
  • Pmax steady-state limit V1 V2/X [W]
  • Q_sent reactive power sent from the generator end in var [var]
  • Q_received reactive power arriving at the infinite bus in var [var]
  • margin_pct stability margin (Pmax - P)/Pmax in percent

Applies when

  • lossless transfer reactance
  • |P| < V1 V2/X

Example

m.ask("Power angle: V1 = 100 kV, V2 = 100 kV, X = 100 ohm, P = 50 MW")
→ delta_deg = 30, Pmax = 1e+08 W, Q_sent = 1.33975e+07 var, Q_received = -1.33975e+07 var, margin_pct = 50
Receiving-end voltage of a line feeding a constant-power load (two-bus load flow)energy_two_bus_load_flow

The receiving-end voltage magnitude and angle, current and losses when a three-phase line of impedance R + jX supplies a constant P + jQ load from a fixed sending-end voltage (the exact two-bus load flow).

V_r^4 + \left[2(PR+QX) - V_s^2\right]V_r^2 + (P^2+Q^2)(R^2+X^2) = 0

Inputs

  • Vs sending-end line-to-line voltage (slack) [V]
  • R line resistance per phase [ohm]
  • X line reactance per phase [ohm]
  • P load real power (three-phase) [W]
  • Q load reactive power in var (negative for a capacitive load) [var]

Returns

  • Vr receiving-end line voltage [V]
  • delta_deg receiving-end voltage angle in degrees (negative: lagging the source)
  • I line current [A]
  • P_loss real power loss [W]
  • Q_loss reactive power absorbed by the line in var [var]
  • voltage_drop_pct (V_s - V_r)/V_s in percent

Applies when

  • the load is within the line's transfer limit (a real solution exists)
  • the high-voltage (normal) solution is reported

Example

m.ask("Two-bus load flow: Vs = 2 kV, R = 0 ohm, X = 1 ohm, P = 1 MW, Q = 0 var")
→ Vr = 1931.85 V, delta_deg = -15, I = 298.858 A, P_loss = 0 W, Q_loss = 267949 var, voltage_drop_pct = 3.40742
Short transmission line: sending-end voltage, regulation and efficiencyenergy_short_line

Sending-end voltage and its angle, line current, losses, voltage regulation and efficiency of a short three-phase line (series R + jX, no shunt admittance) feeding a load at a known receiving-end voltage.

\mathbf V_s = \mathbf V_r + \mathbf I\,(R + jX),\quad \text{VR} = \frac{|V_s| - |V_r|}{|V_r|}

Inputs

  • Vr receiving-end line-to-line voltage [V]
  • P load real power (three-phase) [W]
  • pf load power factor
  • R line resistance per phase (total) [ohm]
  • X line reactance per phase (total) [ohm]
  • pf_type lagging (default) or leading load choice optional

Returns

  • Vs sending-end line voltage [V]
  • delta_deg angle of the sending voltage ahead of the receiving voltage, degrees
  • I receiving-end line current [A]
  • losses line losses (three-phase) [W]
  • Ps sending-end real power [W]
  • regulation_pct voltage regulation in percent
  • efficiency_pct transmission efficiency in percent

Applies when

  • short line: shunt admittance neglected
  • balanced three-phase load

Example

m.ask("Short line: Vr = 33 kV, P = 10 MW, pf = 1, R = 0 ohm, X = 0 ohm")
→ Vs = 33000 V, delta_deg = 0, I = 174.955 A, losses = 0 W, Ps = 1e+07 W, regulation_pct = 0, efficiency_pct = 100
Single line-to-ground fault (symmetrical components)energy_slg_fault

Phase and sequence currents and phase voltages for a fault from phase a to ground through Zf: the three sequence networks in series.

I_a = 3I_0 = \frac{3V_f}{Z_1 + Z_2 + Z_0 + 3Z_f}

Inputs

  • X1 positive-sequence Thevenin reactance (pu)
  • X2 negative-sequence reactance (pu)
  • X0 zero-sequence reactance (pu)
  • Rf fault resistance (pu, default 0) optional
  • Xf fault reactance (pu, default 0) optional
  • Vf prefault voltage (pu, default 1.0) optional

Returns

  • Ia |I_a| (pu)
  • Ib |I_b| (pu)
  • Ic |I_c| (pu)
  • In neutral (earth) current |3 I_0| (pu)
  • I1 |I_1| (pu)
  • I2 |I_2| (pu)
  • I0 |I_0| (pu)
  • Va |V_a| (pu)
  • Vb |V_b| (pu)
  • Vc |V_c| (pu)

Applies when

  • sequence networks from the Thevenin reactances at the fault
  • prefault no-load voltage Vf

Example

m.ask("SLG fault: X1 = 0.1, X2 = 0.1, X0 = 0.1")
→ Ia = 10, Ib = 0, Ic = 0, In = 10, I1 = 3.33333, I2 = 3.33333, I0 = 3.33333, Va = 0, Vb = 1, Vc = 1
Three-phase (symmetrical) fault current by the bus impedance matrixenergy_symmetrical_fault

The fault current, Thevenin reactance and the bus voltages during a balanced three-phase fault at a bus of a reactance network (per unit, prefault no-load voltage Vf everywhere; every branch to node 0 is a source).

I_f = \frac{V_f}{Z_{ff} + Z_f},\quad V_i = V_f - Z_{if}I_f

Inputs

  • network branches as 'i-j x' with reactances in per unit; node 0 is the reference, each branch to 0 a source (generator or infinite bus) edges
  • fault_bus faulted bus integer
  • Vf prefault voltage in per unit (default 1.0) optional
  • Xf fault reactance in per unit (default 0, a bolted fault) optional
  • S_base base power, for the fault current in amperes (optional) [VA] optional
  • V_base base line voltage at the faulted bus (optional) [V] optional

Returns

  • If fault current in per unit
  • X_th Thevenin reactance at the faulted bus (Z_ff) in per unit
  • V bus voltage magnitudes during the fault (pu), buses 1..n
  • If_A fault current in amperes [A]

Applies when

  • reactance network
  • no prefault load current (all prefault voltages Vf)

Example

m.ask("Symmetrical fault: network = 0-1 0.2; 1-2 0.3, fault_bus = 2")
→ If = 2, X_th = 0.5, V = [0.6, 0.0]

Solar resource 18

Angle of incidence of the sun on a tilted surfaceenergy_angle_of_incidence

The angle between the sun's rays and the normal of a surface of given tilt and azimuth, and its cosine (the beam projection factor).

\cos\theta = \cos\beta\cos\theta_z + \sin\beta\sin\theta_z\cos(\gamma_s - \gamma)

Inputs

  • tilt surface tilt from horizontal in degrees
  • surface_azimuth surface azimuth in degrees clockwise from north (south = 180)
  • zenith solar zenith angle in degrees
  • azimuth solar azimuth in degrees clockwise from north

Returns

  • aoi_deg angle of incidence in degrees
  • cos_aoi cosine of the angle of incidence

Applies when

  • 0 <= tilt <= 180
  • azimuths from 0 to 360 degrees

Example

m.ask("Angle of incidence: tilt = 0, surface_azimuth = 180, zenith = 60, azimuth = 100")
→ aoi_deg = 60, cos_aoi = 0.5
Clear-sky global horizontal irradiance (Haurwitz)energy_clear_sky_haurwitz

The global horizontal irradiance under a clear sky from the solar zenith angle alone (Haurwitz 1945): 1098 cos z exp(-0.059/cos z).

G_{cs} = 1098\cos z\; e^{-0.059/\cos z}

Inputs

  • zenith apparent solar zenith angle in degrees

Returns

  • ghi clear-sky global horizontal irradiance (0 when the sun is below the horizon) [W/m^2]

Applies when

  • 0 <= zenith <= 180

Example

m.ask("Clear-sky GHI (Haurwitz): zenith = 0")
→ ghi = 1035.09 W/m^2
Clear-sky irradiance (Ineichen-Perez with Linke turbidity)energy_clear_sky_ineichen

Clear-sky global horizontal, direct normal and diffuse horizontal irradiance from the apparent solar zenith, the Linke turbidity and the site altitude (Ineichen and Perez 2002), with the pressure-corrected air mass and G_on from day n.

G_{cs} = c_{g1}G_{on}\cos z\,e^{-c_{g2}AM\left(f_{h1} + f_{h2}(T_L - 1)\right)}

Inputs

  • zenith apparent solar zenith angle in degrees
  • linke_turbidity Linke turbidity factor (1 to 10; about 2 to 5 for clear skies)
  • altitude site altitude above sea level [m]
  • n day of the year (1 = 1 January) integer

Returns

  • ghi clear-sky global horizontal irradiance [W/m^2]
  • dni clear-sky direct normal irradiance [W/m^2]
  • dhi clear-sky diffuse horizontal irradiance [W/m^2]
  • AM_absolute absolute air mass (Kasten-Young, standard pressure at the altitude)

Applies when

  • sun above the horizon
  • 1 <= TL <= 10

Example

m.ask("Clear-sky irradiance (Ineichen): zenith = 30, linke_turbidity = 3, altitude = 500 m, n = 172")
→ ghi = 885.003 W/m^2, dni = 910.142 W/m^2, dhi = 96.7974 W/m^2, AM_absolute = 1.08721
Diffuse and direct irradiance from global horizontal irradiance (Erbs)energy_erbs_decomposition

The clearness index, diffuse fraction, diffuse horizontal and direct normal irradiance estimated from a measured global horizontal irradiance by the Erbs (1982) correlation.

\frac{G_d}{G} = 0.9511 - 0.1604k_t + 4.388k_t^2 - 16.638k_t^3 + 12.336k_t^4

Inputs

  • ghi global horizontal irradiance [W/m^2]
  • zenith solar zenith angle in degrees
  • n day of the year (1 = 1 January) integer

Returns

  • kt clearness index GHI/(G_on cos z)
  • diffuse_fraction diffuse fraction DHI/GHI
  • dhi diffuse horizontal irradiance [W/m^2]
  • dni direct normal irradiance [W/m^2]

Applies when

  • 0 <= zenith <= 85
  • GHI > 0
  • kt is capped at 1

Example

m.ask("Erbs decomposition: ghi = 141.3981805 W/m^2, zenith = 0, n = 1")
→ kt = 0.1, diffuse_fraction = 0.991, dhi = 140.126 W/m^2, dni = 1.27258 W/m^2
Direct normal irradiance from global horizontal irradiance (DISC model)energy_disc_dni

The direct normal irradiance estimated from global horizontal irradiance by Maxwell's DISC model (clearness index and pressure-corrected air mass), with the clearness index and the air mass used.

G_{bn} = I_0\left[K_{nc}(AM) - \left(a + b\,e^{c\,AM}\right)\right]

Inputs

  • ghi global horizontal irradiance [W/m^2]
  • zenith solar zenith angle in degrees
  • n day of the year (1 = 1 January) integer
  • pressure site pressure (default 101325 Pa) [Pa] optional

Returns

  • dni direct normal irradiance (0 when the model gives a negative value) [W/m^2]
  • kt clearness index (solar constant 1370 W/m^2)
  • airmass absolute air mass (Kasten 1966, capped at 12)

Applies when

  • 0 <= zenith <= 85
  • GHI > 0

Example

m.ask("DISC model: ghi = 709.0092500000001 W/m^2, zenith = 0, n = 1")
→ dni = 163.645 W/m^2, kt = 0.5, airmass = 0.999494
Equation of timeenergy_equation_of_time

The equation of time (apparent minus mean solar time) on day n, by Spencer's Fourier series or the PVCDROM formula 9.87 sin 2B - 7.53 cos B - 1.5 sin B.

E = 229.18\,(0.000075 + 0.001868\cos B - 0.032077\sin B - 0.014615\cos 2B - 0.040849\sin 2B)

Inputs

  • n day of the year (1 = 1 January) integer
  • method formula: spencer (default) or pvcdrom (B = 360 (n - 81)/365) choice optional

Returns

  • eot_min equation of time in minutes
  • eot_s equation of time in seconds

Applies when

  • 1 <= n <= 366

Example

m.ask("Equation of time: n = 81, method = pvcdrom")
→ eot_min = -7.53, eot_s = -451.8
Extraterrestrial (top-of-atmosphere) normal irradianceenergy_extraterrestrial_irradiance

The solar irradiance on a plane normal to the sun's rays outside the atmosphere on day n, and the Earth-Sun distance factor (R0/R)^2.

G_{on} = G_{sc}\left(1 + 0.033\cos\frac{360^\circ n}{365}\right)

Inputs

  • n day of the year (1 = 1 January) integer
  • method formula: spencer (default, Fourier series) or asce (1 + 0.033 cos(360 n/365)) choice optional
  • solar_constant solar constant (default 1366.1 W/m^2) [W/m^2] optional

Returns

  • G_on extraterrestrial normal irradiance [W/m^2]
  • distance_factor Earth-Sun distance factor (R0/R)^2

Applies when

  • 1 <= n <= 366

Example

m.ask("Extraterrestrial irradiance: n = 365, method = asce, solar_constant = 1367 W/m^2")
→ G_on = 1412.11 W/m^2, distance_factor = 1.033
Irradiance on a tilted plane (Hay-Davies sky model)energy_poa_haydavies

Beam, sky-diffuse (Hay and Davies 1980: isotropic plus circumsolar weighted by the anisotropy index DNI/G_on) and ground-reflected irradiance on a tilted surface; G_on from day n (Spencer, 1366.1 W/m^2).

G_{d,t} = G_d\left[A R_b + (1 - A)\frac{1+\cos\beta}{2}\right],\ A = \frac{G_{bn}}{G_{on}}

Inputs

  • tilt surface tilt from horizontal in degrees
  • surface_azimuth surface azimuth in degrees clockwise from north (south = 180)
  • zenith solar zenith angle in degrees
  • azimuth solar azimuth in degrees clockwise from north
  • dni direct normal irradiance [W/m^2]
  • ghi global horizontal irradiance [W/m^2]
  • dhi diffuse horizontal irradiance [W/m^2]
  • albedo ground reflectance (0 to 1)
  • n day of the year (1 = 1 January) integer

Returns

  • poa_global total irradiance on the plane [W/m^2]
  • poa_direct beam irradiance on the plane [W/m^2]
  • poa_sky_diffuse sky-diffuse irradiance on the plane [W/m^2]
  • poa_ground_diffuse ground-reflected irradiance on the plane [W/m^2]
  • aoi_deg angle of incidence in degrees

Applies when

  • sun above the horizon
  • DHI <= GHI
  • 0 <= albedo <= 1

Example

m.ask("Plane of array irradiance (Hay-Davies): tilt = 30, surface_azimuth = 180, zenith = 30, azimuth = 180, dni = 800 W/m^2, ghi = 792.820323027551 W/m^2, dhi = 100 W/m^2, albedo = 0.2, n = 172")
→ poa_global = 917.342 W/m^2, poa_direct = 800 W/m^2, poa_sky_diffuse = 106.72 W/m^2, poa_ground_diffuse = 10.6218 W/m^2, aoi_deg = 0
Irradiance on a tilted plane (isotropic sky)energy_poa_isotropic

Beam, sky-diffuse (isotropic sky, Liu-Jordan/Hottel-Woertz) and ground-reflected irradiance on a tilted surface from DNI, GHI and DHI.

G_{poa} = G_{bn}\cos\theta + G_d\frac{1+\cos\beta}{2} + G\rho\frac{1-\cos\beta}{2}

Inputs

  • tilt surface tilt from horizontal in degrees
  • surface_azimuth surface azimuth in degrees clockwise from north (south = 180)
  • zenith solar zenith angle in degrees
  • azimuth solar azimuth in degrees clockwise from north
  • dni direct normal irradiance [W/m^2]
  • ghi global horizontal irradiance [W/m^2]
  • dhi diffuse horizontal irradiance [W/m^2]
  • albedo ground reflectance (0 to 1)

Returns

  • poa_global total irradiance on the plane [W/m^2]
  • poa_direct beam irradiance on the plane [W/m^2]
  • poa_sky_diffuse sky-diffuse irradiance on the plane [W/m^2]
  • poa_ground_diffuse ground-reflected irradiance on the plane [W/m^2]
  • aoi_deg angle of incidence in degrees

Applies when

  • sun above the horizon
  • DHI <= GHI
  • 0 <= albedo <= 1

Example

m.ask("Plane of array irradiance (isotropic): tilt = 30, surface_azimuth = 180, zenith = 30, azimuth = 180, dni = 800 W/m^2, ghi = 792.820323027551 W/m^2, dhi = 100 W/m^2, albedo = 0.2")
→ poa_global = 903.923 W/m^2, poa_direct = 800 W/m^2, poa_sky_diffuse = 93.3013 W/m^2, poa_ground_diffuse = 10.6218 W/m^2, aoi_deg = 0
Irradiance on a tilted plane (Klucher sky model)energy_poa_klucher

Beam, sky-diffuse (Klucher 1979: isotropic sky brightened near the horizon and around the sun under clear skies) and ground-reflected irradiance on a tilted surface.

G_{d,t} = G_d\frac{1+\cos\beta}{2}\left(1 + F\sin^3\frac{\beta}{2}\right)\left(1 + F\cos^2\theta\sin^3\theta_z\right)

Inputs

  • tilt surface tilt from horizontal in degrees
  • surface_azimuth surface azimuth in degrees clockwise from north (south = 180)
  • zenith solar zenith angle in degrees
  • azimuth solar azimuth in degrees clockwise from north
  • dni direct normal irradiance [W/m^2]
  • ghi global horizontal irradiance [W/m^2]
  • dhi diffuse horizontal irradiance [W/m^2]
  • albedo ground reflectance (0 to 1)

Returns

  • poa_global total irradiance on the plane [W/m^2]
  • poa_direct beam irradiance on the plane [W/m^2]
  • poa_sky_diffuse sky-diffuse irradiance on the plane [W/m^2]
  • poa_ground_diffuse ground-reflected irradiance on the plane [W/m^2]
  • aoi_deg angle of incidence in degrees

Applies when

  • sun above the horizon
  • DHI <= GHI
  • 0 <= albedo <= 1

Example

m.ask("Plane of array irradiance (Klucher): tilt = 30, surface_azimuth = 180, zenith = 30, azimuth = 180, dni = 800 W/m^2, ghi = 792.820323027551 W/m^2, dhi = 100 W/m^2, albedo = 0.2")
→ poa_global = 917.188 W/m^2, poa_direct = 800 W/m^2, poa_sky_diffuse = 106.566 W/m^2, poa_ground_diffuse = 10.6218 W/m^2, aoi_deg = 0
Irradiance on a tilted plane (Perez sky model)energy_poa_perez

Beam, sky-diffuse and ground-reflected irradiance on a tilted surface with the Perez (1990) anisotropic sky (circumsolar and horizon brightening coefficients by sky-clearness bin, all-sites composite set), the air mass by Kasten-Young and G_on from day n (Spencer).

G_{d,t} = G_d\left[(1 - F_1)\frac{1+\cos\beta}{2} + F_1\frac{a}{b} + F_2\sin\beta\right]

Inputs

  • tilt surface tilt from horizontal in degrees
  • surface_azimuth surface azimuth in degrees clockwise from north (south = 180)
  • zenith solar zenith angle in degrees
  • azimuth solar azimuth in degrees clockwise from north
  • dni direct normal irradiance [W/m^2]
  • ghi global horizontal irradiance [W/m^2]
  • dhi diffuse horizontal irradiance [W/m^2]
  • albedo ground reflectance (0 to 1)
  • n day of the year (1 = 1 January) integer

Returns

  • poa_global total irradiance on the plane [W/m^2]
  • poa_direct beam irradiance on the plane [W/m^2]
  • poa_sky_diffuse sky-diffuse irradiance on the plane [W/m^2]
  • poa_ground_diffuse ground-reflected irradiance on the plane [W/m^2]
  • aoi_deg angle of incidence in degrees

Applies when

  • 0 <= zenith < 87
  • DHI > 0
  • DHI <= GHI

Example

m.ask("Plane of array irradiance (Perez): tilt = 30, surface_azimuth = 180, zenith = 30, azimuth = 180, dni = 800 W/m^2, ghi = 792.820323027551 W/m^2, dhi = 100 W/m^2, albedo = 0.2, n = 172")
→ poa_global = 923.778 W/m^2, poa_direct = 800 W/m^2, poa_sky_diffuse = 113.156 W/m^2, poa_ground_diffuse = 10.6218 W/m^2, aoi_deg = 0
Irradiance on a tilted plane (Reindl sky model)energy_poa_reindl

Beam, sky-diffuse (Reindl 1990: Hay-Davies plus horizon brightening sqrt(BHI/GHI) sin^3(beta/2)) and ground-reflected irradiance on a tilted surface; G_on from day n (Spencer).

G_{d,t} = G_d\left[(1-A)\frac{1+\cos\beta}{2}\left(1+\sqrt{\frac{G_b}{G}}\sin^3\frac{\beta}{2}\right) + A R_b\right]

Inputs

  • tilt surface tilt from horizontal in degrees
  • surface_azimuth surface azimuth in degrees clockwise from north (south = 180)
  • zenith solar zenith angle in degrees
  • azimuth solar azimuth in degrees clockwise from north
  • dni direct normal irradiance [W/m^2]
  • ghi global horizontal irradiance [W/m^2]
  • dhi diffuse horizontal irradiance [W/m^2]
  • albedo ground reflectance (0 to 1)
  • n day of the year (1 = 1 January) integer

Returns

  • poa_global total irradiance on the plane [W/m^2]
  • poa_direct beam irradiance on the plane [W/m^2]
  • poa_sky_diffuse sky-diffuse irradiance on the plane [W/m^2]
  • poa_ground_diffuse ground-reflected irradiance on the plane [W/m^2]
  • aoi_deg angle of incidence in degrees

Applies when

  • sun above the horizon
  • DHI <= GHI
  • 0 <= albedo <= 1

Example

m.ask("Plane of array irradiance (Reindl): tilt = 30, surface_azimuth = 180, zenith = 30, azimuth = 180, dni = 800 W/m^2, ghi = 792.820323027551 W/m^2, dhi = 100 W/m^2, albedo = 0.2, n = 172")
→ poa_global = 917.939 W/m^2, poa_direct = 800 W/m^2, poa_sky_diffuse = 107.317 W/m^2, poa_ground_diffuse = 10.6218 W/m^2, aoi_deg = 0
Optical air massenergy_air_mass

The relative optical air mass for a solar zenith angle (Kasten-Young by default, or another named model) and the pressure-corrected absolute air mass.

AM = \frac{1}{\cos z + 0.50572\,(96.07995^\circ - z)^{-1.6364}}

Inputs

  • zenith solar zenith angle in degrees (apparent zenith for the refraction-based models)
  • model air-mass model (default kastenyoung1989) choice optional
  • pressure site pressure (default 101325 Pa) [Pa] optional

Returns

  • AM_relative relative air mass (sea level)
  • AM_absolute absolute air mass AM_rel p/101325 Pa

Applies when

  • 0 <= zenith < 90

Example

m.ask("Air mass: zenith = 60, model = simple")
→ AM_relative = 2, AM_absolute = 2
Solar declination on a day of the yearenergy_solar_declination

The declination of the sun (the latitude where the sun is overhead at noon) on day n of the year, by Cooper's equation or Spencer's Fourier series.

\delta = 23.45^\circ \sin\!\left(\frac{360^\circ (284 + n)}{365}\right)

Inputs

  • n day of the year (1 = 1 January) integer
  • method formula: cooper (Cooper 1969, the textbook default) or spencer (Spencer 1971) choice optional

Returns

  • declination_deg declination in degrees
  • declination_rad declination in radians

Applies when

  • 1 <= n <= 366

Example

m.ask("Solar declination: n = 172")
→ declination_deg = 23.4498, declination_rad = 0.409276
Solar time and hour angle from clock timeenergy_solar_time_hour_angle

Local apparent solar time and the hour angle of the sun from the local clock time, the longitude and the time zone (UTC offset), with the equation of time (Spencer).

\omega = 15^\circ\,(t - \Delta t_{UTC} - 12) + \lambda + \frac{E}{4}

Inputs

  • n day of the year (1 = 1 January) integer
  • clock local clock (standard) time in decimal hours or hh:mm
  • longitude longitude in degrees, east positive
  • utc_offset time zone as hours from UTC (e.g. -5, 1, 5.5)

Returns

  • eot_min equation of time in minutes
  • hour_angle_deg hour angle in degrees (negative before solar noon)
  • solar_time_h apparent solar time in decimal hours

Applies when

  • 1 <= n <= 366
  • 0 <= clock < 24
  • -180 <= longitude <= 180

Example

m.ask("Hour angle: n = 172, clock = 14:30, longitude = -75, utc_offset = -5")
→ eot_min = -1.34372, hour_angle_deg = 37.1641, solar_time_h = 14.4776
Solar zenith, elevation and azimuth from latitude, declination and hour angleenergy_sun_angles

The sun's zenith angle, elevation (altitude) and azimuth (clockwise from north) at a latitude for a given declination and hour angle.

\cos\theta_z = \cos\phi\cos\delta\cos\omega + \sin\phi\sin\delta

Inputs

  • latitude latitude in degrees (north positive)
  • declination solar declination in degrees
  • hour_angle hour angle in degrees (negative in the morning)

Returns

  • zenith_deg solar zenith angle in degrees
  • elevation_deg solar elevation (altitude) in degrees
  • azimuth_deg solar azimuth in degrees clockwise from north

Applies when

  • -90 < latitude < 90
  • |declination| <= 23.5
  • |hour angle| <= 180

Example

m.ask("Sun angles: latitude = 40, declination = 0, hour_angle = 0")
→ zenith_deg = 40, elevation_deg = 50, azimuth_deg = 180
Sun position at a place and local timeenergy_solar_position

Declination, equation of time, hour angle, zenith, elevation and azimuth of the sun at a latitude and longitude on day n at a local clock time (Spencer declination and equation of time).

\cos\theta_z = \cos\phi\cos\delta\cos\omega + \sin\phi\sin\delta,\quad \omega = 15^\circ(t_s - 12)

Inputs

  • latitude latitude in degrees (north positive)
  • longitude longitude in degrees, east positive
  • n day of the year (1 = 1 January) integer
  • clock local clock (standard) time in decimal hours or hh:mm
  • utc_offset time zone as hours from UTC

Returns

  • declination_deg declination in degrees
  • eot_min equation of time in minutes
  • hour_angle_deg hour angle in degrees
  • zenith_deg solar zenith angle in degrees
  • elevation_deg solar elevation in degrees
  • azimuth_deg solar azimuth in degrees clockwise from north

Applies when

  • 1 <= n <= 366
  • 0 <= clock < 24
  • -90 < latitude < 90

Example

m.ask("Solar position: latitude = 40, longitude = -105, n = 172, clock = 13:00, utc_offset = -7")
→ declination_deg = 23.452, eot_min = -1.34372, hour_angle_deg = 14.6641, zenith_deg = 20.66, elevation_deg = 69.34, azimuth_deg = 221.165
Sunrise, sunset, solar noon and day lengthenergy_sunrise_sunset

Geometric sunrise and sunset times (local clock time), solar noon, the day length and the sunset hour angle at a place on day n (no refraction, sun centre on the horizon).

\cos\omega_s = -\tan\phi\tan\delta,\quad N = \frac{2\,\omega_s}{15^\circ}

Inputs

  • latitude latitude in degrees (north positive)
  • longitude longitude in degrees, east positive
  • n day of the year (1 = 1 January) integer
  • utc_offset time zone as hours from UTC

Returns

  • sunrise_h sunrise, local clock time in decimal hours
  • sunset_h sunset, local clock time in decimal hours
  • solar_noon_h solar noon, local clock time in decimal hours
  • day_length_h day length in hours
  • sunset_hour_angle_deg sunset hour angle omega_s in degrees

Applies when

  • the sun rises and sets on that day (no polar day or night)

Example

m.ask("Day length: latitude = 0, longitude = 0, n = 81, utc_offset = 0")
→ sunrise_h = 6.12608, sunset_h = 18.1261, solar_noon_h = 12.1261, day_length_h = 12, sunset_hour_angle_deg = 90

Three-phase power 1

Balanced three-phase power from line quantitiesenergy_three_phase_power

Real, reactive and apparent power of a balanced three-phase load from the line voltage, line current and power factor, with the phase voltage and phase current of a star or delta connection.

P = \sqrt3\,V_L I_L\cos\phi,\quad Q = \sqrt3\,V_L I_L\sin\phi

Inputs

  • VL line-to-line rms voltage [V]
  • IL line current (rms) [A]
  • pf power factor (0 < pf <= 1)
  • connection connection of the load (star = wye) choice
  • pf_type lagging (inductive, default) or leading (capacitive) choice optional

Returns

  • P real power (three-phase total) [W]
  • Q reactive power in var (positive lagging) [var]
  • S apparent power in VA [VA]
  • V_phase voltage across each phase of the load [V]
  • I_phase current in each phase of the load [A]

Applies when

  • balanced load
  • 0 < pf <= 1

Example

m.ask("Three-phase power: VL = 400 V, IL = 50 A, pf = 0.8, connection = star")
→ P = 27712.8 W, Q = 20784.6 var, S = 34641 VA, V_phase = 230.94 V, I_phase = 50 A

Transformers 5

Load for maximum transformer efficiencyenergy_transformer_max_efficiency

The load (fraction of rating and apparent power) at which a transformer's efficiency is greatest (copper loss equal to core loss), that maximum efficiency and the full-load efficiency at a power factor.

x_{\eta,max} = \sqrt{\frac{P_{core}}{P_{cu,fl}}},\quad \eta_{max} = \frac{xS\cos\phi}{xS\cos\phi + 2P_{core}}

Inputs

  • S rating in VA [VA]
  • P_core core (no-load) loss [W]
  • P_cu_fl copper loss at full load [W]
  • pf load power factor

Returns

  • load_fraction load fraction for maximum efficiency sqrt(P_core/P_cu)
  • S_at_max apparent power at maximum efficiency in VA [VA]
  • efficiency_max_pct maximum efficiency in percent
  • efficiency_full_load_pct full-load efficiency in percent

Applies when

  • constant core loss, copper loss proportional to the load squared

Example

m.ask("Maximum transformer efficiency: S = 100 kVA, P_core = 500 W, P_cu_fl = 2000 W, pf = 1")
→ load_fraction = 0.5, S_at_max = 50000 VA, efficiency_max_pct = 98.0392, efficiency_full_load_pct = 97.561
Load sharing between two transformers in parallelenergy_parallel_transformers

How two transformers with equal voltage ratios but different ratings and short-circuit impedances share a load: the apparent, real and reactive power each delivers and its loading on its own rating.

\mathbf S_1 = \mathbf S_L\left(\frac{\mathbf Z_2}{\mathbf Z_1 + \mathbf Z_2}\right)^*,\quad \mathbf S_2 = \mathbf S_L\left(\frac{\mathbf Z_1}{\mathbf Z_1 + \mathbf Z_2}\right)^*

Inputs

  • S1 rating of transformer 1 (VA) [VA]
  • vk1 short-circuit voltage of transformer 1 (fraction or %)
  • vkr1 its resistive part (fraction or %)
  • S2 rating of transformer 2 (VA) [VA]
  • vk2 short-circuit voltage of transformer 2 (fraction or %)
  • vkr2 its resistive part (fraction or %)
  • V_lv common secondary rated voltage [V]
  • P load real power [W]
  • Q load reactive power in var [var]

Returns

  • S1_share apparent power delivered by transformer 1 in VA [VA]
  • S2_share apparent power delivered by transformer 2 in VA [VA]
  • P1 real power of transformer 1 [W]
  • Q1 reactive power of transformer 1 in var [var]
  • P2 real power of transformer 2 [W]
  • Q2 reactive power of transformer 2 in var [var]
  • share1_pct_of_rating transformer 1 output over its rating, percent
  • share2_pct_of_rating transformer 2 output over its rating, percent

Applies when

  • equal voltage ratios (no circulating current)
  • magnetizing branches neglected

Example

m.ask("Parallel transformers: S1 = 500 kVA, vk1 = 5%, vkr1 = 1%, S2 = 500 kVA, vk2 = 5%, vkr2 = 1%, V_lv = 400 V, P = 600 kW, Q = 200 kvar")
→ S1_share = 316228 VA, S2_share = 316228 VA, P1 = 300000 W, Q1 = 100000 var, P2 = 300000 W, Q2 = 100000 var, share1_pct_of_rating = 63.2456, share2_pct_of_rating = 63.2456
Transformer parameters from open-circuit and short-circuit testsenergy_transformer_tests

Core-loss resistance and magnetizing reactance from the open-circuit test, and the equivalent series resistance, reactance and impedance from the short-circuit test (each on the side where the test was made).

R_c = \frac{V_{oc}^2}{P_{oc}},\ X_m = \frac{1}{\sqrt{Y_{oc}^2 - G_c^2}},\ R_{eq} = \frac{P_{sc}}{I_{sc}^2},\ X_{eq} = \sqrt{Z_{eq}^2 - R_{eq}^2}

Inputs

  • Voc open-circuit test voltage [V]
  • Ioc open-circuit test current [A]
  • Poc open-circuit test power [W]
  • Vsc short-circuit test voltage [V]
  • Isc short-circuit test current [A]
  • Psc short-circuit test power [W]

Returns

  • Rc core-loss resistance (open-circuit side) [ohm]
  • Xm magnetizing reactance (open-circuit side) [ohm]
  • Req equivalent series resistance (short-circuit side) [ohm]
  • Xeq equivalent leakage reactance (short-circuit side) [ohm]
  • Zeq equivalent series impedance magnitude [ohm]
  • pf_oc open-circuit power factor
  • pf_sc short-circuit power factor

Applies when

  • P < V I in both tests

Example

m.ask("Transformer tests: Voc = 100 V, Ioc = 1 A, Poc = 60 W, Vsc = 50 V, Isc = 10 A, Psc = 300 W")
→ Rc = 166.667 ohm, Xm = 125 ohm, Req = 3 ohm, Xeq = 4 ohm, Zeq = 5 ohm, pf_oc = 0.6, pf_sc = 0.6
Transformer regulation and efficiency from its equivalent circuitenergy_transformer_performance

Primary voltage needed, voltage regulation, primary current and input power factor, copper and core losses and efficiency of a single-phase transformer (approximate equivalent circuit referred to the primary, shunt branch at the primary terminals) delivering a fraction of its rating at rated secondary voltage.

\mathbf V_1 = a\mathbf V_2 + \frac{\mathbf I_2}{a}(R_{eq} + jX_{eq}),\quad \eta = \frac{P_{out}}{P_{out} + P_{cu} + P_{core}}

Inputs

  • S rating in VA [VA]
  • V1 rated primary voltage [V]
  • V2 rated secondary voltage [V]
  • Req series resistance referred to the primary [ohm]
  • Xeq series leakage reactance referred to the primary [ohm]
  • Rc core-loss resistance (primary side) [ohm]
  • Xm magnetizing reactance (primary side) [ohm]
  • load load as a fraction of the rating (or a percentage)
  • pf load power factor
  • pf_type lagging (default) or leading load choice optional

Returns

  • V1_required primary voltage for rated secondary voltage at this load [V]
  • regulation_pct voltage regulation in percent
  • I1 primary current [A]
  • pf_in input power factor
  • P_out output power [W]
  • P_cu copper loss [W]
  • P_core core loss [W]
  • efficiency_pct efficiency in percent

Applies when

  • approximate equivalent circuit (shunt branch at the primary terminals)
  • 0 < load <= 2

Example

m.ask("Transformer regulation and efficiency: S = 10 kVA, V1 = 1000 V, V2 = 100 V, Req = 1 ohm, Xeq = 0 ohm, Rc = 1e9 ohm, Xm = 1e9 ohm, load = 100%, pf = 1")
→ V1_required = 1010 V, regulation_pct = 1, I1 = 10 A, pf_in = 1, P_out = 10000 W, P_cu = 100 W, P_core = 0.0010201 W, efficiency_pct = 99.0099
Transformer under load from nameplate dataenergy_transformer_loading

Secondary voltage, losses, efficiency and loading of a transformer fed at rated primary voltage and supplying a P + jQ load, from its nameplate: rating, rated voltages, short-circuit voltage vk and its resistive part vkr, no-load loss and no-load current (T equivalent circuit).

z_k = v_{kr} + j\sqrt{v_k^2 - v_{kr}^2},\quad y_m = \frac{P_0}{S_n} - j\sqrt{i_0^2 - \left(\frac{P_0}{S_n}\right)^2}

Inputs

  • sn rating in VA [VA]
  • V_hv rated (and applied) high-voltage side voltage [V]
  • V_lv rated low-voltage side voltage [V]
  • vk short-circuit voltage as a fraction or percentage of rated voltage
  • vkr resistive part of the short-circuit voltage (fraction or %)
  • P0 no-load (iron) loss [W]
  • i0 no-load current as a fraction or percentage of rated current
  • P load real power on the low-voltage side [W]
  • Q load reactive power in var [var]

Returns

  • V_lv_actual low-voltage side voltage under load [V]
  • V_lv_pu low-voltage side voltage in per unit
  • delta_deg phase shift of the secondary voltage in degrees (no vector-group shift)
  • P_loss total real loss [W]
  • Q_loss reactive power absorbed in var [var]
  • efficiency_pct efficiency in percent
  • loading_pct loading: the larger winding current over its rated current, percent

Applies when

  • T equivalent circuit (series impedance halved on each side of the magnetizing branch)
  • rated voltage applied, nominal tap

Example

m.ask("Transformer under load: sn = 630 kVA, V_hv = 20 kV, V_lv = 400 V, vk = 6%, vkr = 1.2%, P0 = 1.5 kW, i0 = 0.3%, P = 400 kW, Q = 150 kvar")
→ V_lv_actual = 390.876 V, V_lv_pu = 0.977189, delta_deg = -2.02483, P_loss = 5120.79 W, Q_loss = 19030.9 var, efficiency_pct = 98.736, loading_pct = 69.6777

Wind power 9

Actuator-disc (momentum theory) rotor performanceenergy_actuator_disc

Power and thrust coefficients, disc and far-wake speeds, power and thrust of an ideal rotor (actuator disc) with axial induction factor a; a = 1/3 gives the Betz optimum Cp = 16/27.

C_P = 4a(1-a)^2,\quad C_T = 4a(1-a)

Inputs

  • a axial induction factor (0 <= a < 0.5)
  • rho air density [kg/m^3]
  • D rotor diameter [m]
  • v free-stream wind speed [m/s]

Returns

  • Cp power coefficient 4a(1-a)^2
  • Ct thrust coefficient 4a(1-a)
  • v_disc speed at the disc [m/s]
  • v_wake far-wake speed [m/s]
  • P power extracted [W]
  • T thrust on the rotor [N]

Applies when

  • 0 <= a < 0.5

Example

m.ask("Actuator disc: a = 0.25, rho = 1.2 kg/m^3, D = 10 m, v = 8 m/s")
→ Cp = 0.5625, Ct = 0.75, v_disc = 6 m/s, v_wake = 4 m/s, P = 13571.7 W, T = 2261.95 N
Air density at hub heightenergy_hub_air_density

Temperature, pressure and air density at a turbine's hub height from a pressure and a temperature measured at other heights: temperature gradient -6.5 K/km, pressure gradient -1/8 hPa per m, then the barometric (1.225 kg/m^3 at 288.15 K, 1013.3 hPa) or the ideal-gas (R = 287.058 J/(kg K)) density.

\rho_{hub} = 1.225\,\frac{p_{hub}}{101330\ \mathrm{Pa}}\,\frac{288.15\ \mathrm{K}}{T_{hub}}

Inputs

  • p measured air pressure [Pa]
  • h_p height of the pressure measurement [m]
  • T measured air temperature [K]
  • h_T height of the temperature measurement [m]
  • hub hub height [m]
  • model density model (default barometric) choice optional

Returns

  • T_hub temperature at hub height [K]
  • p_hub pressure at hub height [Pa]
  • rho air density at hub height [kg/m^3]

Applies when

  • pressure and temperature stay positive at hub height

Example

m.ask("Air density at hub height: p = 1013.3 hPa, h_p = 0 m, T = 288.15 K, h_T = 0 m, hub = 0 m")
→ T_hub = 288.15 K, p_hub = 101330 Pa, rho = 1.225 kg/m^3
Annual energy production from a power curve and a Weibull distributionenergy_weibull_aep

Mean output, annual energy production and capacity factor of a wind turbine whose power curve (linear between points, zero outside) operates in winds with a Weibull distribution (shape k, scale c).

\bar P = \int_0^\infty P(v)\,\frac{k}{c}\left(\frac vc\right)^{k-1}e^{-(v/c)^k}\,dv,\quad AEP = 8760\,\mathrm{h}\cdot\bar P

Inputs

  • speeds power-curve wind speeds in m/s (increasing) vector
  • powers power-curve outputs in kW vector
  • k Weibull shape factor (1 < k <= 5)
  • c Weibull scale factor [m/s]
  • hours hours in the period (default 8760) optional

Returns

  • mean_power_kW mean output in kW
  • AEP_MWh energy over the period in MWh
  • capacity_factor mean output over the largest output of the curve

Applies when

  • 1 < k <= 5
  • speeds strictly increasing

Example

m.ask("Annual energy production: speeds = [0, 1000], powers = [0, 1000], k = 2, c = 7 m/s")
→ mean_power_kW = 6.20359, AEP_MWh = 54.3434, capacity_factor = 0.00620359
Power in the wind and the Betz limitenergy_wind_power

The kinetic power of the wind through a rotor's swept area, the maximum a turbine can extract (Betz limit 16/27), the power density, and the power at a given power coefficient.

P = \tfrac12\rho A v^3,\quad P_{max} = \tfrac{16}{27}\cdot\tfrac12\rho A v^3

Inputs

  • rho air density [kg/m^3]
  • D rotor diameter [m]
  • v wind speed [m/s]
  • cp power coefficient (optional, at most 16/27) optional

Returns

  • P_wind power in the wind through the swept area [W]
  • P_betz maximum extractable power (Betz) [W]
  • power_density wind power density in W/m^2
  • area swept area [m^2]
  • P power at the given power coefficient [W]

Applies when

  • rho, D, v > 0
  • 0 < cp <= 16/27

Example

m.ask("Power in the wind: rho = 1.225 kg/m^3, D = 80 m, v = 10 m/s, cp = 0.4")
→ P_wind = 3.07876e+06 W, P_betz = 1.82445e+06 W, power_density = 612.5, area = 5026.55 m^2, P = 1.2315e+06 W
Turbine output from a density-corrected power curveenergy_power_curve_density_corrected

Turbine output at a wind speed and air density, with the power curve's speeds rescaled by (1.225/rho)^e, e rising from 1/3 below 7.5 m/s to 2/3 above 12.5 m/s (Svenningsen's correction, as in windpowerlib).

v_i' = v_i\left(\frac{1.225}{\rho}\right)^{e(v_i)},\ e\in[\tfrac13,\tfrac23]

Inputs

  • speeds power-curve wind speeds in m/s at 1.225 kg/m^3 (increasing) vector
  • powers power-curve outputs in kW vector
  • v wind speed at hub height [m/s]
  • rho air density at hub height [kg/m^3]

Returns

  • P_kW output in kW
  • P output [W]

Applies when

  • 0.5 < rho < 1.6 kg/m^3

Example

m.ask("Density-corrected power curve: speeds = [3, 5, 8, 12, 25], powers = [0, 150, 800, 2000, 2000], v = 6.5 m/s, rho = 1.225 kg/m^3")
→ P_kW = 475, P = 475000 W
Turbine output from its power curveenergy_power_curve_output

The electrical output of a wind turbine at a wind speed by linear interpolation of its power curve (zero below the first and above the last listed speed).

P(v) = P_i + (P_{i+1} - P_i)\frac{v - v_i}{v_{i+1} - v_i}

Inputs

  • speeds power-curve wind speeds in m/s (increasing) vector
  • powers power-curve outputs in kW vector
  • v wind speed at hub height [m/s]

Returns

  • P_kW output in kW
  • P output [W]

Applies when

  • speeds strictly increasing
  • one power per speed

Example

m.ask("Power curve output: speeds = [3, 5, 8, 12, 25], powers = [0, 150, 800, 2000, 2000], v = 6.5 m/s")
→ P_kW = 475, P = 475000 W
Weibull wind statistics and mean power densityenergy_weibull_wind

Mean wind speed, mean wind power density, energy pattern factor, most probable speed and the speed carrying most energy for a Weibull wind-speed distribution with shape k and scale c.

\bar v = c\,\Gamma\!\left(1 + \tfrac1k\right),\quad \frac{\bar P}{A} = \tfrac12\rho c^3\,\Gamma\!\left(1 + \tfrac3k\right)

Inputs

  • k Weibull shape factor (1 < k <= 5)
  • c Weibull scale factor [m/s]
  • rho air density [kg/m^3]

Returns

  • v_mean mean wind speed c Gamma(1 + 1/k) [m/s]
  • power_density mean wind power density in W/m^2
  • energy_pattern_factor mean of v^3 over the cube of the mean
  • v_most_probable most probable wind speed [m/s]
  • v_max_energy wind speed carrying the most energy [m/s]

Applies when

  • 1 < k <= 5
  • c > 0

Example

m.ask("Weibull wind statistics: k = 2, c = 8 m/s, rho = 1.225 kg/m^3")
→ v_mean = 7.08982 m/s, power_density = 416.881, energy_pattern_factor = 1.90986, v_most_probable = 5.65685 m/s, v_max_energy = 11.3137 m/s
Wind speed at another height (logarithmic profile)energy_wind_shear_log

The wind speed at height h2 from a measurement at h1 by the logarithmic wind profile with roughness length z0 and an optional obstacle height d (displacement 0.7 d).

v_2 = v_1\,\frac{\ln\left((h_2 - 0.7d)/z_0\right)}{\ln\left((h_1 - 0.7d)/z_0\right)}

Inputs

  • v1 measured wind speed [m/s]
  • h1 measurement height [m]
  • h2 target height [m]
  • z0 surface roughness length [m]
  • d obstacle height (default 0; displacement height 0.7 d) [m] optional

Returns

  • v2 wind speed at h2 [m/s]

Applies when

  • h - 0.7 d > z0 at both heights

Example

m.ask("Wind shear (log profile): v1 = 5 m/s, h1 = 10 m, h2 = 100 m, z0 = 1 m")
→ v2 = 10 m/s
Wind speed at another height (power law)energy_wind_shear_power_law

The wind speed at height h2 from a measurement at h1 by the power (Hellman) law v2 = v1 (h2/h1)^alpha; alpha = 1/7 when not stated (the one-seventh law).

v_2 = v_1\left(\frac{h_2}{h_1}\right)^{\alpha}

Inputs

  • v1 measured wind speed [m/s]
  • h1 measurement height [m]
  • h2 target height (e.g. hub height) [m]
  • alpha shear exponent (default 1/7) optional

Returns

  • v2 wind speed at h2 [m/s]

Applies when

  • heights > 0
  • 0 <= alpha <= 1

Example

m.ask("Wind shear (power law): v1 = 6 m/s, h1 = 10 m, h2 = 1280 m")
→ v2 = 12 m/s
Questions

Frequently asked

What does energy-systems-ai999x do?

Energy Systems answers questions in energy systems: power systems and load flow, three-phase power, transformers and machines, solar photovoltaics, wind power, batteries, fuel cells and hydrogen. Each answer gives the value with its unit, the steps and the formula in LaTeX.

How do I install energy-systems-ai999x?

With pip: pip install energy-systems-ai999x. The same files are on Hugging Face (hf download AI999X/energy-systems-ai999x --local-dir energy-systems-ai999x) and GitHub.

Does it run offline?

Yes. It is a Python package that runs on an ordinary CPU without a network connection (Python >=3.10); no GPU and no API key are needed.

How many capabilities does energy-systems-ai999x have?

79 capabilities in 10 topics, including Power systems, Solar resource, Photovoltaics, Wind power, Transformers.

Which field and tasks does it cover?

Field: Engineering. Tasks: Question Answering, Token Classification, Text Classification, Sentence Similarity, Feature Extraction.

What does an answer look like?

Asked "Three-phase power: VL = 400 V, IL = 50 A, pf = 0.8, connection = star", it answers: P = 27712.8 W, Q = 20784.6 var, S = 34641 VA, V_phase = 230.94 V, I_phase = 50 A.

What happens when a question cannot be answered?

It says so and names what is missing or out of range, instead of guessing a number.

More from AI999X

Explore every model.