voltage sag signal genaration

18 views (last 30 days)
saravanan
saravanan on 9 Feb 2012
Commented: Appy18 on 13 Nov 2014
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.

Accepted Answer

Walter Roberson
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
saravanan
saravanan on 10 Feb 2012
thank u sir.
Appy18
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

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!