⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fourier.m

📁 本文件采用Matlab软件
💻 M
字号:
% Numerical Inversion of Laplace Transforms: 
% The Fourier Series Approximation

% Author's Data: Housam BINOUS
% Department of Chemical Engineering
% National Institute of Applied Sciences and Technology
% Tunis, TUNISIA
% Email: binoushousam@yahoo.com 

% We perform numerical inversion of F(s)=1/(s^2+1)
% Result is compared to the analytical solution f(t)=sin(t)

Er=10^-8;

sg0=0.001;

T=50;

sg=sg0-log(Er)/(2*T);

t=0.01:0.01:10;

f=zeros(1,1000);

f=f+1/2*1/(sg^2+1);

for p=1:2000
    f=f+real(1/((sg+p*pi*i/T)^2+1).*cos(p*pi*t/T))...
        -imag(1/((sg+p*pi*i/T)^2+1).*sin(p*pi*t/T));
end

f=f.*exp(sg*t)/T

plot(t,f,'c*')

hold on

plot(t,sin(t),'b')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -