交流电学的一点都不好 (3)和(4)没有头绪

方波源的峰值和平均值知道了说明他是对称的,但接下来该怎么处理呢?

img

直接按照功率计算公式计算
I (t)= U(t)/R;
P (t)= I(t)U(t);
平均功率:Pmean = E/T=sum(p(t))/N

MATLAB代码如下:
clear;
close all;
clc;

%% 正弦电压源
R = 1e3;
f=50;
fs = 10000;
T = 0.2;
t = 0:1/fs:T;

% 瞬时电压
U = 10sin(2pift);
% 瞬时电流
I = U/R;
% 瞬时功率
P = U.*I;

% 平均功率
Pmean = mean(P);

figure;
subplot(211)
plot(U);
title('正弦电压源信号')
subplot(212)
plot(P);
title('输出瞬时功率')

%% 方波源(峰值20,均值0)
N = 100;
U0 = 20*ones(1,N);
U1 = [U0,-U0,U0,-U0,U0,-U0,U0,-U0];
I1 = U1/R;
P1 = U1.*I1;

% 平均功率
P1mean = mean(P1);

figure;
subplot(211)
plot(U1);
title('方波源信号(峰值20,均值0)')
subplot(212)
plot(P1);
title('输出瞬时功率')

%% 方波源(峰值20,均值10)
U2 = [U0,0U0,U0,0U0,U0,0U0,U0,0U0];
I2 = U2/R;
P2 = U2.*I2;

% 平均功率
P2mean = mean(P2);

figure;
subplot(211)
plot(U2);
title('方波源信号(峰值20,均值10)')
subplot(212)
plot(P2);
title('输出瞬时功率')