Complex Fourier Series in MATLAB

4 visualizaciones (últimos 30 días)
Aijalon Marsh
Aijalon Marsh el 31 de Oct. de 2020
Comentada: Abhi Rane el 15 de Jul. de 2021
Hello I'm tyring to solve this Complex fourier series porblem but for some reason when I solve for F1 I get an error and I'm not sure why because I have know warings so it should run smoothly. I would appreciate any assistance in resolving this issue and thank you in adavnce.
% Problem_1 the Complex Foruier series of the function f(x)
% f(x)=-1 -pi < x < 0
% f(x)=1 0 < x < pi
syms x n real
syms n integer
P = sym(2);
y = -1;
y1= 1;
Cn=int(y*exp(-1i*n*P*x/P),x,-P,0)+int(y1*exp(-1i*n*P*x/P),x,0,P);
Co=int(y,x,-P,0)+int(y1,x,0,P);
Ca=subs(Cn,cos(x),(exp(1i*x)+exp(-1i*x))/2);
Fn=(1/2*P)*Ca;
Fa=(1/2)*(1/P)*Co;
F1=symsum(Fn*exp(1i*n*P*x/P),n,-Inf,Inf);
display (F1)
  2 comentarios
VBBV
VBBV el 1 de Nov. de 2020
% f(x)=-1 -pi < x < 0
% f(x)=1 0 < x < pi
syms x n real
syms n integer
P = sym(2);
y = -1;
y1= 1;
Cn=int(y*exp(-1i*n*P*x/P),x,-P,0)+int(y1*exp(-1i*n*P*x/P),x,0,P);
Co=int(y,x,-P,0)+int(y1,x,0,P);
Ca=subs(Cn,cos(x),(exp(1i*x)+exp(-1i*x))/2);
Fn=(1/2*P)*Ca;
Fa=(1/2)*(1/P)*Co;
F1=symsum(Fn*exp(1i*n*P*x/P),n,-Inf,Inf);
display (F1)
Aijalon Marsh
Aijalon Marsh el 1 de Nov. de 2020
Um I sorry but I'm not sure what you've done to improve upon my issue cause I still have the same problem.

Iniciar sesión para comentar.

Respuesta aceptada

VBBV
VBBV el 1 de Nov. de 2020
% if true
% code
%end
F1=symsum(Fn*exp(1i*n*P*x/P),x,[-Inf,Inf])
Use x as the summing variable.
  2 comentarios
Aijalon Marsh
Aijalon Marsh el 1 de Nov. de 2020
ok thank you.
Abhi Rane
Abhi Rane el 15 de Jul. de 2021
Does it work?

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by