Numerical Laplace Transform

Often times, we are faced with the need to compute the laplace ransfrom of complex function.
562.0 次下载
更新时间 2016/12/20

查看许可证

% 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 版本兼容性
创建方式 R2015a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Bessel functions 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.0.0.0