Numerical Laplace Transform
% Example 1
f1 = @(t) t.^2;
Lapf1 = @(s) LapTrans(f1,s);
sc = 1:0.1:10;
sp = 1:10;
yc = 2./sc.^3;
yp = arrayfun(Lapf1, sp);
figure(1)
plot(sc,yc,'r',sp,yp,'*');
legend('Exact Transformation', 'Approximate Transformation');
title('Numerical Laplace Transform (t^2)')
% Example 2
f1 = @(t) sin(t);
Lapf1 = @(s) LapTrans(f1,s);
sc = 1:0.1:10;
sp = 1:10;
yc = 1./(1 + sc.^2);
yp = arrayfun(Lapf1, sp);
figure(2)
plot(sc,yc,'r',sp,yp,'*');
legend('Exact Transformation', 'Approximate Transformation');
title('Numerical Laplace Transform (sin(t))')
% Example 3
f1 = @(t) besselj(0, t);
Lapf1 = @(s) LapTrans(f1,s);
sc = 1:0.1:10;
sp = 1:10;
yc = 1./sqrt(1 + sc.^2);
yp = arrayfun(Lapf1, sp);
figure(3)
plot(sc,yc,'r',sp,yp,'*');
legend('Exact Transformation', 'Approximate Transformation');
title('Numerical Laplace Transform (besselj(0, t))')
% Example 4
n = 0.358;
f1 = @(t) besselk(n, t);
Lapf1 = @(s) LapTrans(f1,s);
sc = 1:0.1:10;
sp = 1:10;
c = sqrt(-1 + sc.^2);
yc = (pi * (sc + c).^(-n).*(-1 + (sc + c).^(2*n)))./(2*c*sin(n*pi));
yp = arrayfun(Lapf1, sp);
figure(4)
plot(sc,yc,'r',sp,yp,'*');
legend('Exact Transformation', 'Approximate Transformation');
title('Numerical Laplace Transform (besselk(0.358, t))')
引用格式
Lateef Adewale Kareem (2024). Numerical Laplace Transform (https://www.mathworks.com/matlabcentral/fileexchange/60837-numerical-laplace-transform), MATLAB Central File Exchange. 检索时间: .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux类别
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!LaplaceTransform/
版本 | 已发布 | 发行说明 | |
---|---|---|---|
1.0.0.0 |