Hey fellas, Simple problem here, but I can't seem to figure it. I'm trying to write two equations and combine the two before plotting the resulting time function.
For the first element:
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)
This strip will result in a plotted step response of a transfer function in the S domain. If my other equation is in the time domain, one must 'laplace' yes?
a = 0;
b = 1;
c = 6;
T = 0.1;
% Conversion to 'sym' from 'tf' is not possible.
G = a+(b./(1+exp(c*(T-t))));
S = laplace(G);
Y = S*Ideal;
y = ilaplace(Y);
With all input variables given except 't', one would think it's a simple matter to just laplace it and multiply the two in the S domain before ilplace back, but I've encountered three errors, each at different points:
Undefined function 'laplace' for input arguments of type 'double'.
Undefined function 'transform' for input arguments of type 'char'.
and, if we 'which laplace -all' and enter the function manually, we get
Error in laplace (line 28)
L = transform('laplace', 't', 's', 'z', F, varargin{:});
Eventually I want to plot the resulting function between these two; is there any insight on this issue?

 採用された回答

Walter Roberson
Walter Roberson 2017 年 11 月 21 日

0 投票

https://www.mathworks.com/matlabcentral/fileexchange/10816-mimo-toolbox has tf2sym and sym2tf to allow you to convert the tf (transfer function) to symbolic, as laplace and ilaplace are defined on symbolic.

2 件のコメント

Michael Dupre
Michael Dupre 2017 年 11 月 21 日
I already had an external function to deal with the tf(transfer function) to symbolic, so that's not the issue :)
Walter Roberson
Walter Roberson 2017 年 11 月 21 日
At the point
G = a+(b./(1+exp(c*(T-t))));
you should be using symbolic t rather than numeric t.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by