Modeling Lecture 3
Modeling Lecture 3
1 Introduction
Mechanical systems are omnipresent in engineering and often involve interacting components like masses,
springs, dampers, and rotational elements like flywheels. To analyze and predict the behavior of these
systems under different conditions, we use mathematical models that describe their dynamic behavior
rif
through differential equations.
ha
In this lecture, we will focus on two types of mechanical systems:
• Translational systems, involving elements that move in straight lines (e.g., mass-spring-damper
S
systems).
di
• Rotational systems, where elements rotate around an axis (e.g., flywheels and gears).
Ai
We will derive the governing equations for these systems, represent them using transfer functions and
state-space models, and simulate them using MATLAB. ar
1.1 Objectives
ss
By the end of this lecture, you should be able to:
ta
systems include:
.P
• Spring (k): Resists displacement from its equilibrium position and stores potential energy.
As
1
Lectures on Modeling and Simulation M.A.Sharif ([email protected])
• x(t): Displacement of the mass from its equilibrium position in meters (m).
rif
• Spring force: The force exerted by the spring is proportional to the displacement x(t) and is
given by Hooke’s Law: Fspring = −kx(t). The negative sign indicates that the spring opposes
ha
displacement.
S
dx(t)
• Damping force: The force exerted by the damper is proportional to the velocity dt , and it
opposes the motion. Thus, Fdamper = −b dx(t)
dt .
di
• Applied force: The external force F (t) drives the system.
Ai
Summing these forces gives the equation of motion: ar
d2 x(t) dx(t)
m = F (t) − b − kx(t)
dt2 dt
ss
Rearranging the equation:
ta
d2 x(t) dx(t)
m +b + kx(t) = F (t)
on
dt2 dt
This is a second-order linear differential equation describing the dynamic behavior of the mass-spring-
M
damper system.
To understand the system’s response, we first solve the homogeneous equation (i.e., when F (t) = 0):
d2 x(t) dx(t)
m +b + kx(t) = 0
ro
dt 2 dt
The characteristic equation is:
.P
ms2 + bs + k = 0
st
The roots of this quadratic equation determine the behavior of the system. Let:
As
√
−b ± b2 − 4mk
s=
2m
There are three cases to consider based on the discriminant ∆ = b2 − 4mk:
• Overdamped (∆ > 0): The system returns to equilibrium without oscillations.
• Critically damped (∆ = 0): The system returns to equilibrium as quickly as possible without
oscillating.
• Underdamped (∆ < 0): The system oscillates while returning to equilibrium.
F0
xp (t) =
k
This represents the steady-state displacement of the mass when the force is constant.
rif
ms2 X(s) + bsX(s) + kX(s) = F (s)
ha
Solving for X(s) in terms of F (s), the transfer function is:
S
X(s) 1
H(s) = =
di
F (s) 2
ms + bs + k
Ai
This transfer function describes the system’s response to external forces in the frequency domain.
ar
5 State-Space Representation
ss
The mass-spring-damper system can also be represented in state-space form. Define the state variables
as:
ta
dx(t)
x1 (t) = x(t) (displacement), x2 (t) = (velocity)
on
dt
The system can be written as a set of first-order differential equations:
M
In matrix form:
0 1 0
ẋ(t) = k b x(t) + 1 F (t)
−m −m
ro
y(t) = 1 0 x(t)
st
This state-space model is particularly useful when analyzing systems with multiple inputs and out-
As
puts.
• For m2 : The spring and damping forces exerted by m1 , plus the force from the connection between
them.
rif
For m1 , the equation of motion is:
ha
d2 x1 (t)
dx1 dx2
m1 = F (t) − k(x1 − x2 ) − b −
dt2 dt dt
S
For m2 , the equation of motion is:
di
d2 x2 (t)
dx2 dx1
Ai
m2 = −k(x2 − x1 ) − b −
dt2 dt dt
ar
7 Rotational Mechanical Systems
ss
In rotational mechanical systems, the elements rotate around a fixed axis. These systems include com-
ta
ponents like flywheels, gears, and motors. The key elements of a rotational system are:
• Moment of Inertia (J): Equivalent to mass in translational systems, it resists changes in rota-
on
tional motion.
M
Rotational systems are governed by **torques** and **angular displacement** rather than forces
f.D
• The restoring torque from the torsional spring Tspring = −Kθ(t), opposing displacement.
• The external torque T (t), driving the system.
Summing these torques gives the equation of motion:
d2 θ(t)
rif
dθ(t)
J 2
+B + Kθ(t) = T (t)
dt dt
ha
This is a second-order differential equation that describes the rotational motion of the flywheel.
S
7.1.3 Transfer Function
di
Taking the Laplace transform of the equation, assuming zero initial conditions, we get:
Ai
Js2 Θ(s) + BsΘ(s) + KΘ(s) = T (s)
We can also represent this system in state-space form. Define the state variables:
M
dθ(t)
x1 (t) = θ(t) (angular displacement), x2 (t) = (angular velocity)
dt
The system can be written as:
r.
1
ẋ2 (t) = (T (t) − Bx2 (t) − Kx1 (t))
J
ro
0 1 0
ẋ(t) = x(t) + 1 T (t)
−KJ −BJ J
st
y(t) = 1 0 x(t)
This state-space model is particularly useful for analyzing the rotational dynamics of the system.
rif
Taking the Laplace transform of the coupled differential equations and solving for the angular displace-
ha
ments in terms of the input torque yields the transfer functions for each flywheel:
S
Θ1 (s) Θ2 (s)
H1 (s) = , H2 (s) =
T (s) T (s)
di
These transfer functions describe how the angular displacement of each flywheel responds to the applied
Ai
torque.
ar
9 MATLAB Simulation of Rotational Systems
ss
We will now simulate the rotational system using MATLAB. The parameters for the flywheel system
are:
ta
num = [1];
st
den = [J B K];
sys = tf(num, den);
As
rif
• Damping coefficient and spring constant have their rotational counterparts as well.
ha
This analogy allows us to apply similar modeling techniques to both translational and rotational
systems.
S
di
Ai
ar
ss
ta
on
M
r.
f.D
ro
.P
st
As
rif
For flywheel 1, Newton’s second law for rotational motion gives:
ha
d2 θ1 (t) dθ1 (t)
J1 + B1 + K1 θ1 (t) = T (t)
dt2 dt
S
For flywheel 2, considering the gear coupling:
di
d2 θ2 (t) dθ2 (t) N1
J2 + B2 + K2 θ2 (t) = T (t)
Ai
dt2 dt N2
These two coupled equations describe the system’s dynamics. To solve them, we use the gear ratio
to substitute θ1 in terms of θ2 , reducing the system to a single equation in terms of θ2 (t).
ar
ss
11.2 Transfer Function Representation
ta
Taking the Laplace transform of the coupled differential equations, we obtain the transfer functions H1 (s)
and H2 (s) that describe the angular displacement of each flywheel in response to the applied torque T (s).
on
Θ1 (s) Θ2 (s)
H1 (s) = , H2 (s) =
T (s) T (s)
These transfer functions allow us to analyze the frequency-domain behavior of the system, providing
r.
The state-space representation for the system with two flywheels can be written as:
.P
where x(t) is the state vector representing the angular displacements and velocities of both flywheels,
and u(t) is the input torque.
As
rif
N1 = 2; % Gear ratio for flywheel 1
N2 = 1; % Gear ratio for flywheel 2
ha
% Define the state-space matrices
S
A = [0 1 0 0; -K1/J1 -B1/J1 0 0; 0 0 0 1; 0 0 -K2/J2 -B2/J2];
B = [0; 1/J1; 0; 1/J2];
di
C = [1 0 0 0];
Ai
D = 0;
figure;
plot(t, theta);
f.D
xlabel(’Time (s)’);
ylabel(’Angular Displacement (rad)’);
ro
The plot shows how the angular displacement of the first flywheel evolves over time in response to the
step input torque. The gear ratio determines the relative motion between the two flywheels, with the
As
rif
energy during power strokes and releases it during non-power strokes, ensuring smoother operation of
the engine. The gear ratios in the transmission regulate the flywheel’s angular velocity, adapting it to
ha
the varying driving conditions.
S
12.2 2. Electric Motors and Generators
di
Electric motors and generators are rotational systems where the rotational motion is directly converted
into electrical energy (in the case of a generator) or electrical energy is converted into mechanical motion
Ai
(in the case of a motor). The behavior of these systems is governed by the same principles we’ve discussed,
where the moment of inertia, damping, and applied torques dictate their dynamic response.
ar
12.2.1 Example: DC Motor Dynamics
ss
The dynamics of a DC motor can be described using the same second-order differential equation we
ta
derived for a rotational system. The applied voltage generates an electromagnetic torque that drives the
rotor. The rotor’s angular velocity is influenced by the motor’s inertia and damping.
on
Wind turbines are complex rotational systems where the blades capture wind energy and convert it into
rotational energy. This energy is transferred through a gear train to a generator, which converts it into
r.
electrical power. The gear ratios in the system are crucial for adapting the slow rotational speed of the
f.D
A wind turbine with a large rotor requires a gear train to increase the rotational speed of the generator
.P
shaft. The dynamics of the system can be modeled using multiple coupled differential equations that
describe the interaction between the rotor, gearbox, and generator.
st
As
rif
longer increase linearly with velocity.
• **Friction**: Coulomb friction introduces nonlinearity, where the frictional force is independent of
ha
velocity until the object starts moving.
S
To model nonlinear systems, we use nonlinear differential equations that are typically solved using
numerical methods, as analytical solutions are rare.
di
Ai
13.2 2. Time-Varying Systems
Mechanical systems with parameters that change over time are known as time-varying systems. For
ar
instance, the moment of inertia of a satellite or a robotic arm may change as parts of the system move
or deploy. In such systems, parameters like m(t), k(t), or J(t) are functions of time.
ss
The equations of motion for time-varying systems are more complex and often require adaptive control
techniques to manage their behavior.
ta
on
These systems are common in robotics (e.g., robotic arms), vehicle suspensions, and spacecraft. Each
body in the system has its own degrees of freedom, and the motion of one body affects the others.
r.
The dynamics of multibody systems are often modeled using Lagrangian or Hamiltonian mechanics,
which provide a systematic approach to derive the equations of motion for complex systems with multiple
f.D
interacting components.
ro
.P
st
As
• The response of these systems depends on the parameters (e.g., mass, damping, stiffness) and can
be solved analytically or numerically.
rif
• Transfer functions and state-space representations are powerful tools for analyzing the behavior of
mechanical systems, particularly in control and systems engineering.
ha
• MATLAB provides a robust environment for simulating both simple and complex mechanical sys-
tems, allowing us to visualize and analyze system dynamics under different conditions.
S
di
14.2 Further Reading and Resources
Ai
For those interested in exploring these topics further, here are some suggested resources:
The study of mechanical system modeling extends far beyond what we’ve covered here, and these
M
resources will help you deepen your understanding of system dynamics, vibrations, and control strategies
for real-world applications.
—
r.
f.D
ro
.P
st
As
rif
A DC motor is coupled to a load with a moment of inertia J = 0.1 kg·m2 , damping B = 0.05 N·m·s/rad,
ha
and a torsional spring constant K = 2 N·m/rad. The motor applies a torque T (t) = 5 N·m at time t = 0.
S
1. Derive the equation of motion for the system.
2. Find the transfer function of the system relating the applied torque T (s) to the angular displacement
di
Θ(s).
Ai
3. Simulate the system’s response to the applied torque using MATLAB.
ar
15.3 Homework Problem 1: Mass-Spring-Damper System with Nonlinear
ss
Damping
ta
Consider a mass-spring-damper system where the damping force is nonlinear, given by Fdamping =
on
2
−b dx(t)
dt . The mass m = 5 kg, spring constant k = 100 N/m, and external force F (t) = 20 N are
applied to the system.
M
3. Plot the displacement x(t) over time and compare it to the linear case.
ro
Two masses m1 = 2 kg and m2 = 3 kg are connected by a spring with stiffness k = 50 N/m and a damper
with damping coefficient b = 10 Ns/m. An external force F (t) = 15 N is applied to m1 .
st
2. Simulate the system in MATLAB and plot the displacements x1 (t) and x2 (t) over time.
16 Conclusion
This concludes our exploration of mechanical system modeling. The provided examples and homework
problems give you the opportunity to practice the techniques we’ve covered and apply them to real-world
systems. Understanding how to model, simulate, and analyze these systems is crucial for designing
efficient and reliable mechanical systems in engineering applications.
rif
S ha
di
Ai
ar
ss
ta
on
M
r.
f.D
ro
.P
st
As