Chapter 14
Modeling, Simulation, Diagnostics and Engineering Decisions
Bachelor Program in Mechatronics Engineering
Basic Electrical Engineering
•
Bachelor
Modeling, Simulation, Diagnostics and Engineering Decisions
Introduction
Modern mechatronic systems are rarely designed by calculation alone. A circuit may satisfy nominal voltage and current requirements yet fail because of component tolerance, thermal stress, sensor noise, wiring resistance, software timing, or an unexpected fault. Basic electrical engineering therefore extends beyond solving ideal circuits: engineers must build models, simulate behavior, compare predictions with measurements, diagnose discrepancies, and make decisions under uncertainty.
A model is a purposeful representation of a physical system. It may be a symbolic circuit, a differential equation, a state-space model, a SPICE netlist, a spreadsheet, or a digital twin. No model is universally correct; its suitability depends on its purpose, assumptions, parameter accuracy, and validation evidence. Simulation is the numerical execution of a model. Experimental data provide evidence about the real system. Engineering judgment connects all three.
This chapter develops a practical workflow for circuit modeling, simulation, fault diagnosis, sensitivity analysis, reliability assessment, lifecycle costing, and energy-efficiency decisions.
Learning Objectives
After studying this chapter, the reader should be able to:
Formulate electrical systems using appropriate circuit and mathematical models.
Select simulation methods and interpret their results critically.
Validate models using measurements and quantify discrepancies.
Diagnose electrical faults using symptoms, measurements, and structured reasoning.
Perform sensitivity, uncertainty, reliability, lifecycle-cost, and energy-efficiency analyses.
Make defensible engineering decisions while recognizing safety, ethical, and regulatory constraints.
1. From Physical System to Engineering Model
1.1 Model purpose and abstraction
A physical system contains many effects, but a useful model includes only those that influence the decision being made. For example, a DC motor model for speed estimation may include winding resistance, inductance, back electromotive force, torque constant, inertia, and friction. A high-frequency electromagnetic-interference model may additionally require parasitic capacitances, lead inductances, switching transitions, and layout geometry.
Modeling commonly proceeds through four levels:
Level
Representation
Typical use
Conceptual
Block diagram or equivalent circuit
Define boundaries and interactions
Analytical
Algebraic or differential equations
Derive trends and limiting behavior
Numerical
SPICE, MATLAB/Simulink, Python, or finite-element model
Predict time and frequency responses
Experimental
Test rig, data acquisition, or prototype
Validate and update the model
A model boundary must identify inputs, outputs, internal states, parameters, initial conditions, and disturbances. For a resistor, the ideal relation is v = Ri, where v is voltage in volts, i is current in amperes, and R is resistance in ohms. This relation assumes ohmic behavior over the operating range and neglects temperature, frequency, and parasitic effects.
For a capacitor, i = C dv/dt, where C is capacitance in farads. For an inductor, v = L di/dt, where L is inductance in henries. These differential relations apply to lumped components under the usual circuit approximation. At high frequencies, distributed effects may invalidate the approximation.
1.2 Governing equations
Kirchhoff’s current law (KCL) states that algebraic current entering a node equals zero:
∑ ik = 0
Kirchhoff’s voltage law (KVL) states that the algebraic sum of voltages around a closed loop is zero:
∑ vk = 0
KCL follows from charge conservation and KVL from conservation of energy in a lumped circuit model. Both require consistent reference directions and polarities.
A first-order RC discharge illustrates model construction. For a capacitor discharging through a resistor, KCL gives:
C dv/dt + v/R = 0
With initial voltage v(0) = V0, the solution is:
v(t) = V0 e^(−t/RC)
The time constant is τ = RC, measured in seconds. At t = τ, the voltage is approximately 36.8% of its initial value. The solution assumes constant R and C, no leakage other than R, and zero external current.
1.3 State-space representation
For dynamic systems, a state-space model separates state evolution from measured outputs:
ẋ = Ax + Bu
y = Cx + Du
Here, x is the state vector, u the input vector, y the output vector, and A, B, C, and D are matrices of compatible dimensions. This form supports simulation, control design, observability analysis, and fault estimation. It assumes the system has been linearized or is intrinsically linear. Nonlinear systems require ẋ = f(x,u,t) and y = g(x,u,t).
2. Simulation Methods and Numerical Reliability
2.1 Operating modes
Circuit simulators typically provide several analyses:
Operating-point analysis: finds steady voltages and currents for a specified bias condition.
Transient analysis: calculates time-domain behavior after switching or changing inputs.
AC small-signal analysis: linearizes a nonlinear circuit about an operating point and evaluates frequency response.
DC sweep: varies a source or parameter and records steady-state results.
Parameter and Monte Carlo analysis: explores tolerances and random variations.
Worst-case analysis: evaluates specified combinations of parameter extremes.
The method must match the engineering question. AC analysis cannot predict large-signal clipping unless the operating point and linearization remain appropriate. A transient model with an unrealistically ideal switch may conceal voltage spikes that occur in hardware.
2.2 Numerical integration and error
For a differential equation, a simulator approximates a continuous trajectory at discrete time points. The explicit Euler method is conceptually simple:
x_(k+1) = xk + ∆t f(xk,uk,tk)
where ∆t is the time step. Euler integration is easy to implement but may be inaccurate or unstable when the step is too large relative to the fastest system time constant. More advanced methods, such as backward Euler and Runge–Kutta methods, improve stability or accuracy at additional computational cost.
A sound simulation study includes time-step refinement. If reducing the maximum step from 10 μs to 5 μs changes a peak current substantially, the original result was not numerically converged. Numerical tolerances should not be confused with physical accuracy: a highly converged simulation of an incorrect model remains incorrect.
2.3 Verification and validation
Verification asks whether the equations and software have been implemented correctly: “Did we solve the model right?” Validation asks whether the model represents the real system adequately: “Did we choose the right model?”
Useful checks include:
Dimensional consistency of equations.
Limiting cases, such as zero resistance or infinite capacitance.
Conservation of energy and charge.
Comparison with an independent hand calculation.
Mesh, time-step, and solver-tolerance convergence.
Comparison with measurements under controlled conditions.
For measured values yi and predicted values ŷi, common error measures are:
ei = yi − ŷi
RMSE = √[(1/n) ∑(yi − ŷi)2]
MAE = (1/n) ∑|yi − ŷi|
RMSE has the same units as the measured quantity and penalizes large errors more strongly. MAE is less sensitive to isolated large errors. Relative error may be written as 100|y − ŷ|/|y| percent when y ≠ 0. Near zero, absolute error or a normalized full-scale error is more meaningful.
A residual plot against time, voltage, temperature, or load can reveal systematic error. Random residuals centered near zero suggest that the model captures the dominant behavior; a trend suggests a missing physical effect or incorrect parameter.
Engineering model validation workflow
Figure: Engineering model validation workflow
Figure: A validation loop linking the physical system, model, simulation, and measured data.
3. Experimental Data and Parameter Estimation
Measurements are meaningful only when the test conditions, instrument uncertainty, calibration status, sample rate, sensor bandwidth, and reference points are documented. A voltage measurement across a load is not equivalent to a voltage measurement at the power supply if wiring resistance causes a drop.
For independent measurements with standard uncertainties u1, u2, …, un, the combined standard uncertainty for a quantity q = q(x1,…,xn) can be approximated by:
uc(q) = √[∑(∂q/∂xi)2 ui2]
This root-sum-square form assumes small uncertainties, approximately linear behavior near the estimate, and uncorrelated input quantities. Correlated variables require covariance terms.
Parameter estimation adjusts model parameters so predictions agree with data. Least squares minimizes:
J(θ) = ∑[yi − ŷ(ti; θ)]2
where θ is the parameter vector. A parameter estimate is not automatically physically valid. It should be checked against datasheets, independent tests, confidence intervals, and identifiability. If two parameters have nearly identical effects on the output, data from one experiment may not distinguish them; a different excitation or measurement is required.
4. Fault Diagnosis
Diagnosis is the inference of a fault cause from symptoms and evidence. Common electrical faults include open circuits, short circuits, increased contact resistance, reversed polarity, insulation breakdown, degraded capacitors, sensor drift, and intermittent connections.
A disciplined diagnostic process is:
Make the system safe. Isolate energy, discharge capacitors, apply lockout procedures, and use appropriate personal protective equipment.
Define the symptom. Record when it occurs, under what load, and whether it is repeatable.
Partition the system. Divide the circuit into source, distribution, sensing, control, and actuator sections.
Predict before measuring. State the expected voltage or current at each test point.
Measure systematically. Use a meter, oscilloscope, insulation tester, current probe, or thermal camera as appropriate.
Compare hypotheses. Eliminate causes inconsistent with the evidence.
Repair and verify. Test under normal and boundary conditions, then document the root cause.
For series elements, an open circuit normally produces approximately zero current and may leave supply voltage across the open element. A short circuit produces unusually low voltage across the fault and potentially excessive current, limited by source impedance and protection. These are tendencies, not absolute rules; parallel paths and electronic protection can alter symptoms.
Fault-tree analysis begins with a top event, such as “motor does not start,” and decomposes it using logical AND and OR relationships. A fishbone diagram supports broader cause classification, including human, machine, method, material, measurement, and environment. Diagnostic decisions should rely on evidence rather than replacing components by trial and error.
5. Sensitivity, Tolerance, and Robust Design
Sensitivity measures how strongly an output responds to an input or parameter. The local sensitivity of output y to parameter p is:
Sp = ∂y/∂p
A dimensionless relative sensitivity is often more useful:
Spr = (p/y)(∂y/∂p)
For y = ab, the relative sensitivity to either a or b is 1. For a voltage divider Vo = Vs R2/(R1 + R2), increasing R₂ raises output, while increasing R₁ lowers it. The derivative with respect to R₂ is:
∂Vo/∂R2 = Vs R1/(R1 + R2)2
This assumes ideal voltage source behavior and fixed resistors. In practice, source resistance and load resistance must also be included.
Tolerance analysis uses component ranges. If resistor values are independent and normally distributed, the approximate standard deviation of a function can be estimated with the uncertainty formula above. Monte Carlo analysis repeatedly samples tolerances and records the output distribution. It is especially useful for nonlinear circuits, where worst-case combinations may be improbable and linear approximations may fail.
Robust design does not simply optimize nominal performance. It seeks acceptable performance across manufacturing variation, temperature, aging, supply variation, and foreseeable disturbances.
6. Reliability and Availability
Reliability is the probability that an item performs its required function for a specified time under stated conditions. For a constant failure rate λ and an exponential lifetime model:
R(t) = e^(−λt)
The mean time to failure is:
MTTF = 1/λ
These expressions assume a constant hazard rate and are not appropriate for all products. Infant mortality and wear-out require other models, such as Weibull analysis.
For independent components connected in a series-reliability arrangement, system reliability is:
Rs(t) = ∏ Ri(t)
All components must function for the system to function. For two independent redundant components in parallel, where either can perform the function:
Rp(t) = 1 − [1 − R1(t)][1 − R2(t)]
Independence is a critical assumption. Common-cause failures, shared power supplies, thermal coupling, and maintenance errors can make redundancy less effective than the formula suggests.
Availability includes repair. A simple steady-state approximation is:
A = MTBF/(MTBF + MTTR)
where MTBF is mean time between failures and MTTR is mean time to repair. The expression assumes a repairable system with stable rates and clearly defined operating and repair periods.
7. Energy Efficiency and Lifecycle Cost
Electrical energy consumed over time is:
E = ∫ p(t) dt
For constant power, E = Pt. With voltage and current, instantaneous power is p(t) = v(t)i(t). For sinusoidal AC systems, real power is P = Vrms Irms cosφ for a balanced sinusoidal condition, where cosφ is the power factor. Distortion and unbalance require more detailed analysis.
Efficiency is:
η = Pout/Pin
Losses are Ploss = Pin − Pout. Efficiency must be evaluated at relevant load points because motors, converters, and power supplies often have load-dependent losses.
Lifecycle cost includes acquisition, installation, energy, maintenance, downtime, disposal, and sometimes environmental externalities:
For costs occurring in future years, present value is:
PV = Ck/(1+r)k
where Ck is the cost in year k and r is the annual discount rate. A consistent analysis must state currency, study period, escalation assumptions, discount rate, operating hours, and residual value. The cheapest purchase price is not necessarily the lowest lifecycle cost.
8. Worked Example: Selecting a DC Supply
An actuator requires 24 V DC and draws 2.0 A continuously for 4,000 h per year. Supply A costs $90, has efficiency 88%, and is expected to last 5 years. Supply B costs $140, has efficiency 94%, and lasts 5 years. Electricity costs $0.15 per kWh. Ignore maintenance and discounting.
The output energy is:
Eout = 24 × 2.0 × 4000 = 192000 Wh = 192 kWh/year
Input energy is output energy divided by efficiency. For A:
Ein,A = 192/0.88 = 218.18 kWh/year
For B:
Ein,B = 192/0.94 = 204.26 kWh/year
Annual energy-cost saving with B is:
∆Cenergy = (218.18 − 204.26) × 0.15 = $2.09/year
Over five years, the energy saving is approximately $10.45, while B costs $50 more initially. Under these stated assumptions, A has the lower lifecycle cost. However, the decision may change if operating hours, electricity price, cooling requirements, reliability, or downtime costs are higher. This example demonstrates why efficiency must be analyzed together with duty cycle and total cost.
9. Illustrative Case: Diagnosing an Intermittent Conveyor Stop
Background. A laboratory conveyor uses a 24 V supply, a PLC, an optical sensor, and a motor driver. It stops intermittently after several minutes of operation.
Problem. Replacing the motor and PLC does not solve the issue. The stop occurs more often at high motor load.
Analysis. The team defines three hypotheses: sensor failure, supply collapse, and a high-resistance connection. A data logger records supply voltage at the PLC and motor-driver input simultaneously. The PLC voltage remains near 24 V, but the driver input falls to 19 V during motor acceleration. Thermal inspection identifies a warm terminal at the supply distribution block. With power isolated, torque testing finds a loose crimp.
Solution. The terminal is replaced, conductors are correctly crimped, and the connection is tightened according to the manufacturer’s specification. The team adds a startup-voltage test to preventive maintenance and records the measurement location in the work instruction.
Outcome. Repeated high-load tests show no voltage collapse. The diagnosis was supported by time-correlated measurements rather than component substitution.
Learning points. Intermittent faults require event capture, not only static measurements. Measurements should be taken at the load terminals, not just at the source. Thermal evidence can indicate contact resistance, but temperature alone does not prove the root cause. Safe isolation and appropriate test instruments remain mandatory.
10. Engineering Decisions, Governance, and Contemporary Tools
Engineering decisions should make assumptions visible and distinguish measured facts from estimates. A decision record should identify requirements, alternatives, constraints, uncertainty, safety margins, test evidence, and acceptance criteria. Safety-critical decisions require traceability, independent review, fail-safe behavior, and compliance with applicable electrical, machinery, EMC, and functional-safety standards.
Simulation and AI-assisted tools can accelerate parameter fitting, anomaly detection, surrogate modeling, and design-space exploration. They do not remove the need for physical validation. An AI model trained on biased or incomplete fault data may misclassify rare but dangerous failures. Engineers must preserve data provenance, protect confidential information, test abnormal cases, and ensure that automated recommendations remain reviewable.
Digital twins are useful when a sufficiently accurate model is connected to current operational data. Their value depends on sensor quality, synchronization, model updating, cybersecurity, and a clear decision purpose. A visually impressive dashboard is not evidence of predictive accuracy.
Best-practice checklist
Define the engineering question before choosing a model.
State assumptions, units, boundary conditions, and parameter sources.
Verify equations and numerical convergence.
Validate against independent measurements over the intended operating range.
Quantify uncertainty and investigate systematic residuals.
Use safe, repeatable diagnostic procedures.
Evaluate tolerance, reliability, energy, and lifecycle effects together.
Document alternatives and decision criteria.
Review safety, cybersecurity, environmental, and regulatory implications.
Treat simulation and AI outputs as evidence requiring engineering judgment, not as unquestionable truth.
Challenges and Limitations
Models may omit parasitic effects, nonlinear saturation, thermal coupling, aging, electromagnetic interference, and human interaction. Measurements may contain bias, aliasing, sensor loading, grounding errors, and inadequate bandwidth. Reliability calculations may fail when component failures are correlated. Lifecycle-cost results depend strongly on uncertain future energy prices and maintenance assumptions. Sensitivity analysis is local unless the operating range is explicitly explored. Finally, a statistically likely fault is not necessarily the most hazardous fault; risk-based decisions must consider severity as well as probability.
Chapter Summary
Electrical engineering decisions require a connected workflow of modeling, simulation, measurement, validation, diagnosis, and economic evaluation. Circuit laws provide the foundation for analytical and numerical models, while state-space equations represent dynamic behavior. Simulation modes must match the question, and numerical convergence does not guarantee physical validity. Measurements require calibration, documented conditions, and uncertainty awareness. Residuals, parameter estimation, and sensitivity analysis reveal model deficiencies and robust-design requirements. Fault diagnosis is best performed through safe, hypothesis-driven measurement rather than trial-and-error replacement. Reliability models quantify survival and availability only under stated assumptions. Energy efficiency and lifecycle cost expose trade-offs that nominal purchase price conceals. Responsible engineering decisions are evidence-based, traceable, safe, and aware of uncertainty, regulation, cybersecurity, and ethical consequences.
Key Terms
Model: A purposeful representation of a physical system.
Simulation: Numerical execution of a mathematical or computational model.
Verification: Checking whether a model or implementation has been solved correctly.
Validation: Checking whether a model adequately represents the real system.
Operating point: Steady-state condition about which a circuit may be analyzed.
Transient analysis: Calculation of time-varying circuit behavior.
State variable: A quantity describing stored energy or system condition.
Residual: Difference between measured and predicted output.
RMSE: Root-mean-square prediction error.
Parameter estimation: Determination of model parameters from data.
Sensitivity: Change in output caused by change in an input or parameter.
Tolerance analysis: Evaluation of performance under component variation.
Monte Carlo analysis: Repeated random sampling to estimate output distributions.
Reliability: Probability of performing a required function for a specified time.
Failure rate: Rate parameter describing failures under specified assumptions.
Availability: Fraction of time a repairable system is operational.
Efficiency: Ratio of useful output power to input power.
Lifecycle cost: Total cost over acquisition, operation, maintenance, and disposal.
Root cause: Underlying condition that produces a failure or symptom.
Digital twin: A data-connected model used to represent an operating physical asset.
Review Questions
Short Answer Questions
Distinguish verification from validation.
State the assumptions behind the exponential reliability model.
Why can a converged simulation still be physically inaccurate?
Define relative sensitivity.
Why should voltage be measured at the load during fault diagnosis?
Long Answer Questions
Explain a complete workflow for developing and validating a dynamic circuit model.
Compare transient, AC small-signal, DC sweep, and Monte Carlo simulation.
Explain how uncertainty and residual analysis support engineering decisions.
Discuss the limitations of series and parallel reliability formulas.
Explain why lifecycle cost can favor a less efficient or more efficient design depending on operating conditions.
Analytical / Application Questions
A 12 V sensor draws 0.25 A for 3,000 h/year. Compare annual energy cost at 80% and 90% supply efficiency when electricity costs $0.20/kWh.
A measured RC time constant is 0.98 s, while the model predicts 1.05 s. Calculate the percentage error relative to the measurement and identify two possible physical causes.
A motor controller resets only during acceleration. Design a measurement plan that distinguishes supply droop, electromagnetic interference, sensor failure, and a loose connection.
Multiple Choice Questions with Answers
Question 1
Which analysis is most appropriate for predicting a circuit’s response after a switch closes?
A. Operating-point analysis
B. Transient analysis
C. AC small-signal analysis
D. Component inventory analysis
Correct Answer: B. Transient analysis
Question 2
For an ideal capacitor, which relation is correct?
A. v = Ri
B. i = C dv/dt
C. i = v/C²
D. v = i/Ct
Correct Answer: B. i = C dv/dt
Question 3
A model that agrees closely with measured data has demonstrated validation primarily because it has shown that it:
A. Uses the fastest solver
B. Represents the physical system adequately for the tested purpose
C. Contains no assumptions
D. Requires no further testing
Correct Answer: B. Represents the physical system adequately for the tested purpose
Question 4
If a 24 V, 2 A load operates for 4,000 h, what is its output energy?
A. 19.2 kWh
B. 192 kWh
C. 1,920 kWh
D. 0.192 kWh
Correct Answer: B. 192 kWh
Question 5
For independent components in a series-reliability arrangement, system reliability is calculated by:
A. Adding component reliabilities
B. Multiplying component reliabilities
C. Subtracting the lowest reliability from one
D. Averaging failure rates only
Correct Answer: B. Multiplying component reliabilities
Question 6
Which symptom most strongly suggests an open circuit in a simple series path?
A. Normal current and zero voltage everywhere
B. Zero current with much of the supply voltage across the open point
C. Excessive current through every component
D. A guaranteed increase in capacitance
Correct Answer: B. Zero current with much of the supply voltage across the open point
Question 7
The purpose of time-step refinement in a transient simulation is primarily to assess:
A. Numerical convergence
B. Component purchase price
C. Fuse color
D. Mechanical alignment
Correct Answer: A. Numerical convergence
Question 8
A supply has 90% efficiency and delivers 900 W. Neglecting other effects, its input power is:
A. 810 W
B. 900 W
C. 1,000 W
D. 1,090 W
Correct Answer: C. 1,000 W
Question 9
Which method repeatedly samples parameter tolerances to estimate an output distribution?
A. Monte Carlo analysis
B. KCL analysis
C. Lockout analysis
D. Dimensional analysis
Correct Answer: A. Monte Carlo analysis
Question 10
A loose high-resistance terminal in a motor supply is most likely to produce:
A. A load-dependent voltage drop and local heating
B. Perfectly constant voltage under all loads
C. Zero magnetic field in every component
D. An increase in insulation resistance
Correct Answer: A. A load-dependent voltage drop and local heating