voltage sag signal genaration
18 views (last 30 days)
Show older comments
hi
i am new to matlab and i want to generate voltage sag signal through m-file by using following equation,
v(t)=(1-A(u(t-t1)-u(t-t2)))sin(ωt);
where 0.1 ≤ A ≤ 0.9 is the depth of voltage sag, u(t) is unit step function, t1 and t2 is the moment of sag starting and ending, T ≤ t2-t1 ≤ 6T (T is the periodic), and ω is fundamental angle frequency.
And i just tried by following command but i did not get. it shows error.
u = inline('t >= 0');
t = [0:0.1:50]; %waveform generation
A=0.7; t1=12; t2=24;
v=(1-A*(u(t-t1)-u(t-t2)))*sin(2*pi*50*t);
plot(v);
so, please help me.
thank u in advance.
0 Comments
Accepted Answer
Walter Roberson
on 9 Feb 2012
v=(1-A*(u(t-t1)-u(t-t2)))*sin(2*pi*50*t);
should be
v=(1-A*(u(t-t1)-u(t-t2))).*sin(2*pi*50*t);
2 Comments
Appy18
on 13 Nov 2014
I tried the above piece of code but there happens to be no difference between my original sine wave and the sagged one. They both look the same
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!