You are on page 1of 1

Dx=1;

u=800000;
DT=0.2*Dx/u;
tstep=DT;
duration=0.000350
steps=duration/tstep;

A = 0.005 % mm
fc = 100000 % Hz
n = 3.5 % cycles

t=linspace(0,0.000035,1000);

for i = 1:length(t)
y(i)=A/2*sin(2.*pi*fc*t(i))*(1-cos((2*pi*fc*t(i))/n));
end

for i = length(y):steps
y(i)=0;
end

You might also like