pade-laplace: stuck with pade approximation!

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 comentarios

Walter Roberson
Walter Roberson el 10 de Ag. de 2011
What are "L1" and "L2", and do they relate to "l1" and "l2" ?
Amir Hamzah UTeM
Amir Hamzah UTeM el 10 de Ag. de 2011
sorry,they related..i am forgot that change it into capital when i re-type here.
Amir Hamzah UTeM
Amir Hamzah UTeM el 10 de Ag. de 2011
my problem is right now,i dont know how to use pade approximation for the next procedure. when i do it manually like pade=L(s-1)/L(s) matlab take too long to produce the last equation.
for t=1:100
syms A1 A2 L1 L2
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)
end
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

Iniciar sesión para comentar.

Respuestas (1)

Paulo Silva
Paulo Silva el 11 de Ag. de 2011
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 comentarios

Amir Hamzah UTeM
Amir Hamzah UTeM el 11 de Ag. de 2011
thank for replied,
how can i use pade function from the control system toolbox?
when i try type,
test=pade(lap,2)
it gives following error: ??? Error using ==> pade at 46
Function 'lt' is not implemented for MuPAD symbolic objects.
for the last result,i want an equation from rational expression obtained by the division of two polynomials of lap and lap1
Amir Hamzah UTeM
Amir Hamzah UTeM el 11 de Ag. de 2011
it is possible to get?
Paulo Silva
Paulo Silva el 11 de Ag. de 2011
Looking at your code more carefully I think that you are making some errors, first the pade approximation is for time delays on the frequency domain in the form exp(-s*T), your expression is in the time domain and when converted to the frequency domain gives exponential values but they are constant not in the form exp(-s*T) so they are not delays.
Amir Hamzah UTeM
Amir Hamzah UTeM el 11 de Ag. de 2011
so how can i get in form exp(-s*T)? what should i do? i really don't have any idea.
Paulo Silva
Paulo Silva el 11 de Ag. de 2011
here's a clue
s=sym('s')
il=ilaplace(exp(-s*0.1))
laplace(il)
Paulo Silva
Paulo Silva el 11 de Ag. de 2011
http://www.mathworks.com/help/toolbox/control/ug/bstzkhr.html

Iniciar sesión para comentar.

Preguntada:

el 10 de Ag. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by