How can I clarify an undefined function response in MATLAB?

So I've been tweaking a very simple code to plot a few functions in MATLAB using the step and tf functions coupled with the laplace and ilaplace to generate a few graphs. I first wanted to generate an ideal step response for a few inputs in the form of a transfer function, then move on to more realistic estimates using a form of the Boltzmann Sigmoid eqn, assuming several constant values. I've included the full code below for reference.
%%Ideal Unit Step Response %%
w0 = 1; %rad/s%
zeta = 0.15; %damping ratio%
wn = (w0)/((1-(zeta^2))^(1/2));
R = 1;
num = (wn^2);
den = [1 (2*zeta*wn) (wn^2)];
Ideal = tf(num,den);
t=0:0.1:30;
step(R*Ideal,t);
axis([0 30 0 2]);
stepinfo(Ideal)
%%Boltzmann Sigmoid Function (time domain method) %%
a = 0;
b = 1;
c = 6;
T = 0.1;
s = a+b/(1+exp(c*(T-1)));
% sym('Ideal');
h = ilaplace(Ideal);
y = conv(s,h);
%%Boltzmann Sigmoid Function (s-domain method) %%
S = laplace(s);
Y = S*Ideal;
y = ilaplace(Y);
The Ideal step response runs fine, but the time domain method using the approximation function stumps with
"Undefined function 'ilaplace' for input arguments of type 'tf'."
Similarly, the S domain method yields a
"Undefined function 'laplace' for input arguments of type'double'."
Is there any insight as to what may cause these issues? I thought maybe the code didn't like solving both a TF and an ilaplace at the same time, so I used the 'sym' function, but it seemed to not work. :/

 採用された回答

Walter Roberson
Walter Roberson 2017 年 11 月 15 日
編集済み: Walter Roberson 2017 年 11 月 16 日

1 投票

tf creates a transfer function object; even if you use tf('s'), that is a transfer function object.
laplace() and ilaplace() are symbolic toolbox, and do not take accept transfer function objects. The File Exchange routine linked to above shows how to extract information from a transfer function and use it with symbolic ilaplace

4 件のコメント

Walter Roberson
Walter Roberson 2017 年 11 月 16 日
Sorry, I got the wrong link before; I have fixed it.
Michael Dupre
Michael Dupre 2017 年 11 月 16 日
thanks bud, hopefully this will help!
Michael Dupre
Michael Dupre 2017 年 11 月 16 日
Output argument "ans" (and maybe others) not assigned during call to "ilaplacetf".
Unfortunately there appears to be a small hiccup inside the custom function. Time to go diving.
Walter Roberson
Walter Roberson 2017 年 11 月 16 日
ans is a special name; at some point the behaviour when you used ans as the output variable name changed. I recommend just changing the references from ans to some other otherwise unused variable name... for example output

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by