Fourier expansion of dirac delta function

11 views (last 30 days)
Hi,
I am working on moving loads on beams and load is defiend by delta function as:
Sum of the series at x=v0*t must be equal to F0 for every n values. Below is my code that plots F0 and with increasing n value it also increases. I can't find what is wron with my code or isomething is wrong with the formulation?
L=10;
F0=10000;
v0=1;
t=4;
x=-10:0.1:10;
n=4;
f=0;
for i=1:n
wn=i*pi/L;
f=f+2*F0/L*sin(wn*v0*t)*sin(wn*x);
end
plot(x, f);
grid;

Accepted Answer

Paul
Paul on 6 Apr 2022
Increasing n to better approximate the infinte sum yields
L=10;
F0=10000;
v0=1;
t=4;
x=-10:0.1:10;
n=400;
f=0;
for i=1:n
wn=i*pi/L;
f=f+2*F0/L*sin(wn*v0*t)*sin(wn*x);
end
plot(x, f);
grid;
Don't know if that's what's expected.
  4 Comments
Paul
Paul on 7 Apr 2022
Edited: Paul on 7 Apr 2022
I think I found the formula: link
Implementing that formula, which is nearly the same as in the question yields a graph that doesn't peak at F0, but the area under the curve for x>0 is F0/2
L=10;
F0=10000;
v0=1;
t=4;
x=-10:0.0001:10; % smaller step size in x
for nmax = [300 400 500]
f=0;
for n = 1:nmax % changing the sum variable to n as in the Question
wn=n*pi/L;
f=f + F0/L*sin(wn*v0*t)*sin(wn*x);
end
figure
plot(x, f);
grid;
title("nmax = " + string(nmax) + ", Area for x > 0: " + string(trapz(x(x>0),f(x>0))))
end
So, the equation in the Question with addtional factor of two is correct in the sense that the area under the curve for x>0 would be equal to F0, for x > 0. Does it make sense for the problem at hand to restrict the domain to x >= 0?
I'm kind of surprised the that the Wolfram page doesn't mention anything about the factor of 2 and/or otherwise restrict the domain of x and y.
Emre Gemici
Emre Gemici on 7 Apr 2022
Ahh of course. F0 is not equal to peak value of the curve, it is equal to area under the curve between 0 and L. There is no need to restrict x or y. It is a periodic function with period of 2L (-L to L) but since our interval is 0 to L it is multiplied by 2. Thanks for helping.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!