12 堆叠面积 stackplot

用途

总量与组成同时随时间变化,如日电源出力构成、负荷构成。

示例(5 张)

12-1 日电源出力构成(火电、光伏、风电、储能)

日电源出力构成(火电、光伏、风电、储能)

12-2 工业用户日负荷构成

工业用户日负荷构成

12-3 配电网线损构成随负荷变化

配电网线损构成随负荷变化

12-4 谐波电流各次分量随时间的叠加

谐波电流各次分量随时间的叠加

12-5 多能互补系统供能构成(电、热、冷)

多能互补系统供能构成(电、热、冷)

代码

以下 5 个函数取自 code/第三批_面积与场261106.py,直接调用即可出图。版式(宋体 + Times、10 磅、刻度朝内四边、图内无标题、留白自检)由 code/公共配置261106.py 的 setup_cn_style() 与 save() 统一提供。

# 摘自 code/第三批_面积与场261106.py

def stack_01():
    """日电源出力构成(火电、光伏、风电、储能)。"""
    fig, ax = new_fig()
    t = np.arange(0, 24.01, 0.5)
    pv = np.where((t > 6) & (t < 19), 420 * np.sin((t - 6) / 13 * np.pi) ** 1.4, 0)
    wind = 180 + 60 * np.sin(t / 3.4) + 30 * np.sin(t / 1.3)
    ess = np.where((t >= 18) & (t < 22), 120, 0) - np.where((t >= 1) & (t < 6), 80, 0)
    th = 520 - pv * 0.42 - ess * 0.3 + 60 * np.exp(-((t - 19) / 2.2) ** 2)
    ax.stackplot(t, th, pv, wind, np.clip(ess, 0, None),
                 colors=[C4, C3, C5, C1], alpha=0.92, linewidth=0.4,
                 edgecolor="white",
                 labels=["火电", "光伏", "风电", "储能放电"])
    ax.set_xlabel("时间 " + IT["t"] + " / h")
    ax.set_ylabel("出力 " + IT["P"] + " / MW")
    ax.set_xlim(0, 24)
    ax.set_ylim(0, 1360)
    legend(ax, "upper center", ncol=2)
    save(fig, "12_堆叠面积", "12_堆叠面积_日电源出力构成")

def stack_02():
    """工业用户日负荷构成。"""
    fig, ax = new_fig()
    t = np.arange(0, 24.01, 0.5)
    motor = 280 + 90 * np.exp(-((t - 10) / 4.0) ** 2) + 60 * np.exp(-((t - 16) / 3.0) ** 2)
    furnace = 180 + 40 * np.sin(t / 4.2) ** 2
    lighting = np.where((t > 6) & (t < 22), 60, 12)
    hvac = 40 + 70 * np.exp(-((t - 14) / 4.4) ** 2)
    ax.stackplot(t, motor, furnace, lighting, hvac,
                 colors=[C1, C5, C3, C6], alpha=0.92, linewidth=0.4,
                 edgecolor="white",
                 labels=["电机", "电炉", "照明", "空调"])
    ax.set_xlabel("时间 " + IT["t"] + " / h")
    ax.set_ylabel("有功负荷 " + IT["P"] + " / kW")
    ax.set_xlim(0, 24)
    ax.set_ylim(0, 930)
    legend(ax, "upper center", ncol=2)
    save(fig, "12_堆叠面积", "12_堆叠面积_工业用户负荷构成")

def stack_03():
    """配电网线损构成随负荷变化。"""
    fig, ax = new_fig()
    beta = np.linspace(0.2, 1.2, 30)
    line = 2.8 * beta ** 2
    cu = 1.4 * beta ** 2
    core = np.full_like(beta, 1.1)
    meter = np.full_like(beta, 0.35)
    ax.stackplot(beta, line, cu, core, meter,
                 colors=[C1, C5, C3, C6], alpha=0.92, linewidth=0.4,
                 edgecolor="white",
                 labels=["中压线路", "配变负载", "配变空载", "计量"])
    ax.set_xlabel("负载率 " + IT["beta"])
    ax.set_ylabel("线损率 / %")
    ax.set_xlim(0.2, 1.2)
    ax.set_ylim(0, 8.2)
    legend(ax, "upper left", ncol=2)
    save(fig, "12_堆叠面积", "12_堆叠面积_线损构成随负载变化")

def stack_04():
    """谐波电流各次分量随时间的叠加。"""
    fig, ax = new_fig()
    t = np.arange(0, 24.01, 0.5)
    h3 = 18 + 14 * np.exp(-((t - 11) / 3.6) ** 2) + 12 * np.exp(-((t - 18) / 3.0) ** 2)
    h5 = 12 + 9 * np.exp(-((t - 10) / 3.2) ** 2) + 8 * np.exp(-((t - 17) / 2.8) ** 2)
    h7 = 6 + 5 * np.exp(-((t - 10) / 3.4) ** 2)
    h11 = 2.4 + 2.0 * np.exp(-((t - 11) / 3.0) ** 2)
    ax.stackplot(t, h3, h5, h7, h11,
                 colors=[C1, C5, C3, C6], alpha=0.92, linewidth=0.4,
                 edgecolor="white",
                 labels=["3 次", "5 次", "7 次", "11 次"])
    ax.set_xlabel("时间 " + IT["t"] + " / h")
    ax.set_ylabel("谐波电流 " + IT["I"] + SUB["h"] + " / A")
    ax.set_xlim(0, 24)
    ax.set_ylim(0, 75)
    legend(ax, "upper center", ncol=2)
    save(fig, "12_堆叠面积", "12_堆叠面积_谐波电流分量叠加")

def stack_05():
    """多能互补系统供能构成(电、热、冷)。"""
    fig, ax = new_fig()
    m = np.arange(1, 13)
    ele = np.array([320, 296, 268, 240, 232, 258, 302, 316, 280, 246, 262, 310])
    heat = np.array([420, 386, 268, 142, 68, 22, 8, 10, 46, 158, 306, 412])
    cool = np.array([12, 18, 46, 118, 226, 318, 372, 344, 212, 96, 26, 14])
    ax.stackplot(m, ele, heat, cool, colors=[C1, C3, C5], alpha=0.92,
                 linewidth=0.4, edgecolor="white", labels=["电负荷", "热负荷", "冷负荷"])
    ax.set_xlabel("月份")
    ax.set_ylabel("供能量 / (MW·h)")
    ax.set_xlim(1, 12)
    ax.set_ylim(0, 1000)
    legend(ax, "upper center", ncol=3)
    save(fig, "12_堆叠面积", "12_堆叠面积_多能互补供能构成")

说明

  • 图片 1181×944 px(100 mm × 80 mm @ 300 dpi),三维图为 1181×1122 px。
  • 图内不放标题,图题由本文件的标题承担。
  • 数据为 10 kV 配网、380 V 低压、50 Hz 量级的仿真算例,随机种子固定,重跑结果一致。
posted on 2026-11-07 01:03  小青蛙电气  阅读(3)  评论(0)    收藏  举报