I want to simulate a sine waveform with voltage sag in MATLAB (mfile). How can I do this?
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
sajad Tarverdian
le 18 Fév 2022
Modifié(e) : sajad Tarverdian
le 7 Mar 2022
I want to simulate a sine waveform with voltage sag in MATLAB (mfile). How can I do this?
0 commentaires
Réponse acceptée
Voss
le 19 Fév 2022
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',{});
0 commentaires
Plus de réponses (1)
sajad Tarverdian
le 27 Fév 2022
2 commentaires
Voss
le 27 Fév 2022
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',{});
Voir également
Catégories
En savoir plus sur Axes Appearance dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!