Home > Back-end >  using ilaplace in conjunction with rltool
using ilaplace in conjunction with rltool

Time:07-31

Using Matlab, I have the following code:

s = tf('s')
K=0.5;
H= 1/(s*(s 2));
Hcl=feedback(K*H,1)
ilaplace(Hcl)
rltool(H)

I want to get the inverse laplace transform of the unity closed-loop system. rltool(H) generates automatically the unity closed-loop system. That's why I pass the open-loop system as an argument.

When I run this code, Matlab gives an error about ilaplace:

"Check for incorrect argument data type or missing argument in call to function 'ilaplace'."

Can someone help me how to use ilaplace and rltool concurrently

CodePudding user response:

I have found a solution for this problem.

syms s;
K=1/2;
H= 1/(s*(s 2))
Hcl=simplify(K*H/(1 K*H))
P=poles(Hcl)
ilaplace(Hcl)
H = syms2tf(Hcl)
rltool(H)

ilaplace works with symbolic expressions and not with a transfer function. By converting the symbolic expression to a transfer function midway of the code, I can use both functions in the same code.

Notice I've added the function simplify and changed the beginning from s=tf('s') to syms s

The function syms2tf() can be found here

  • Related