Example of steady temperature with 1t solver and IEEE model
In [1]:
Copied!
import matplotlib
matplotlib.use("nbagg")
import matplotlib.pyplot as plt
import numpy as np
from thermohl import solver
from thermohl.solver import HeatEquationType
from thermohl.solver.entities import VariableType
from thermohl.solver.entities import PowerType
import matplotlib
matplotlib.use("nbagg")
import matplotlib.pyplot as plt
import numpy as np
from thermohl import solver
from thermohl.solver import HeatEquationType
from thermohl.solver.entities import VariableType
from thermohl.solver.entities import PowerType
Plot the conductor temperature and ampacity during a day.
We use the 1t solver, with IEEE power terms.
We can observe that when the solar heating increases, the conductor temperature also increases, but the conductor ampacity decreases.
In [2]:
Copied!
# Define input parameters (for the sake of simplicity, only a few inputs are
# used, the rest is filled with default values).
parameters = {
"latitude": 46.1,
"altitude": 123.0,
"cable_azimuth": 31.0,
"datetime_utc": np.arange("2026-06-20", "2026-06-21", dtype="datetime64[h]"),
VariableType.TRANSIT: np.array([400.0] * 12 + [700.0] * 12),
}
# Define input parameters (for the sake of simplicity, only a few inputs are
# used, the rest is filled with default values).
parameters = {
"latitude": 46.1,
"altitude": 123.0,
"cable_azimuth": 31.0,
"datetime_utc": np.arange("2026-06-20", "2026-06-21", dtype="datetime64[h]"),
VariableType.TRANSIT: np.array([400.0] * 12 + [700.0] * 12),
}
In [3]:
Copied!
# create solver with ieee power terms and 1t heat equation; other options
# available are solver.cigre, solver.olla and solver.rte for power terms
solver_ieee = solver.ieee(parameters, heat_equation=HeatEquationType.ONE_TEMPERATURE)
# compute temperature
steady_temperature = solver_ieee.steady_temperature()
# compute max intensity
max_conductor_temperature = 55.0
steady_intensity = solver_ieee.steady_intensity(max_conductor_temperature)
# plot results
fig, ax = plt.subplots(nrows=3, ncols=1)
ax[0].plot(
range(24),
steady_temperature[VariableType.TEMPERATURE.value],
c="C0",
label="Conductor temperature (C)",
)
ax[0].axhline(max_conductor_temperature, ls="--", c="C1", label="Maximum temperature for ampacity")
ax[1].plot(range(24), parameters[VariableType.TRANSIT], c="C0", label="Transit (A)")
ax[1].plot(
range(24),
steady_intensity[VariableType.TRANSIT.value],
c="C1",
label="Conductor ampacity (A)",
)
ax[2].plot(
range(24), steady_temperature[PowerType.SOLAR.value], label="Solar heating power (W/m)"
)
for i in range(3):
ax[i].grid(True)
ax[i].legend(loc=(1.04, 0))
ax[2].set_xlabel("Hour")
%matplotlib inline
plt.show()
# create solver with ieee power terms and 1t heat equation; other options
# available are solver.cigre, solver.olla and solver.rte for power terms
solver_ieee = solver.ieee(parameters, heat_equation=HeatEquationType.ONE_TEMPERATURE)
# compute temperature
steady_temperature = solver_ieee.steady_temperature()
# compute max intensity
max_conductor_temperature = 55.0
steady_intensity = solver_ieee.steady_intensity(max_conductor_temperature)
# plot results
fig, ax = plt.subplots(nrows=3, ncols=1)
ax[0].plot(
range(24),
steady_temperature[VariableType.TEMPERATURE.value],
c="C0",
label="Conductor temperature (C)",
)
ax[0].axhline(max_conductor_temperature, ls="--", c="C1", label="Maximum temperature for ampacity")
ax[1].plot(range(24), parameters[VariableType.TRANSIT], c="C0", label="Transit (A)")
ax[1].plot(
range(24),
steady_intensity[VariableType.TRANSIT.value],
c="C1",
label="Conductor ampacity (A)",
)
ax[2].plot(
range(24), steady_temperature[PowerType.SOLAR.value], label="Solar heating power (W/m)"
)
for i in range(3):
ax[i].grid(True)
ax[i].legend(loc=(1.04, 0))
ax[2].set_xlabel("Hour")
%matplotlib inline
plt.show()