Kinematics is the study of motion without regard to what causes it. We describe how a body moves, its position, velocity and acceleration, without asking why it moves. The forces and moments responsible for the motion belong to kinetics, which we treat in later chapters. This separation is useful because the geometry of motion obeys its own rules independently of the forces involved: a particle tracing a circular arc has a centripetal acceleration whether it is a planet in orbit or a ball on a string.
We begin with the simplest case: particle kinematics.
A body whose rotation is insignificant compared to the path its center of gravity travels is called a particle. More precisely, if either the rotational acceleration or the physical size of the body is small enough, we can neglect changes in angular momentum and treat the body as a point mass. The equation of motion then reduces to Newton’s second law,
\[
\sum F = m a
\]
and the rotational equation of motion \(\sum M = I \alpha\) can be ignored. Later we will generalize to rigid bodies where rotation matters, but for now these two examples illustrate the distinction:
Figure 6.2.1: The flywheel must be treated as a rigid body; it is being accelerated and de-accelerated, thus it generates a rotational moment around its axis, by design, providing an energy reservoir to the system.
Figure 6.2.2: This marble can be treated as a particle since its rotational speed does not significantly influences its path.
Position vector
Position Vector
The position of a body’s center of gravity at time \(t\) is described by the position vector \(\boldsymbol{r}(t) = [x(t), y(t), z(t)]^\mathsf{T}\), where each component is a function of the same independent variable \(t\). These components are called coordinate functions, and the curve traced out by \(\boldsymbol{r}(t)\) as \(t\) varies is the path of the particle.
Velocity
Velocity Vector
The mean velocity between two positions \(\boldsymbol{r}(t)\) and \(\boldsymbol{r}(t+\Delta t)\) can be described as \(\bar{\boldsymbol{v}} = \frac{\Delta \boldsymbol{r}}{\Delta t}\). In the limit where \(\Delta t \to 0\) we get the time derivate of the position vector, known as the velocity vector
As can be seen in the animation, the velocity vector \(\dot{\boldsymbol{r}}\) at \(t\) is always tangential to the path.
The dot notation in \(\dot{r}\) or in \(\dot{\ddot{\ddot{\ddot{\ddot{r}}}}} = \frac{d^9}{dt^9}r\) (a.k.a. Newton’s abomination) comes from Newton who studied dynamic problems and needed to develop the mathematics to deal with these problems.
The mathematics came to be known as calculus which was expanded and is really made up by a great many contributors (Leibnitz, Lagrange). see e.g., this video for an historical overview.
The magnitude of the velocity vector, \(|\dot{\boldsymbol{r}}|\), is known as the speed. The difference between velocity and speed being that velocity also contains information about the direction of the object.
Acceleration
Similarly, the acceleration is the time derivative of the velocity,
From the animation we can see that the acceleration points inward, toward the center of curvature, and that it generally differs in direction from both the position and velocity vectors. The acceleration vector can be decomposed into a tangential and a normal component, \(\boldsymbol{a} = a_t \boldsymbol{e}_t + a_n \boldsymbol{e}_n\). The normal component \(a_n\) is responsible for changes in direction, while the tangential component \(a_t\) is responsible for changes in speed. If the particle speeds up through a curve, so that \(|\dot{\boldsymbol{r}}_1| > |\dot{\boldsymbol{r}}_0|\), a tangential component is present and the resulting acceleration is no longer perpendicular to the velocity. Only when the speed is constant (\(a_t = 0\)) is the acceleration purely normal, that is, perpendicular to the path.
Rectilinear motion
In the special case of rectilinear motion (motion without curvature), such as described in Figure 6.2.3
Figure 6.2.3: Rectilinear Motion
the position vector reduces to a single component, for example \(x(t)\), and the velocity and acceleration reduce to the time derivatives of this single component.
⚠ Note
Using scalar notation \(s = |\boldsymbol{r}|\), \(v = |\dot{\boldsymbol{r}}|\), \(a = |\ddot{\boldsymbol{r}}|\) and eliminating \(dt\) from \(v = ds/dt\) and \(a = dv/dt\) gives
\[
\boxed{a \, ds = v \, dv}
\tag{6.2.3}\]
This relation is useful when time is not of interest, but it only applies to rectilinear (or scalar) problems and hides the assumptions behind it. We generally prefer the full vector formulation and the differential equation approach described next.
The proposed working method is described in what follows.
Differential equations
Classical mechanics textbooks often present ready-made formulas for position, velocity and acceleration under specific assumptions (typically constant acceleration). It is usually more tedious to figure out when these formulas are valid than to set up and solve the differential equation directly. We shall therefore work with \(\boldsymbol{r}, \dot{\boldsymbol{r}}\) and \(\ddot{\boldsymbol{r}}\) throughout and treat kinematics problems as ordinary differential equations (ODEs).
Differentiation and integration act componentwise on vectors,
so we can formulate our problems in vector form and solve them using either a symbolic ODE solver such as sympy.dsolve() or a numerical integrator such as the Euler method.
Workflow
The workflow in computational dynamics is summarized below.
Workflow
To move between position \(\boldsymbol{r}(t)\), velocity \(\dot{\boldsymbol{r}}(t)\) and acceleration \(\ddot{\boldsymbol{r}}(t)\) we differentiate in one direction and integrate in the other. In practice we rarely integrate by hand; instead we solve an ODE whose solution gives \(\boldsymbol{r}(t)\) directly, and then differentiate to obtain the quantities we need. For nonlinear ODEs we typically resort to numerical integration, which generates the velocity \(\dot{\boldsymbol{r}}\) as an intermediate result on the way to the position \(\boldsymbol{r}\).
Newtonian physics is formulated as the second-order differential equation
but in kinematics we see equally often first-order equations.
IVP
We formulate an ODE that must be (at least piecewise) valid for all \(t\) and apply initial conditions at the start of the analysis, or at some other known state, to fix the unknown constants. The number of constants depends on the order of the differential equation. In this approach, time \(t\) is the central parameter tying \(\boldsymbol{r}\), \(\dot{\boldsymbol{r}}\) and \(\ddot{\boldsymbol{r}}\) together, which is why it often appears in the solution even when we did not explicitly ask for it. This is the nature of Newtonian mechanics: it is inherently transient, meaning the state of the body is known at every instant. As we shall see in later chapters, there are methods that bypass the time dependence when it is not of interest (e.g., 6.2.3), but a complete dynamic analysis always requires solving the ODE.
The questions we ask of the model fall into two categories. In the first, the equations are explicitly functions of time, e.g., \(\dot{\boldsymbol{r}}(t)\), so we can evaluate any quantity at a given instant. In the second, we want a quantity expressed as a function of another quantity, for example the velocity at a given position \(\dot{\boldsymbol{r}}(\boldsymbol{r})\), and must solve for the time that is common to both. A useful trick to avoid solving is to simply plot \(\dot{\boldsymbol{r}}(t)\) against \(\boldsymbol{r}(t)\) and read off the answer graphically.
Coordinate systems
Coordinate systems
Different coordinate systems align their basis vectors with different aspects of the motion. This alignment often simplifies the resulting expressions, but more importantly, it reveals the physical structure of the problem: polar coordinates naturally separate radial and angular motion, natural coordinates separate speed from curvature, and so on. Whichever system we choose, we should commit to it for the duration of the analysis.
⚠ Note
We can avoid this whole exercise of practicing to compute velocities and acceleration in various bases by just formulating relations in Cartesian coordinates and directly work with the position vector \(\boldsymbol{r}\) which can be easily projected onto any other bases if needed. Let the computer do the tedious mathematics!
We shall here derive the most common coordinate systems and their basis vectors such that this projection can be done. The three systems we consider are:
Natural (tangent, normal, bi-normal), \(\boldsymbol{e}_t, \boldsymbol{e}_n, \boldsymbol{e}_b\), attached to the particle and aligned with its path.
Polar (2D) or cylindrical (3D), \(\boldsymbol{e}_r, \boldsymbol{e}_\theta, \boldsymbol{e}_z\), aligned with the radial direction from a fixed origin.
The Cartesian basis is constant and needs no further discussion. The natural and polar bases, however, rotate as the particle moves, which means their basis vectors are functions of time. This has important consequences when we differentiate position, velocity and acceleration, as we shall see below.
Natural coordinates
The natural coordinate system is attached to the particle and moves with it along its path. This makes it particularly useful when we are interested in how fast the particle travels along the path and how sharply it turns, rather than its absolute position in space.
The first basis vector, the tangent vector \(\boldsymbol{e}_t\), points in the direction the particle is currently moving. Since the velocity \(\dot{\boldsymbol{r}}\) is always tangent to the path, we obtain the tangent direction by normalizing it,
The second basis vector, the normal vector \(\boldsymbol{e}_n\), points toward the center of curvature, that is, in the direction the path is currently bending. We obtain it from the time derivative of \(\boldsymbol{e}_t\) which, as shown in Section 17.8, is always perpendicular to \(\boldsymbol{e}_t\) itself,
Together, \(\boldsymbol{e}_t\) and \(\boldsymbol{e}_n\) span the plane in which the path locally curves. The third basis vector, the bi-normal \(\boldsymbol{e}_b\), completes the right-handed system by pointing out of that plane,
For planar problems (2D) the path always curves in the same plane, so \(\boldsymbol{e}_b = \boldsymbol{e}_z\) throughout the motion.
Polar coordinates
The polar coordinate system is defined relative to a fixed origin. It separates the motion into a radial component (toward or away from the origin) and an angular component (around it), which makes it particularly useful when the radius changes over time or when that change is of interest.
The radial basis vector \(\boldsymbol{e}_r\) points from the origin toward the particle. We obtain it by normalizing the position vector,
The angular basis vector \(\boldsymbol{e}_\theta\) points in the direction of increasing \(\theta\), perpendicular to \(\boldsymbol{e}_r\). As the particle moves, \(\boldsymbol{e}_r\) rotates, and its time derivative (see Section 17.8) gives precisely this perpendicular direction,
In three dimensions a third basis vector \(\boldsymbol{e}_z\) is added along the axis of rotation, giving the cylindrical coordinate system.
The time derivative of a unit vector
In both the natural and polar coordinate systems we encountered the time derivative of a unit vector, \(\dot{\boldsymbol{e}}\). We now show that this derivative is always perpendicular to the unit vector itself.
A unit vector satisfies \(\boldsymbol{e} \cdot \boldsymbol{e} = 1\) by definition. Differentiating both sides with respect to time and applying the product rule gives
and since \(\boldsymbol{e} \cdot \dot{\boldsymbol{e}} = 0\) we conclude that \(\boldsymbol{e} \perp \dot{\boldsymbol{e}}\). Note that \(|\dot{\boldsymbol{e}}| \neq 1\) in general.
Unit Vector Derivative
The figure confirms this geometrically: as \(\Delta t \to 0\), the change \(\Delta\boldsymbol{e}\) becomes perpendicular to \(\boldsymbol{e}\).
Remark 17.1. We verify the result above using \(\boldsymbol{r}(t) = [\cos{\theta(t)}, \sin{\theta(t)}]\).
⚠ Note
Be careful when defining angles as degrees! Angles will be functions of time in what follow, meaning implicit derivation will yield expressions where angles are directly multiplied with distances or velocities, this only works if the angles are defined as radians!
The result is a scaled vector orthogonal to \(\boldsymbol{e}_r\). Note that \(\dot{\theta}\) appears from implicit differentiation, which is why \(|\dot{\boldsymbol{e}}_r| \neq 1\) in general. The factor \(\dot{\theta}\) is the angular velocity \(\omega\), and its sign gives the direction of rotation.
The factor \(\frac{\dot{\theta}}{|\dot{\theta}|}\) is simply the sign of \(\dot{\theta}\), so for \(\dot{\theta} > 0\) we get \(\boldsymbol{e}_\theta = [-\sin\theta, \cos\theta]^\mathsf{T}\). We confirm orthogonality by computing the dot product,
which verifies that \(\boldsymbol{e}_r \perp \dot{\boldsymbol{e}}_r\) and \(\boldsymbol{e}_r \perp \boldsymbol{e}_\theta\).
Polar coordinates (\(r-\theta\))
We now derive the kinematic equations in polar coordinates. In practice we can formulate \(\dot{\boldsymbol r}\) and \(\ddot{\boldsymbol r}\) in Cartesian coordinates and project onto any basis, so there is no need to memorize the expressions below. The purpose here is to explore the connections between these quantities and their physical meaning.
Polar coordinates
We begin by recalling the basis vectors established earlier,
The quantity \(\omega = \dot{\theta}\) is the angular velocity, and \(v_\theta = r\dot{\theta}\) is the tangential speed. The first term \(\dot{r}\boldsymbol{e}_r\) captures how fast the particle moves toward or away from the origin, while the second term \(r\dot{\theta}\boldsymbol{e}_\theta\) captures how fast it sweeps around it.
Acceleration in polar coordinates
Taking the time derivative of 6.2.4 and applying the product rule to each term gives
We already know that \(\dot{\boldsymbol{e}}_r = \dot{\theta}\boldsymbol{e}_\theta\). By the same argument (differentiating \(\boldsymbol{e}_\theta \cdot \boldsymbol{e}_\theta = 1\)), the time derivative \(\dot{\boldsymbol{e}}_\theta\) must be perpendicular to \(\boldsymbol{e}_\theta\), and direct computation shows \(\dot{\boldsymbol{e}}_\theta = -\dot{\theta}\boldsymbol{e}_r\). Substituting both and collecting terms,
The radial component has two contributions: \(\ddot{r}\) is the acceleration of the particle outward from the origin, while \(r\dot{\theta}^2\) points inward and is the centripetal acceleration that arises from the circular part of the motion. In the angular direction, \(r\ddot{\theta} = r\alpha\) is the angular acceleration and \(2\dot{r}\dot{\theta}\) is the Coriolis term. To see where it comes from, consider a particle moving outward (\(\dot{r} > 0\)) while rotating (\(\dot{\theta} > 0\)). As it moves to a larger radius, it must also increase its tangential speed \(r\dot{\theta}\) just to keep up with the same angular velocity. This “extra” angular acceleration is not due to a change in \(\dot{\theta}\) but due to the radius changing, and it appears twice (factor of 2) because \(\dot{r}\) affects both the transport of existing angular momentum outward and the change of the basis vector \(\boldsymbol{e}_\theta\) itself.
Natural coordinates (\(t-n\))
We now derive the kinematic equations in natural coordinates. The acceleration is particularly revealing in this basis since it splits cleanly into a component along the path (change of speed) and a component perpendicular to it (change of direction). As before, we can always obtain these by projecting the total acceleration onto any basis, so the expressions below need not be memorized.
At any point along the path we can fit a circle that locally matches the curvature. The center of this circle is the center of curvature \(C\), and its radius is the radius of curvature \(R\). For an infinitesimal arc angle \(d\beta\), the arc length \(ds\) and the radius are related by
Radius of curvature
The circle arc length relation \(ds = R\,d\beta\), together with the Pythagorean theorem and trigonometry, forms the foundation of our kinematic modelling.
Velocity in natural coordinates
The speed along the path is \(v = |\dot{\boldsymbol{r}}| = \frac{ds}{dt}\), and using the arc length relation \(ds = R\,d\beta\) we get
This relation is useful when the angular rate \(\dot{\beta}\) is sought.
Angular rate
As seen in the figure above, a small change in the angle \(d\beta\) causes a corresponding change \(d\boldsymbol{e}_t\) perpendicular to \(\boldsymbol{e}_t\), that is, in the normal direction \(\boldsymbol{e}_n\). This gives
From 6.2.5 we can also read off the radius of curvature and the angular rate,
\[
R = \frac{v}{|\dot{\boldsymbol{e}}_t|}, \qquad \dot{\beta} = \frac{v}{R}
\]
Acceleration in Natural coordinates
Acceleration in Natural Coordinates
The acceleration vector can be split into a tangential and a normal component, \(\ddot{\boldsymbol{r}} = a_t\boldsymbol{e}_t + a_n\boldsymbol{e}_n\). We find these by differentiating the velocity using the product rule,
The tangential component \(a_t = \dot{v}\) reflects changes in speed, while the normal component \(a_n = v^2/R\) is the centripetal acceleration directed toward the center of curvature. We always have a normal acceleration as long as the speed is nonzero and the path is curved (\(R < \infty\)). This decomposition will be revisited in the kinetics chapter.
A tiny view on differential geometry
The theory of curves is an extensive topic within the field of differential geometry. Here, we will only introduce some basic concepts, such as the arc length. For a general curve, the arc length may not have a closed-form solution and is found by integrating the speed \(|\dot{\boldsymbol{r}}(t)|\):
Using the arc length \(s\) as the parameter instead of time \(t\) can sometimes lead to simpler expressions for derivatives. However, since \(s\) is itself a function of \(t\), this change of variable does not necessarily simplify computer-based calculations.
Another important concept is curvature, \(\kappa(t) = \frac{1}{R(t)}\). As expected, the curvature approaches zero as the radius of curvature \(R(t)\) tends to infinity, which corresponds to a straight path. The center of curvature, \(\boldsymbol{r}_C(t)\), is given by:
This point is the center of the osculating circle (a term coined by Leibniz as Circulus Osculans), which is the circle that best approximates the curve at a given point. Natural coordinates are particularly useful for this type of analysis.
⚠ Note
In the special case when \(R(t)\) is constant the bases of polar coordinates coincide with the bases of the natural coordinates.
The torsion of a curve, \(\tau(t)\), measures how sharply it twists out of its plane of curvature. A simple analogy is the pitch of a screw. The derivations for both curvature and torsion can be complex, see e.g., the Frenet-Serret formulas, so the formulas are stated here without proof:
where \(\dot{\ddot{\boldsymbol{r}}}\) denotes the third-order time derivative of the position vector, also known as jerk or jolt. For the names of higher-order derivatives, see this list.
Remark 17.2. We compute the curvature and torsion for a simple circular path.
Let \(\boldsymbol{r}(t) = R [\cos(t), \sin(t), 0]^\mathsf{T}\), a circle of radius \(R\) in the \(xy\)-plane.
import sympy as spfrom mechanicskit import la, ltxt = sp.symbols('t', real=True, positive=True)R = sp.symbols('R', real=True, positive=True)r = R * sp.Matrix([sp.cos(t), sp.sin(t), 0])ltx("\\bm r =", r)
\[ \bm r =\left[\begin{matrix}R \cos{\left(t \right)}\\R \sin{\left(t \right)}\\0\end{matrix}\right] \]
# tau = - (r_dot x r_ddot) . r_dddot / |r_dot x r_ddot|^2# The cross product r_dot.cross(r_ddot) is not zero, so we can proceed.tau = sp.simplify(- (r_dot.cross(r_ddot)).dot(r_dddot) / (r_dot.cross(r_ddot)).norm()**2)ltx("\\tau =", tau)
\[ \tau =0 \]
The curvature is \(\kappa = 1/R\) as expected for a circle, and the torsion is zero since the path lies entirely in the \(xy\)-plane.
Osculating circle
We illustrate the osculating circle on the path \(\boldsymbol{r}(t) = [t,\, \sqrt{t}\sin(2t)]^\mathsf{T}\). The key ingredients are the curvature \(\kappa\), the radius of curvature \(R = 1/\kappa\), the unit normal \(\boldsymbol{e}_n\), and the center of curvature \(\boldsymbol{r}_C = \boldsymbol{r} + R\,\boldsymbol{e}_n\).
where \(\boldsymbol{e}_\theta\) is perpendicular to \(\boldsymbol{e}_r\), rotated 90 degrees counter-clockwise. Projecting onto the polar basis using the dot product (valid since the basis is orthonormal),
The first component of the velocity is the radial velocity (zero for circular motion) and the second is the tangential velocity. For the acceleration, the first term is the centripetal acceleration, always pointing toward the center, and the second is the tangential acceleration, which vanishes when the angular velocity is constant.
To summarize planar circular motion: with a constant \(r\), we have \(\dot{r} = \ddot{r} = 0\) and \(\boldsymbol{r} \perp \dot{\boldsymbol{r}}\) since \(\frac{d}{dt}(r^2) = 0 = \frac{d}{dt}(\boldsymbol{r} \cdot \boldsymbol{r}) = \dot{\boldsymbol{r}} \cdot \boldsymbol{r} + \boldsymbol{r} \cdot \dot{\boldsymbol{r}} \Leftrightarrow \boldsymbol{r} \cdot \dot{\boldsymbol{r}} = 0\). Note especially the centripetal acceleration\(-r\dot{\theta}^2\boldsymbol{e}_r\), it is directed in the negative direction of \(\boldsymbol{e}_r\), towards the center of the circle.
If the rotational velocity is constant, i.e., if \(\omega = \dot{\theta} = \text{constant}\) or \(\alpha = \ddot{\theta} = 0\) then we only have centripetal acceleration, caused by a curvilinear motion and perpendicular to the tangent direction, directed inwards, towards the center.
Note that we can also express \(\boldsymbol{e}_\theta\) using the cross product, \(\boldsymbol{e}_\theta = \boldsymbol{e}_z \times \boldsymbol{e}_r\), which is convenient since circular motion is common and we often have angular velocity as input data. This gives
The advantage over explicitly rotating \(\boldsymbol{e}_r\) by 90 degrees is that the cross product automatically gives the correct direction of rotation from the sign of \(\omega\).
Relative motion
Relative motion
It is often easier to express position, velocity and acceleration relative to some other point rather than the origin. This simplifies the modeling and reflects how engineers typically work: relative measurements are often more practical and more accurate than absolute ones. This approach, called relative motion analysis, will be used extensively in rigid body dynamics.
If we know the position of particle \(B\) and the position of particle \(A\) relative to \(B\), written \(\boldsymbol{r}_{A/B}\) (read: “\(A\) seen from \(B\)”), the absolute position of \(A\) is
It may be more convenient to express \(\boldsymbol{r}_{A/B}\) and \(\boldsymbol{r}_B\) separately than to formulate \(\boldsymbol{r}_A\) directly. Differentiating with respect to time gives
Passengers in an A380 flying east at 800 km/h observe a JAS 39 Gripen passing underneath with a true heading of \(45^\circ\) (north-east). To the passengers, the Gripen appears to move away at \(60^\circ\) as shown. Determine the true speed of the Gripen.
Solution
We have two unknowns: the absolute speed of the Gripen, \(v_B\), and the relative speed observed from the A380, \(v_{B/A}\). The relative motion equation is
sol = sp.solve(eq, (v_B, v_BA))sol[v_B] | la.evalf(3)
\[ {\def\arraystretch{1.0}717.0} \]
sol[v_BA].evalf(3) | la
\[ {\def\arraystretch{1.0}586.0} \]
The Gripen’s true speed is 717 km/h, and it moves away from the passengers at 586 km/h.
Collision course and relative motion
A striking consequence of relative motion is observed in aviation: when two aircraft are on a collision course, the other aircraft appears stationary in the pilot’s field of view. The relative velocity vector points directly at the observer, so there is no angular motion, only a growing silhouette.
Example 3: Data fitting
Solar Car
The acceleration performance of a new solar car is being tested at the Jönköping airfield. The JTH students are measuring time against velocity and the data is presented as two vectors. Create a suitable continuous function of the speed and determine how far the car has traveled at the last measurement point. Plot the distance, time and acceleration curves.
The matrix \(\bm{X}\) is called a Vandermonde matrix. Note that the columns are ordered by ascending powers of \(t\): the first column is \(t^0 = 1\), the second is \(t^1\), the third is \(t^2\). This means \(c_0\) is the constant term, \(c_1\) the linear coefficient, and \(c_2\) the quadratic coefficient, that is, c[i] multiplies \(t^i\).
Since we have more equations (\(m = 10\)) than unknowns (\(n = 3\)), the system is overdetermined and has no exact solution. Instead we seek the \(\bm{c}\) that minimizes the squared error,
import sympy as spt = sp.Symbol('t')# Since X has columns [1, t, t^2], c[i] multiplies t^iv = c[0] + c[1]*t + c[2]*t**2ltx(r"v(t) =", v, precision=3)
\[ v(t) =- 0.31 t^{2} + 7.75 t + 1.06 \]
We now have a continuous function \(v(t)\) that we can differentiate and integrate symbolically.
Code
import matplotlib.pyplot as pltv_func = sp.lambdify(t, v, 'numpy')tn = np.linspace(0, max(T), 100)vn = v_func(tn)fig, ax = plt.subplots()ax.plot(T, V, 'ro', label='Data')ax.plot(tn, vn, 'b-', label='Fit')ax.set(xlabel='Time, t [s]', ylabel='Velocity, v [m/s]', title='Velocity vs. Time')ax.grid(True)ax.legend()ax.fill_between(tn, vn, color='b', alpha=0.2)plt.show()
# Acceleration is the derivative of velocitya = sp.diff(v, t)ltx(r"a(t) =", a, precision=3)
\[ a(t) =7.75 - 0.62 t \]
Code
# Plot accelerationan = sp.lambdify(t, a, 'numpy')(tn)fig, ax = plt.subplots()ax.plot(tn, an, 'm-')ax.set(xlabel='Time, t [s]', ylabel='Acceleration, a [m/s^2]', title='Acceleration vs. Time')ax.grid(True)plt.show()
# Total distance is the integral of velocitys_tot = sp.integrate(v, (t, 0, max(T)))ltx(r"s_{tot} = \int_0^{10.175} v(t)\, dt =", s_tot, precision=4)
\[ s_{tot} = \int_0^{10.175} v(t)\, dt =303.4 \]
s = sp.integrate(v)ltx(r"s(t) =", s, precision=3)
\[ s(t) =- 0.103 t^{3} + 3.88 t^{2} + 1.06 t \]
Code
sn = sp.lambdify(t, s, 'numpy')(tn)fig, ax = plt.subplots()ax.plot(tn, sn, 'k-')ax.set(xlabel='Time, t [s]', ylabel='Distance, s [m]', title='Distance vs. Time')ax.grid(True)plt.show()
Example 4: Oscillating slider
A spring-mounted slider moves along the \(x\)-axis with initial velocity \(v_0 = 2\) m/s as it crosses the mid-position where \(s = 0\) at \(t = 0\). The two springs exert a retarding force proportional to the displacement, giving an acceleration \(a = -k^2 s\) with \(k = 4\). Determine the displacement, velocity and acceleration of the slider.
The total area under the velocity curve is the distance the slider has traveled, which for \(t = 2\pi\) is 2 m. But the signed area is zero, since the slider returns to its starting position after \(2\pi\) seconds, \(x(2\pi) = 0\) m.
Plot its velocity and acceleration curves for \(t \in [0, 30]\) s.
Solution
We define the piecewise position function and differentiate to obtain velocity and acceleration. Note that at \(t = 10\) the two pieces meet: \(10^2 = 100 = 20 \cdot 10 - 100\), so the position is continuous. The velocity transitions from \(2t = 20\) m/s to a constant 20 m/s, which is also continuous. The acceleration, however, jumps from 2 m/s\(^2\) to 0.
x = sp.Piecewise((t**2, t <10), (20*t -100, True))ltx(r"x(t) =", x)
\[ x(t) =\begin{cases} t^{2} & \text{for}\: t < 10 \\20 t - 100 & \text{otherwise} \end{cases} \]
A sports car manufacturer is limiting the power for one of the models by limiting the fuel consumption when the throttle is fully engaged such that the acceleration at any moment is proportional with the constant \(k = 0.1\) s\(^{-1}\) with respect to the difference in wanted top speed \(v_1 = 80\) m/s and the current speed \(v\). Assume the car starts from rest and the driver puts the pedal to the metal.
Draw the distance and velocity curves
How long does it take to reach top speed and how far has the car traveled?
What is the 0-100 km/h time and distance?
Solution
From the problem description we formulate the ODE with initial conditions,
How long to reach top speed? Since \(v(t) = 80(1 - e^{-t/10})\) approaches 80 m/s asymptotically, we never truly reach it. In practice we can ask when \(v = 0.99 \cdot v_1\).
We can verify: \(\dot{r} = 0.08t\) and \(r\dot{\theta} = (0.2 + 0.04t^2)(0.2 + 0.06t^2)\), consistent with the general polar velocity formula \(\dot{\boldsymbol{r}} = \dot{r}\boldsymbol{e}_r + r\dot{\theta}\boldsymbol{e}_\theta\).
Code
rr_func = sp.lambdify(t, rr, 'numpy')rr_dot_func = sp.lambdify(t, rr_dot, 'numpy')rr_ddot_func = sp.lambdify(t, rr_ddot, 'numpy')t_vals = np.linspace(0, 5, 300)path = np.array([rr_func(ti).flatten() for ti in t_vals])fig, ax = plt.subplots(figsize=(8, 6))ax.plot(path[:, 0], path[:, 1], 'b-', linewidth=2)ax.set_aspect('equal')ax.set_xlabel(r'$x(t)$[m]')ax.set_ylabel(r'$y(t)$[m]')ax.set_title('Path of the particle')ax.grid(True)# Mark integer time pointsfor ti in [1, 2, 3,4,5]: pos = rr_func(ti).flatten() ax.plot(pos[0], pos[1], 'ko', markersize=5) ax.annotate(f'$t={ti}$', pos, textcoords='offset points', xytext=(8, 8), fontsize=11, bbox=dict(boxstyle='round,pad=0.2', fc='white', alpha=0.8))plt.show()