Combining two equations in S domain
2 views (last 30 days)
Show older comments
Michael Dupre
on 21 Nov 2017
Commented: Walter Roberson
on 21 Nov 2017
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?
0 Comments
Accepted Answer
Walter Roberson
on 21 Nov 2017
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 Comments
Walter Roberson
on 21 Nov 2017
At the point
G = a+(b./(1+exp(c*(T-t))));
you should be using symbolic t rather than numeric t.
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!