Skip to content

Aging

The aging of the transformer under a certain load (described by the hot-spot temperature(s)) can be calculated with the following functions.

aging_rate_profile

aging_rate_profile(
    hot_spot_profile: Series,
    insulation_type: PaperInsulationType,
) -> Series

The aging rate profile of the provided paper insulation material.

Given a hot-spot temperature profile, calculate the days aged for each time step in the profile. Given a hot-spot temperature profile, calculate the days aged for each time step in the profile.

Parameters:

Name Type Description Default
hot_spot_profile Series

The hot-spot temperature profile of the transformer.

required
insulation_type PaperInsulationType

The type of paper insulation material.

required
Calculating the aging rate profile for a hot-spot temperature profile.
>>> import pandas as pd
>>> from transformer_thermal_model.aging import aging_rate_profile
>>> from transformer_thermal_model.transformer import PaperInsulationType

>>> datetime_index = pd.date_range("2020-01-01", periods=10, freq="15min", tz="UTC")
>>> hot_spot_profile = pd.Series([100] * 10, index=datetime_index)
>>> profile = aging_rate_profile(hot_spot_profile, PaperInsulationType.NORMAL)
>>> print(profile)
2020-01-01 00:00:00+00:00    1.259921
2020-01-01 00:15:00+00:00    1.259921
2020-01-01 00:30:00+00:00    1.259921
2020-01-01 00:45:00+00:00    1.259921
2020-01-01 01:00:00+00:00    1.259921
2020-01-01 01:15:00+00:00    1.259921
2020-01-01 01:30:00+00:00    1.259921
2020-01-01 01:45:00+00:00    1.259921
2020-01-01 02:00:00+00:00    1.259921
2020-01-01 02:15:00+00:00    1.259921
Freq: 15min, dtype: float64

Returns:

Type Description
Series

pd.Series: Aging in day/day over time.

Source code in transformer_thermal_model/aging/aging.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
def aging_rate_profile(hot_spot_profile: pd.Series, insulation_type: PaperInsulationType) -> pd.Series:
    """The aging rate profile of the provided paper insulation material.

    Given a hot-spot temperature profile, calculate the days aged for each time step in the profile.
    Given a hot-spot temperature profile, calculate the days aged for each time step in the profile.

    Args:
        hot_spot_profile (pd.Series): The hot-spot temperature profile of the transformer.
        insulation_type (PaperInsulationType): The type of paper insulation material.

    Example: Calculating the aging rate profile for a hot-spot temperature profile.
        ```python
        >>> import pandas as pd
        >>> from transformer_thermal_model.aging import aging_rate_profile
        >>> from transformer_thermal_model.transformer import PaperInsulationType

        >>> datetime_index = pd.date_range("2020-01-01", periods=10, freq="15min", tz="UTC")
        >>> hot_spot_profile = pd.Series([100] * 10, index=datetime_index)
        >>> profile = aging_rate_profile(hot_spot_profile, PaperInsulationType.NORMAL)
        >>> print(profile)
        2020-01-01 00:00:00+00:00    1.259921
        2020-01-01 00:15:00+00:00    1.259921
        2020-01-01 00:30:00+00:00    1.259921
        2020-01-01 00:45:00+00:00    1.259921
        2020-01-01 01:00:00+00:00    1.259921
        2020-01-01 01:15:00+00:00    1.259921
        2020-01-01 01:30:00+00:00    1.259921
        2020-01-01 01:45:00+00:00    1.259921
        2020-01-01 02:00:00+00:00    1.259921
        2020-01-01 02:15:00+00:00    1.259921
        Freq: 15min, dtype: float64

        ```

    Returns:
        pd.Series: Aging in day/day over time.
    """
    return hot_spot_profile.apply(_aging_rate_method(insulation_type))

days_aged

days_aged(
    hot_spot_profile: Series,
    insulation_type: PaperInsulationType,
) -> float

Number of days the insulation material inside the transformer has aged.

Calculates the number of days the provided insulation material has aged given the hot-spot temperature profile. For a more accurate representation of the number of days aged per timestep of the provided hot-spot temperature profile, see :func:aging_rate_profile.

Parameters:

Name Type Description Default
hot_spot_profile Series

The hot-spot temperature profile of the transformer.

required
insulation_type PaperInsulationType

The type of paper insulation material.

required
Calculating the number of days aged across the entire profile.
>>> import pandas as pd
>>> from transformer_thermal_model.aging import days_aged
>>> from transformer_thermal_model.transformer import PaperInsulationType

>>> one_day = 24 * 4 + 1
>>> datetime_index = pd.date_range("2020-01-01", periods=one_day, freq="15min", tz="UTC")
>>> hotspot_profile = pd.Series(100, index=datetime_index)
>>> total_aging = days_aged(hotspot_profile, PaperInsulationType.NORMAL)
>>> print(total_aging)
1.26

Returns:

Name Type Description
float float

The total aging in days for the period of the given temperature profile.

Source code in transformer_thermal_model/aging/aging.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
def days_aged(hot_spot_profile: pd.Series, insulation_type: PaperInsulationType) -> float:
    """Number of days the insulation material inside the transformer has aged.

    Calculates the number of days the provided insulation material has aged
    given the hot-spot temperature profile. For a more accurate representation
    of the number of days aged per timestep of the provided hot-spot temperature
    profile, see :func:`aging_rate_profile`.

    Args:
        hot_spot_profile (pd.Series): The hot-spot temperature profile of the transformer.
        insulation_type (PaperInsulationType): The type of paper insulation material.

    Example: Calculating the number of days aged across the entire profile.
        ```python
        >>> import pandas as pd
        >>> from transformer_thermal_model.aging import days_aged
        >>> from transformer_thermal_model.transformer import PaperInsulationType

        >>> one_day = 24 * 4 + 1
        >>> datetime_index = pd.date_range("2020-01-01", periods=one_day, freq="15min", tz="UTC")
        >>> hotspot_profile = pd.Series(100, index=datetime_index)
        >>> total_aging = days_aged(hotspot_profile, PaperInsulationType.NORMAL)
        >>> print(total_aging)
        1.26

        ```

    Returns:
        float: The total aging in days for the period of the given temperature profile.
    """
    aging_profile = hot_spot_profile.apply(_aging_rate_method(insulation_type))
    seconds_aged = aging_profile.index.to_series().diff().dt.total_seconds().fillna(0)
    total_seconds_aged = (aging_profile * seconds_aged).sum()
    total_days_aged = total_seconds_aged / (60 * 60 * 24)  # convert seconds to days

    logger.info(f"Total aging: {total_days_aged} days")
    return total_days_aged