Example of steady temperature with 3t solver and CIGRE 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.entities import TemperatureType
from thermohl.solver.entities 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.entities import TemperatureType
from thermohl.solver.entities import HeatEquationType
from thermohl.solver.entities import VariableType
from thermohl.solver.entities import PowerType
Plot all three temperatures (surface, core, average) of a conductor, its ampacity and solar heating during a day. As excpected, we use the 3t solver this time, but with CIGRE power terms. We can observe that when the solar heating increases, all three temperatures of the conductor also increase while the ampacity of the conductor decreases. There are no huge differences between surface and core temperatures in this case.
In [2]:
Copied!
# Generate input dict (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,
"azimuth": 31.0,
"datetime_utc": np.arange("2026-06-20", "2026-06-21", dtype="datetime64[h]"),
"transit": np.array([600.0] * 12 + [900.0] * 12),
}
# Generate input dict (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,
"azimuth": 31.0,
"datetime_utc": np.arange("2026-06-20", "2026-06-21", dtype="datetime64[h]"),
"transit": np.array([600.0] * 12 + [900.0] * 12),
}
In [3]:
Copied!
# Create solver with cigre power terms and 3t heat equation
solver_cigre = solver.cigre(parameters, heat_equation=HeatEquationType.THREE_TEMPERATURES)
# Compute temperature
steady_temperature = solver_cigre.steady_temperature()
# Compute max intensity
max_conductor_temperature = 55.0
steady_intensity = solver_cigre.steady_intensity(max_conductor_temperature)
# Create solver with cigre power terms and 3t heat equation
solver_cigre = solver.cigre(parameters, heat_equation=HeatEquationType.THREE_TEMPERATURES)
# Compute temperature
steady_temperature = solver_cigre.steady_temperature()
# Compute max intensity
max_conductor_temperature = 55.0
steady_intensity = solver_cigre.steady_intensity(max_conductor_temperature)
In [4]:
Copied!
# Plot results
_, ax = plt.subplots(nrows=3, ncols=1)
ax[0].fill_between(
range(24), steady_temperature[TemperatureType.SURFACE.value], steady_temperature[TemperatureType.CORE.value], fc="gray", alpha=0.33, ec=None
)
ax[0].plot(
range(24),
steady_temperature[TemperatureType.SURFACE.value],
c="C0",
label="Surface Conductor temperature (C)",
)
ax[0].plot(
range(24),
steady_temperature[TemperatureType.AVERAGE.value],
c="C1",
label="Average Conductor temperature (C)",
)
ax[0].plot(
range(24), steady_temperature[TemperatureType.CORE.value], c="C3", label="Core 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.value], 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(bbox_to_anchor=(1.05, 1))
ax[2].set_xlabel("Hour")
%matplotlib inline
plt.show()
# Plot results
_, ax = plt.subplots(nrows=3, ncols=1)
ax[0].fill_between(
range(24), steady_temperature[TemperatureType.SURFACE.value], steady_temperature[TemperatureType.CORE.value], fc="gray", alpha=0.33, ec=None
)
ax[0].plot(
range(24),
steady_temperature[TemperatureType.SURFACE.value],
c="C0",
label="Surface Conductor temperature (C)",
)
ax[0].plot(
range(24),
steady_temperature[TemperatureType.AVERAGE.value],
c="C1",
label="Average Conductor temperature (C)",
)
ax[0].plot(
range(24), steady_temperature[TemperatureType.CORE.value], c="C3", label="Core 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.value], 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(bbox_to_anchor=(1.05, 1))
ax[2].set_xlabel("Hour")
%matplotlib inline
plt.show()