Fourier expansion of dirac delta function

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

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

According to theory maximum value of the graph must be equal to F0 which is 10000 in this case. It increses with numbres of n and i can't figure out why.
I'm not familiar with that sum as an expression for the delta function. Can you post a source?
Having said that, should term outside the sum be 2*F0/nmax ?
L=10;
F0=10000;
v0=1;
t=4;
x=-10:0.1:10;
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+2*F0/nmax*sin(wn*v0*t)*sin(wn*x);
end
figure
plot(x, f);
grid;
end
All three plots peak at F0 = 10000. Whether or not the area under the curve for x>0 is also approaching F0 as should be the case for the dirac function is another question.
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.
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)

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 6 Apr 2022

Commented:

on 7 Apr 2022

Community Treasure Hunt

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

Start Hunting!