Modeling & simulation
MEC 242
Example1
Consider the mechanical system shown in Figure. The system is at rest initially. The
displacements x and y are measured from their respective equilibrium positions.
Assuming that p(t) is a step force input and the displacement x(t) is the output, obtain
the transfer function of the system. Then, assuming that m = 0.1 kg, b2 = 0.4 N-s/m,
k1 = 6 N/m, k2 = 4 N/m, and p(t) is a step force of magnitude 10 N, obtain the response
curve x(t).
syms s
num = [100 1000];
den=[1 10 100 600];
sys = tf(num, den);
step(sys,t)
grid
Example2
Consider the mechanical system shown in Figure, where m = 1 kg, b = 3 N-s/m,
and k = 2 N/m. Assume that the displacement x of mass m is measured from the
equilibrium position and that at t= 0 the mass m is pulled downward such that
x(0) = 0.1 m and 𝑥(0)
ሶ = 0.05 m/s. Obtain the motion of the mass subjected to the initial
condition. (Assume no external forcing function.)
Syms s
num = [0.1 0.35 0];
den=[1 3 2];
sys = tf(num, den);
step(sys,t)
grid
Thank you