필터 지우기
필터 지우기

I want to simulate a sine waveform with voltage sag in MATLAB (mfile). How can I do this?

조회 수: 7 (최근 30일)
I want to simulate a sine waveform with voltage sag in MATLAB (mfile). How can I do this?

채택된 답변

Voss
Voss 2022년 2월 19일
t=0:0.0001:0.3;
f=50;
Vm=1.4;
Vsag=0.2;
V = Vm*sin(2*pi*f*t);
idx = t > 0.1 & t < 0.2;
V(idx) = V(idx)*Vsag/Vm;
plot(t,V,'LineWidth',2);
set(gca(), ...
'Color','k', ...
'XColor','w', ...
'YColor','w', ...
'XGrid','on', ...
'YGrid','on', ...
'GridColor','w', ...
'GridAlpha',1, ...
'TickLength',[0; 0], ...
'XTickLabel',{}, ...
'YTickLabel',{});

추가 답변 (1개)

sajad Tarverdian
sajad Tarverdian 2022년 2월 27일
Thanks for answering the previous question, what codes should be written now to get and draw the effective voltage value( true RMS) in this question?
  댓글 수: 2
Voss
Voss 2022년 2월 27일
t=0:0.0001:0.3;
f=50;
Vm=1.4;
Vsag=0.2;
V = Vm*sin(2*pi*f*t);
Vrms = Vm/sqrt(2)*ones(1,numel(t));
idx = t > 0.1 & t < 0.2;
V(idx) = V(idx)*Vsag/Vm;
Vrms(idx) = Vrms(idx)*Vsag/Vm;
plot(t,V,'LineWidth',2);
hold on
plot(t,Vrms,'LineWidth',2,'Color','r','LineStyle','--');
set(gca(), ...
'Color','k', ...
'XColor','w', ...
'YColor','w', ...
'XGrid','on', ...
'YGrid','on', ...
'GridColor','w', ...
'GridAlpha',1, ...
'TickLength',[0; 0], ...
'XTickLabel',{}, ...
'YTickLabel',{});

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by