Combining two equations in S domain

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?

 Accepted Answer

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

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

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!