pade-laplace: stuck with pade approximation!
5 ビュー (過去 30 日間)
古いコメントを表示
hi..im try to use pade-laplace method in matlab to model multi exponential,however im stuck at part with pade approximation. here my code,
for t=1:100
syms A1 A2 L1 L2
y(t)=A1*exp(-L1*t)+A2*exp(-L2*t);
end
lap=laplace(y)
i dont know how to use pade approximation with this function for the next process. can someone guide me? thanks.
3 件のコメント
回答 (1 件)
Paulo Silva
2011 年 8 月 11 日
Why do you define the symbolic variables in every loop? there's no need for it, just define the symbolic variables once before the for loop.
Now for the time it takes you probably know the reason, the symbolic operations and mostly the laplace is causing the slowness.
Try the pade function from the Control System Toolbox
This version of your code should be faster
syms A1 A2 L1 L2
t=1:100;
y(t)=A1*exp(-L1*(t-1))+A2*exp(-L2*(t-1)); %y(t-1)
y1(t)=A1*exp(-L1*t)+A2*exp(-L2*t); %y(t)
lap=laplace(y); % get L(s-1)
lap1=laplace(y1); % get L(s)
pad=lap./lap1; % take too long to process L(s-1)/L(s)
6 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!