Generate the transfer functions of the following system:
Set the value for
. Set the value to zero if there is no such component. Never set mass to zero. You can set
or
to zero if the corresponding input does not exist. Set
to
and
to
, if they are arbitrary. However, you will not be able to plot the system responses. It can also be in any function in a Laplace form. See the commented lines for examples. %f1 = laplace(sin(2*t), t, s); % This is a sine function
%f1 = 1/s; % This is a unit step function
%f2 = laplace(sin(2*t), t, s); % This is a sine function
f2 = 1/s; % This is a unit step function
C = [c1+c2 -c2; -c2, c2];
K = [k1+k2 -k2; -k2 k2 ];
eqTF = [X1; X2] == simplify(inv(H)*[f1; f2])
eqTF =

Now, we shall plot the system responses in time domain. Principally, we perform partial fraction expansion and inverse Laplace operation to convert the system equations into time domain.
We CAN NOT do this if
or
is arbitrary. % Go to time domain from here
Xs = partfrac(rhs(eqTF), s, 'FactorMode','real');
Xt = rewrite(Xt, 'sincos');
Xt = vpa(simplify(Xt, 'Steps',10, 'IgnoreAnalyticConstraints',1),4)
Xt =
