Borrar filtros
Borrar filtros

How could I calculate the correct Laplace Inverse using ilaplace()?

1 visualización (últimos 30 días)
I am performing the calculation of an expression in the time domain. To do this, I start with the expression associated with the system's output to a unit step input in the Laplace domain and apply the inverse transform, obtaining the expression in the time domain.
I attach the code I'm using for this:
syms s Ki Kp;
num=(0.7846*Kp*s^2)+((0.0987*Kp+0.7849*Ki)*s)+0.0987*Ki;
den=(s^5)+(0.7849*s^4)+((0.0987+0.7846*Kp)*s^3)+((0.0987*Kp+0.7846*Ki)*s^2)+0.0987*Ki*s;
Thetam=simplify(num/den);
thetam=ilaplace(Thetam);
However, the result I obtain is the following:
3*Ki*symsum(exp(t*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k))/(7846*Ki + 987*Kp + 15692*Kp*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k) + 23538*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^2 + 40000*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^3 + 1974*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)), k, 1, 4) - 7846*symsum((exp(t*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k))*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^2)/(7846*Ki + 987*Kp + 15692*Kp*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k) + 23538*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^2 + 40000*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^3 + 1974*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)), k, 1, 4) - 10000*symsum((exp(t*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k))*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^3)/(7846*Ki + 987*Kp + 15692*Kp*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k) + 23538*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^2 + 40000*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^3 + 1974*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)), k, 1, 4) - 987*symsum((exp(root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)*t)*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k))/(7846*Ki + 987*Kp + 1974*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k) + 23538*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^2 + 40000*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)^3 + 15692*Kp*root(z^4 + (3923*z^3)/5000 + (3923*Kp*z^2)/5000 + (987*z^2)/10000 + (987*Kp*z)/10000 + (3923*Ki*z)/5000 + (987*Ki)/10000, z, k)), k, 1, 4) + 1
How could I obtain the correct result, without "symsum", "root", etc?
I see some examples in the forum but I dont know how to adapt them to my code:
Thanks in advanced!

Respuestas (1)

Walter Roberson
Walter Roberson el 5 de Oct. de 2023
Editada: Walter Roberson el 7 de Oct. de 2023
https://www.mathworks.com/matlabcentral/answers/1437209-how-to-simplify-function-handles#comment_1698679 has code that can convert root() of polynomial up to degree 4 into explicit solutions.
The generated solutions will be pretty long.
  2 comentarios
Daniel Bilbao Moreno
Daniel Bilbao Moreno el 5 de Oct. de 2023
Thank you! I will try to get the expression using this approach.
On the other hand, I have seen that you have used another software to obtain the solution in one of the examples on the forum that I have attached to the post. Do you recommend it?
In my case, I need this long solution in a symbolic way, to be able to tune a controller in an analytical way so... It doesn't matter how but I need to be able to calculate the full expression.
Any suggestions?
Thanks again!
Walter Roberson
Walter Roberson el 7 de Oct. de 2023
Editada: Walter Roberson el 7 de Oct. de 2023
The two main symbolic operations competitors that I know of, are Mathematica (Wolfram Research), and Maple (Maplesoft) .
Mathematica has a lot of adherents, and it has a very diverse library. You can do a lot with it, and I would not say that investigating it would be a "mistake" by any means. It works really well for a lot of people for what they happen to do. But it isn't to everyone's tastes.
Maple is less popular, and in some ways less flexible -- for example you probably would not write a home automation interface in Maple but you might in Mathematica. But the people who developed Maple are very serious mathematicians so there are definitely parts of Maple that are more thorough than Mathematica. For the times when you have a tough integral and you want to explore 7+ different strategies for integration. "Let's see if we can transform this into something that has the potential to be solved with a Galois-Zabronsky Iterated Gamma Basis..."
The internal operation of the symbolic engine used by MATLAB, which is named MuPAD, is based or heavily inspired by the structure of Maple.
I have used both Mathematica and Maple. For the work I do, Maple works better for me.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!