天天看点

matlab simulink 电网扫频仿真和分析

1、内容简介

375-可以交流、咨询、答疑

2、内容说明

3、仿真分析

clc

close all

clear

tic

fre_ini = 1 ; % 初始频率

fre_end = 100; % 最终频率

fre_sample = 1/fre_end/8; % 仿真采样频率

time = fre_end; % 频率从初始频率扫频到最终频率的时间/s

U = 220;% 输入电压幅值

R = 0.0525;

L = 0.415/(2*pi*50);

C = 72e-6/(2*pi*50);

G = 0;

if G==0

    sim('saopin0.slx')

else

    sim('saopin.slx')

end

t = 0:fre_sample:tout(end);

Is_out = interp1(tout,yout(:,2),t);

Vs_out = interp1(tout,yout(:,3),t);

figure

plot(t,Is_out)

xlabel 时间/s

ylabel 电流/I

figure

plot(t,Vs_out)

xlabel 时间/s

ylabel 电压/V

[~,Is0,phase_I]=change_fft(1/fre_sample,Is_out); % 调用傅里叶变换

[f,Vs0,phase_V]=change_fft(1/fre_sample,Vs_out);

figure

plot(f,Is0)

xlabel 频率/Hz

ylabel 电流幅值

figure

plot(f,Vs0)

xlabel 频率/Hz

ylabel 电压幅值

% Z_abs = Vs0./Is0;

% Z_phase = phase_V-phase_I;

% figure

% plot(f,Z_abs)

% xlabel 频率/Hz

% ylabel 阻抗幅值/ohm

% figure

% plot(f,Z_phase)

% xlabel 频率/Hz

% ylabel 阻抗相位/°

R_z = Vs0./(eps+Is0);

[f_R,R_f,phase_R_f]=change_fft(1/fre_sample,R_z);

figure

plot(f_R,R_f)

xlabel 频率/Hz

ylabel 阻抗幅值/ohm

figure

plot(f_R,phase_R_f)

xlabel 频率/Hz

ylabel 阻抗相位/°

toc

matlab simulink 电网扫频仿真和分析
matlab simulink 电网扫频仿真和分析

4、参考论文