Ordinary Differential Equations and Dynamic ModelsIntroductionOrdinary differential equations (ODEs) provide the mathematical language for systems whose variables change with one independent variable, usually time. In mechatronics, ODEs describe the motion of mechanisms, current and voltage in electrical circuits, temperature evolution, fluid-level changes, actuator dynamics, and coupled electromechanical systems. A dynamic model is therefore more than an equation: it is a structured representation of how inputs, stored energy, dissipation, and outputs interact. This chapter develops methods for classifying and solving first- and higher-order ODEs, with emphasis on linear models, selected nonlinear equations, initial and boundary conditions, equilibrium, stability, and transient response. The methods are illustrated through mechanical, electrical, thermal, and electromechanical applications. Learning ObjectivesBy the end of this chapter, you should be able to: - Classify ODEs by order, linearity, homogeneity, and coefficients.
- Solve separable, first-order linear, exact, and selected nonlinear equations.
- Solve higher-order linear ODEs with constant coefficients.
- Use initial and boundary conditions to determine unknown constants.
- Construct dynamic models from physical laws.
- Determine equilibrium points and assess local stability.
- Interpret transient and steady-state responses.
- Recognize assumptions, limitations, and professional implications of mathematical models.
1. Differential Equations as Dynamic ModelsAn ODE contains derivatives of a dependent variable with respect to one independent variable. A general nth-order equation may be written as F(t, y, y′, y″, …, y⁽ⁿ⁾) = 0 Here, t is the independent variable, y(t) is the dependent variable, and y⁽ⁿ⁾ is the nth derivative of y with respect to t. In engineering, t commonly represents time in seconds, although position or another variable may be used. The order is the highest derivative present. For example, y″ + 4y′ + 3y = 0 is second order. The degree is the power of the highest derivative when the equation is polynomial in derivatives; degree is not defined in the usual way for equations involving functions such as sin(y′). An equation is linear in y if y and its derivatives occur only to the first power and are not multiplied together. The general linear nth-order form is an(t)y⁽ⁿ⁾ + an−1(t)y⁽ⁿ−¹⁾ + … + a1(t)y′ + a0(t)y = g(t) The coefficients a_i(t) may depend on t, but not on y. The equation is homogeneous when g(t) = 0 and nonhomogeneous when g(t) ≠ 0. Equations such as y′ = y2 + t are nonlinear. A model is an approximation. It is valid only under stated assumptions, such as rigid bodies, small displacement, constant resistance, negligible friction, or constant material properties. Good engineering practice records these assumptions because they determine where the model can be trusted. 2. First-Order ODEs2.1 Separable equationsA first-order equation is separable if it can be rearranged as f(y) dy = g(t) dt Integration gives ∫ f(y) dy = ∫ g(t) dt + C where C is an integration constant. If an initial condition y(t₀) = y₀ is given, C is determined by substitution. Worked Example 1: CoolingA metal component at 90 °C is placed in an environment at 20 °C. Newton’s law of cooling states that the rate of change of temperature is proportional to the difference between ambient and component temperature: dT/dt = −k(T − Ta), k > 0 T is temperature in °C, T_a is constant ambient temperature, t is time, and k has units s⁻¹. Separating variables, dT/(T − Ta) = −k dt and integrating gives T(t) = Ta + (T0 − Ta)e^(−kt) where T₀ is the initial temperature. If T(10) = 60 °C, then 60 = 20 + 70e^(−10k), so e^(−10k) = 4/7 and k = −(1/10)ln(4/7) ≈ 0.0559 s⁻¹. Thus, T(t) = 20 + 70e^(−0.0559t) °C The steady-state temperature is 20 °C, while the transient term is 70e^(−0.0559t). 2.2 First-order linear equationsThe standard form is y′ + p(t)y = q(t) where p and q are known functions. The integrating factor is μ(t) = e^(∫p(t)dt) Multiplying the equation by μ(t) produces d[μ(t)y]/dt = μ(t)q(t) Therefore, y(t) = [∫ μ(t)q(t)dt + C]/μ(t) This formula applies on an interval where p and q are continuous. Worked Example 2: RC charging circuitFor a series resistor R and capacitor C connected to a voltage source V_s, Kirchhoff’s voltage law gives RC dvC/dt + vC = Vs R is resistance in Ω, C is capacitance in F, and v_C is capacitor voltage in V. Dividing by RC, dvC/dt + (1/RC)vC = Vs/(RC) For the initial condition v_C(0) = 0, the solution is vC(t) = Vs(1 − e^(−t/RC)) The time constant is τ = RC, measured in seconds. At t = τ, the capacitor voltage reaches approximately 63.2% of V_s. The current is i(t) = (Vs/R)e^(−t/RC) The capacitor voltage rises while current decays, illustrating the exchange between transient and steady-state behavior. 2.3 Exact equationsAn equation M(t,y)dt + N(t,y)dy = 0 is exact if ∂M/∂y = ∂N/∂t on the region of interest. There then exists a potential function Φ(t,y) such that Φ_t = M and Φ_y = N, and the implicit solution is Φ(t,y) = C. 2.4 Bernoulli equationsA Bernoulli equation has the form y′ + p(t)y = q(t)yn, n ≠ 0, 1 Using the substitution v = y^(1−n), it becomes a first-order linear equation in v. This method is useful for models involving nonlinear growth or saturation, but solutions must be checked against possible lost solutions such as y = 0. 3. Higher-Order Linear ODEsA constant-coefficient homogeneous equation is an y⁽ⁿ⁾ + an−1y⁽ⁿ−¹⁾ + … + a1y′ + a0y = 0 Assume a trial solution y = e^(rt). Substitution gives the characteristic equation an rn + an−1r^(n−1) + … + a1r + a0 = 0 The roots determine the complementary solution. | Characteristic roots | Corresponding solution terms |
|---|
| Distinct real roots r₁, r₂ | C₁e^(r₁t) + C₂e^(r₂t) | | Repeated real root r of multiplicity m | (C₁ + C₂t + … + C_m t^(m−1))e^(rt) | | Complex roots α ± jβ | e^(αt)[C₁cos(βt) + C₂sin(βt)] |
Here j² = −1. Constants are determined by initial or boundary conditions. Worked Example 3: Mass–spring–damper systemFor a mass m attached to a spring of stiffness k and damper coefficient c, Newton’s second law gives m x″ + c x′ + kx = F(t) x is displacement in m, x′ is velocity in m/s, x″ is acceleration in m/s², m is kg, c is N·s/m, k is N/m, and F is force in N. The equation assumes linear spring behavior, viscous damping, and one-dimensional motion. For free vibration, F(t) = 0. Let m = 1 kg, c = 4 N·s/m, and k = 3 N/m. The characteristic equation is r² + 4r + 3 = (r + 1)(r + 3) = 0 Thus, x(t) = C₁e^(−t) + C₂e^(−3t) If x(0) = 0.10 m and x′(0) = 0, then C₁ + C₂ = 0.10 and −C₁ − 3C₂ = 0. Solving gives C₁ = 0.15 and C₂ = −0.05. Therefore, x(t) = 0.15e^(−t) − 0.05e^(−3t) m Both modes decay, so the unforced system is asymptotically stable. The roots are real and distinct; consequently, the response is overdamped and does not oscillate. 3.1 Damping classificationFor the general free mass–spring–damper equation, define ωn = √(k/m), ζ = c/(2√(mk)) where ω_n is the undamped natural frequency in rad/s and ζ is the dimensionless damping ratio. The system is: - overdamped when ζ > 1;
- critically damped when ζ = 1;
- underdamped when 0 < ζ < 1;
- undamped when ζ = 0.
For the underdamped case, the damped frequency is ωd = ωn√(1 − ζ²) and the free response contains decaying sine and cosine terms. These classifications apply to a linear second-order system with positive m and k and viscous damping c. 3.2 Nonhomogeneous equationsFor L[y] = g(t) the general solution is y = yh + yp where y_h solves the homogeneous equation and y_p is any particular solution. For polynomial, exponential, or sinusoidal forcing, undetermined coefficients is often efficient. Variation of parameters is more general and applies when a suitable fundamental set of homogeneous solutions is known. When forcing frequency approaches a system’s natural frequency and damping is small, the response may become large. This phenomenon is resonance. In physical systems, nonlinearities, damping, saturation, and structural limits prevent indefinite growth, but resonance can still cause excessive vibration or failure. 4. Nonlinear ODEs and LinearizationNonlinear equations arise from geometric effects, friction, magnetic saturation, fluid flow, and nonlinear sensors. Exact closed-form solutions are uncommon. Important approaches include separation, substitutions, energy methods, numerical integration, and local linearization. Consider x′ = f(x,u) where x is a state variable and u is an input. An equilibrium x_e for constant input u_e satisfies f(xe,ue) = 0 For a small perturbation δx about equilibrium, use the first-order Taylor expansion: δx′ ≈ (∂f/∂x)|_(xe,ue) δx + (∂f/∂u)|_(xe,ue) δu For a scalar autonomous system x′ = f(x), local asymptotic stability follows if f′(xe) < 0, while instability follows if f′(xe) > 0. The test is inconclusive when the derivative is zero; nonlinear terms must then be examined. For a vector model x′ = f(x), the Jacobian matrix is J = ∂f/∂x evaluated at equilibrium. If all eigenvalues of J have negative real parts, the equilibrium is locally asymptotically stable. If at least one eigenvalue has positive real part, it is unstable. Eigenvalues on the imaginary axis require further analysis. 5. State-Space RepresentationA system of order n can often be expressed using n first-order equations. Define the state vector x = [x₁ x₂ … xn]T A linear time-invariant model has the form x′ = Ax + Bu
y = Cx + Du x is the state vector, u is the input, y is the output, A is the system matrix, B is the input matrix, C is the output matrix, and D is the direct-transmission matrix. Dimensions must be compatible. For example, if x has n components and u has m components, A is n×n and B is n×m. For the mass–spring–damper model, x₁ = displacement, x₂ = velocity so x₁′ = x₂ x₂′ = −(k/m)x₁ − (c/m)x₂ + (1/m)F(t) This form is valuable for simulation, control design, observability and integration with sensors and actuators. 6. Initial and Boundary ConditionsAn nth-order ODE generally requires n independent conditions to determine a unique solution. Initial conditions specify values at one point, for example y(0) = y₀, y′(0) = v₀ They are natural in dynamic systems because position and velocity may be measured at the initial time. Boundary conditions specify values at different points, such as y(0) = 0 and y(L) = 0. They occur frequently in spatial problems, beams, heat conduction, and fluid systems. A boundary-value problem may have no solution, one solution, or multiple solutions unless compatibility conditions are satisfied. Initial conditions represent stored energy or initial state. In an electrical circuit, capacitor voltage and inductor current cannot change arbitrarily instantaneously under ordinary finite-energy assumptions. In mechanics, initial displacement and velocity determine the initial stored potential and kinetic energy. 7. Dynamic Response and StabilityA response is commonly decomposed as response = transient response + steady-state response The transient response is associated with system modes and usually decays in a stable system. The steady-state response remains after transients have vanished. For a stable first-order system, y(t) = yss + [y(0) − yss]e^(−t/τ) where τ > 0 is the time constant. Approximately 63.2% of a step change occurs after one time constant, 86.5% after two, 95.0% after three, and 99.3% after five. Stability is not identical to speed. A system may be stable but slow, or fast but poorly damped. In linear continuous-time systems, asymptotic stability requires all characteristic roots to have negative real parts. A root with zero real part may produce sustained oscillation or indicate marginal stability, depending on multiplicity and system structure. Energy provides an important physical interpretation. Springs and capacitors store energy; masses and inductors store energy; dampers and resistors dissipate energy. Stability often results when stored energy is bounded and dissipation removes perturbation energy. Active actuators can inject energy and destabilize a system if feedback is improperly designed. 8. Modeling Physical SystemsMechanical systemsUse Newton’s law or an energy method. Translational models use force, mass, damping and stiffness. Rotational models use torque, moment of inertia J, rotational damping b, and torsional stiffness k_t: Jθ″ + bθ′ + ktθ = T(t) θ is angular displacement in rad and T is torque in N·m. The rotational equation is the direct analogue of the translational model. Electrical systemsKirchhoff’s voltage and current laws generate ODEs. For an inductor, vL = L di/dt, where L is inductance in H. For a capacitor, iC = C dv/dt, where C is capacitance in F. Resistors obey vR = Ri. Sign conventions must be selected consistently. Thermal systemsA lumped thermal model is based on energy balance: Cth dT/dt = Pin − (T − Ta)/Rth C_th is thermal capacitance in J/K, R_th is thermal resistance in K/W, P_in is applied power in W, and T_a is ambient temperature. The thermal time constant is τ = Rth Cth, with units seconds. The lumped model assumes the component has nearly uniform temperature. Electromechanical systemsA DC motor illustrates coupling. A simplified armature equation is L di/dt + Ri + Keω = v and the mechanical equation is J dω/dt + bω = Kt i − TL L is inductance, R resistance, i current, K_e back-emf constant, ω angular speed, v applied voltage, J rotor inertia, b viscous friction, K_t torque constant, and T_L load torque. In SI units, K_e and K_t have numerically compatible values when their units are consistently defined. The equations show that electrical current creates torque while rotation creates opposing back emf. 9. Illustrative Case: Temperature Regulation of a Motor DriveBackground. A servo motor in a robotic joint operates inside an enclosure. Excessive winding temperature reduces insulation life and may cause shutdown. Problem. During a repeated motion cycle, copper losses produce approximately constant power P_loss. The engineering team needs a first model to estimate temperature and select a warning threshold. Analysis. A lumped thermal model is selected: Cth dT/dt = Ploss − (T − Ta)/Rth Assume T_a = 25 °C, R_th = 2 K/W, C_th = 500 J/K, P_loss = 20 W, and initial temperature T(0) = 25 °C. The time constant is τ = Rth Cth = 1000 s The equilibrium temperature satisfies dT/dt = 0: Te = Ta + Rth Ploss = 25 + 2(20) = 65 °C The response is T(t) = Te + [T(0) − Te]e^(−t/τ) = 65 − 40e^(−t/1000) °C At t = 600 s, T(600) = 65 − 40e^(−0.6) ≈ 43.1 °C. Approach and solution. The controller can use measured temperature to reduce duty cycle when the temperature approaches a prescribed limit. If the motor’s allowable continuous temperature is 80 °C, the constant-loss model predicts no violation under these assumptions. However, intermittent operation, airflow changes, temperature-dependent resistance, and localized hot spots may produce a higher actual temperature. Outcome. The model provides a time constant for scheduling thermal derating and a steady-state estimate for preliminary design. It should be validated experimentally using temperature sensors and several operating profiles. Learning points. First, conservation laws create the model. Second, equilibrium is found by setting derivatives to zero. Third, the time constant describes response speed, not final temperature. Finally, model validation is essential before safety decisions are made. 10. Numerical Solution and Engineering SoftwareWhen analytical solutions are unavailable, numerical methods approximate the solution at discrete times. For y′ = f(t,y), y(t₀) = y₀ explicit Euler’s method is yn+1 = yn + h f(tn,yn) where h is the time step. The method is simple but may be inaccurate or unstable for large h. Higher-order Runge–Kutta methods generally provide improved accuracy. Commercial simulation tools should not replace model inspection: a numerically precise solution to an incorrect model remains incorrect. A robust workflow is to identify states and inputs, derive equations from conservation laws, check dimensions, calculate equilibria, estimate time constants, select an appropriate solver, and compare simulation with measured data. AI-assisted modeling can help generate candidate equations or code, but engineers must verify signs, units, assumptions, stability, and physical plausibility. Safety-critical decisions require traceable calculations and independent review. 11. Challenges, Limitations, and Best PracticesReal systems may exhibit hysteresis, backlash, Coulomb friction, saturation, dead zones, delays, sensor noise, parameter variation, and unmodeled dynamics. Linear models are often accurate only near an operating point. Lumped thermal models fail when temperature gradients are significant. Constant-coefficient electrical models may fail when components are nonlinear or frequency-dependent. Best practices include: - Define system boundaries, inputs, outputs, states, and sign conventions.
- State assumptions and units beside the model.
- Check limiting cases, such as zero damping or zero input.
- Verify equilibrium by substituting it into the differential equation.
- Compare predicted time constants with observed response times.
- Use sensitivity analysis to identify influential parameters.
- Validate against measurements over the intended operating range.
- Document model version, parameter sources, calibration data, and uncertainty.
- Apply conservative margins where model error can affect safety.
Engineering responsibility includes recognizing that a model can influence decisions about machine safety, thermal protection, energy use, and product reliability. Transparent assumptions and validation are therefore technical and ethical requirements. Chapter SummaryOrdinary differential equations model time-varying behavior in mechatronic systems. Equations are classified by order, linearity, coefficients, and forcing. Separable equations are solved by integration; first-order linear equations use integrating factors; higher-order constant-coefficient equations use characteristic roots. Particular solutions are added to homogeneous solutions for nonhomogeneous equations. Mechanical, electrical, thermal, and electromechanical models follow from Newton’s laws, Kirchhoff’s laws, energy balances, and actuator coupling. Initial conditions represent the initial state and stored energy, whereas boundary conditions constrain values at different locations or times. Equilibrium is obtained by setting derivatives to zero. Stability is inferred from decay of modes, characteristic roots, or Jacobian eigenvalues. Time constants, damping ratios, transient response, and steady-state response provide practical measures of dynamic behavior. Finally, every model is conditional. Dimensional checks, explicit assumptions, numerical verification, experimental validation, and professional documentation are essential when models are used in design or safety decisions. Key TermsOrdinary differential equation: An equation involving derivatives with respect to one independent variable. Order: The highest derivative appearing in an ODE. Linear ODE: An ODE in which the dependent variable and its derivatives occur linearly. Homogeneous equation: A linear equation whose forcing term is zero. Separable equation: An ODE that can be rearranged into a product of a function of y and a function of t. Integrating factor: A function that converts a first-order linear ODE into an integrable derivative. Characteristic equation: The algebraic equation obtained from an exponential trial solution. Particular solution: One solution of a nonhomogeneous differential equation. Initial condition: A specified state or derivative value at one independent-variable value. Boundary condition: A condition imposed at specified boundaries of the domain. State variable: A variable that, together with other states, describes the system’s future behavior. Equilibrium: A state at which the system derivatives are zero for a specified constant input. Stability: The tendency of a system to remain near or return toward equilibrium after perturbation. Time constant: A parameter describing the speed of a first-order exponential response. Natural frequency: The oscillation frequency of an undamped second-order system. Damping ratio: A dimensionless measure of damping relative to critical damping. Resonance: A large response caused by forcing near a natural frequency. Linearization: Approximation of a nonlinear model by its first-order Taylor expansion near an operating point. State-space model: A set of first-order equations expressing state evolution and output relationships. Model validation: Comparison of model predictions with physical or experimental evidence. Review QuestionsShort Answer Questions- What distinguishes a linear ODE from a nonlinear ODE?
- What physical meaning does an initial condition have in a mechanical system?
- Define equilibrium for the model x′ = f(x,u).
- What is the time constant of an RC circuit?
- State the characteristic-root condition for asymptotic stability of a continuous-time linear system.
Long Answer Questions- Derive the solution of a first-order linear ODE using an integrating factor.
- Explain how the roots of a second-order characteristic equation determine damping behavior.
- Derive the mass–spring–damper equation using Newton’s second law and define every parameter.
- Explain the difference between initial-value and boundary-value problems, including engineering examples.
- Discuss the assumptions and limitations of a lumped thermal model.
Analytical / Application Questions- A first-order actuator is modeled by 2y′ + 5y = 10, with y(0) = 0. Determine y(t), its time constant, and its steady-state value.
- For x″ + 6x′ + 9x = 0, classify the damping and determine the form of the solution. Explain whether repeated roots occur.
- A motor thermal system has T_a = 30 °C, R_th = 1.5 K/W, C_th = 800 J/K, P_loss = 10 W, and T(0) = 30 °C. Determine its equilibrium temperature and temperature after one time constant.
Multiple Choice Questions with AnswersQuestion 1Which condition defines a homogeneous linear ODE? A. The highest derivative is zero B. The forcing term is zero C. All coefficients are constant D. The dependent variable is zero Correct Answer: B. The forcing term is zero Question 2The integrating factor for y′ + p(t)y = q(t) is A. e^(∫q(t)dt) B. ∫p(t)dt C. e^(∫p(t)dt) D. p(t)et Correct Answer: C. e^(∫p(t)dt) Question 3For a series RC circuit, the time constant is A. R/C B. RC C. 1/(RC) D. R+C Correct Answer: B. RC Question 4The characteristic roots of r² + 4r + 3 = 0 are A. 1 and 3 B. −1 and −3 C. −2 and 2 D. 3 and −4 Correct Answer: B. −1 and −3 Question 5A second-order system with damping ratio ζ = 0.5 is A. Overdamped B. Critically damped C. Underdamped D. Undamped Correct Answer: C. Underdamped Question 6For the thermal model Cth dT/dt = P − (T−Ta)/Rth, the equilibrium temperature is A. Ta − Rth P B. Ta + Rth P C. Rth Cth P D. P/(Rth Cth) Correct Answer: B. Ta + Rth P Question 7The equilibrium of x′ = f(x,u) for constant input ue satisfies A. f(xe,ue) = 0 B. f(xe,ue) = 1 C. xe = ue D. x′ = ue Correct Answer: A. f(xe,ue) = 0 Question 8For a scalar autonomous system, the usual local stability test indicates asymptotic stability when A. f′(xe) > 0 B. f′(xe) = 1 C. f′(xe) < 0 D. f(xe) > 0 Correct Answer: C. f′(xe) < 0 Question 9In explicit Euler’s method for y′ = f(t,y), the update is A. yn+1=yn+h f(tn,yn) B. yn+1=yn−h f(tn,yn) C. yn+1=h yn+f(tn,yn) D. yn+1=yn/f(tn,yn) Correct Answer: A. yn+1=yn+h f(tn,yn) Question 10For a DC motor, back emf is primarily represented by a term proportional to A. Angular speed B. Load torque only C. Armature resistance D. Rotor inertia Correct Answer: A. Angular speed
|