三维散点图(`scatter3`)

三维散点图(scatter3)

06_极坐标与特殊 5 张 MATLAB R2023b 100 mm 宽 @ 300 dpi

这个方法适合什么

三个变量直接映射到三维空间。适合:电压—电流—温度、节点在三维空间中的位置与状态、工况点的三维聚类。

电气场景

1 电压电流温度运行点云

2 配电网节点三维分布

3 电缆接头温度测点分布

4 变压器油色谱三组分分布

5 电池模组电压内阻温度分布

代码

脚本 p6_polar_special.m 中对应 scatter3 的一段,SEL 用于选择只跑某几个方法。

% ---- 6-1 电压—电流—温度运行点云 ----
try
    Uo = 10.2 + 0.35*randn(1,400);
    Io = 180 + 90*rand(1,400) + 8*randn(1,400);
    To = 42 + 0.055*(Io-180) + 5.5*(Uo-10.2).^2*10 + 2.2*randn(1,400);
    f = ml_fig(PP,100,90); ax = ax3(f,true);
    scatter3(ax,Uo,Io,To,20,To,'filled','MarkerFaceAlpha',0.75);
    colormap(ax,turbo); clim(ax,[min(To) max(To)]);
    xlabel(ml_tx('母线电压 <i>U</i> / kV'));
    ylabel(ml_tx('负荷电流 <i>I</i> / A'));
    zlabel(ml_tx('接头温度 <i>T</i> / °C'));
    xlim(ax,[9.5 11.0]); ylim(ax,[150 320]); zlim(ax,[30 75]);
    cb3(ax,PP,'温度 <i>T</i> / °C');
    save_png(f,FIGD,'电压电流温度运行点云');
catch ME, fprintf('[FAIL] 6-1 %s\n',ME.message); close all; end

% ---- 6-2 配电网节点三维分布 ----
try
    x = 0.4 + 5.6*rand(1,180); y = 0.3 + 4.2*rand(1,180);
    z = 0.6 + 1.4*rand(1,180) + 0.25*sin(2*x);
    uk = 10 + 0.32*randn(1,180);
    f = ml_fig(PP,100,90); ax = ax3(f,true);
    scatter3(ax,x,y,z,26,uk,'filled','MarkerFaceAlpha',0.80);
    colormap(ax,parula); clim(ax,[9.2 10.9]);
    xlabel(ml_tx('站区 <i>x</i> / km'));
    ylabel(ml_tx('站区 <i>y</i> / km'));
    zlabel(ml_tx('节点高度 <i>z</i> / m'));
    xlim(ax,[0 6.4]); ylim(ax,[0 4.8]); zlim(ax,[0.3 2.4]);
    cb3(ax,PP,'节点电压 <i>U</i> / kV');
    save_png(f,FIGD,'配电网节点三维分布');
catch ME, fprintf('[FAIL] 6-2 %s\n',ME.message); close all; end

% ---- 6-3 电缆接头温度测点 ----
try
    xs = repmat(1:6,1,7); ys = reshape(repmat(0:0.15:0.9,6,1),1,[]);
    Ts = 48 + 1.9*cos((xs-3.2)*0.9) + 4.2*ys + 0.9*randn(1,numel(xs));
    f = ml_fig(PP,100,90); ax = ax3(f,false);
    scatter3(ax,xs,ys,Ts,30,Ts,'filled','MarkerFaceAlpha',0.85);
    colormap(ax,turbo); clim(ax,[44 58]);
    xlabel(ml_tx('接头序号 <i>n</i>'));
    ylabel(ml_tx('轴向位置 <i>y</i> / m'));
    zlabel(ml_tx('表面温度 <i>T</i> / °C'));
    xlim(ax,[0.5 6.5]); ylim(ax,[-0.05 0.95]); zlim(ax,[42 58]);
    save_png(f,FIGD,'电缆接头温度测点分布');
catch ME, fprintf('[FAIL] 6-3 %s\n',ME.message); close all; end

% ---- 6-4 变压器油色谱三组分 ----
try
    H2 = 12 + 42*rand(1,120); CH4 = 6 + 26*rand(1,120); C2H2 = 0.4 + 3.2*rand(1,120).^2;
    idx = H2 + 1.6*CH4 + 9*C2H2;
    f = ml_fig(PP,100,90); ax = ax3(f,true);
    scatter3(ax,H2,CH4,C2H2,24,idx,'filled','MarkerFaceAlpha',0.8);
    colormap(ax,parula); clim(ax,[min(idx) max(idx)]);
    xlabel(ml_tx('氢气 <i>c</i>(H_2) / (\muL/L)'));
    ylabel(ml_tx('甲烷 <i>c</i>(CH_4) / (\muL/L)'));
    zlabel(ml_tx('乙炔 <i>c</i>(C_2H_2) / (\muL/L)'));
    xlim(ax,[0 56]); ylim(ax,[0 34]); zlim(ax,[0 3.8]);
    cb3(ax,PP,'产气综合指数');
    save_png(f,FIGD,'变压器油色谱三组分分布');
catch ME, fprintf('[FAIL] 6-4 %s\n',ME.message); close all; end

% ---- 6-5 电池模组电压—内阻—温度 ----
try
    n  = 240;
    soc = 20 + 70*rand(1,n);
    R  = 1.2 + 0.35*(1-soc/100) + 0.10*randn(1,n);
    Tb = 26 + 0.13*R*10 + 5.5*(1-soc/100) + 0.8*randn(1,n);
    Vc = 3.32 - 0.00035*soc + 0.008*randn(1,n);
    f = ml_fig(PP,100,90); ax = ax3(f,true);
    scatter3(ax,Vc*1000,R,Tb,26,Tb,'filled','MarkerFaceAlpha',0.8);
    colormap(ax,turbo); clim(ax,[25 38]);
    xlabel(ml_tx('单体电压 <i>U</i> / mV'));
    ylabel(ml_tx('内阻 <i>R</i> / m\Omega'));
    zlabel(ml_tx('表面温度 <i>T</i> / °C'));
    xlim(ax,[3285 3330]); ylim(ax,[1.15 1.70]); zlim(ax,[24 39]);
    cb3(ax,PP,'温度 <i>T</i> / °C');
    save_png(f,FIGD,'电池模组电压内阻温度分布');
catch ME, fprintf('[FAIL] 6-5 %s\n',ME.message); close all; end
posted @ 2026-11-10 08:30  小青蛙电气  阅读(2)  评论(0)    收藏  举报