Engineering Mathematics I

Chapter 14
Computational Mathematics, Validation, and Emerging Practice

Bachelor Program in Mechatronics Engineering
Engineering Mathematics I   •   Bachelor

Computational Mathematics, Validation, and Emerging Practice

Introduction

Engineering mathematics is no longer performed only by hand or with a scientific calculator. A mechatronics engineer routinely moves among calculators, spreadsheets, MATLAB or Python, symbolic algebra systems, visualisation tools, simulation environments, and increasingly AI-assisted systems. These tools can evaluate difficult expressions, solve equations, fit models, propagate uncertainty, and communicate results. They cannot, by themselves, decide whether a model is appropriate, whether units are consistent, whether an answer is physically plausible, or whether data may ethically be used.

Computational mathematics therefore means more than obtaining a numerical answer. It is a disciplined process of translating a physical or mathematical problem into a computational model, selecting an appropriate method, executing it reproducibly, validating the result, estimating error and uncertainty, and communicating assumptions and limitations. This chapter develops that process for first-year engineering applications.

Learning objectives

By the end of this chapter, you should be able to:

  1. Select an appropriate calculator, spreadsheet, programming, symbolic, visualisation, or AI-assisted tool.
  2. Distinguish exact, approximate, numerical, modelling, and measurement errors.
  3. Validate computational results using units, limiting cases, independent methods, residuals, and physical reasoning.
  4. Estimate numerical error and propagate measurement uncertainty in simple engineering calculations.
  5. Construct reproducible spreadsheet and Python/MATLAB workflows.
  6. Use symbolic algebra and visualisation to support, rather than replace, mathematical reasoning.
  7. Document assumptions, protect data, and apply ethical and governance principles to computational work.

1. The computational mathematics workflow

A reliable computational solution normally follows this sequence:

Define → model → select → implement → verify → validate → interpret → document.

  • Define: State the question, required output, units, available data, and acceptable accuracy.
  • Model: Identify variables, governing relationships, boundary conditions, and assumptions.
  • Select: Choose an algorithm and tool appropriate to the problem size, structure, precision, and audience.
  • Implement: Enter equations or code carefully, using meaningful variable names and controlled inputs.
  • Verify: Check that the implementation correctly represents the intended mathematics.
  • Validate: Compare the model and output with measurements, theory, limiting cases, or an independent method.
  • Interpret: Explain what the result means physically and what it does not establish.
  • Document: Record data sources, versions, assumptions, units, tolerances, code, and results.

Verification asks, “Did we solve the equations correctly?” Validation asks, “Do these equations and results represent the real system adequately?” Confusing these questions is a common source of engineering failure.

Choosing a tool

ToolStrong useMain risk
CalculatorQuick evaluation and estimationIncorrect mode, precedence, or rounding
SpreadsheetTabulation, sensitivity studies, chartsHidden cells, copied formula errors, weak version control
MATLAB/PythonRepeated computation, algorithms, simulationProgramming and dependency errors
Symbolic algebraExact rearrangement, differentiation, integrationExpression may be mathematically valid but physically inappropriate
VisualisationTrends, anomalies, model comparisonMisleading axes, scales, or overinterpretation
AI-assisted toolDraft code, explanation, alternative approachesFabricated results, insecure data handling, unverified code

No tool removes the need for engineering judgement.

2. Numerical representation and error

Exact and approximate numbers

An exact quantity is represented without approximation within the model, such as the integer 12 or the definition of 1 m = 100 cm. A measured quantity, such as 2.37 V, is approximate because the instrument and experimental procedure have finite resolution and uncertainty. A computed quantity may also be approximate because an algorithm uses finite precision or replaces a continuous problem with a discrete one.

For a true value x and an approximation x̂, the absolute error is

Ea = |x − x̂|

where Eₐ has the same units as x. If x ≠ 0, the relative error is

Er = |x − x̂| / |x|

and the percentage error is 100Eᵣ %. In practice, the true value is often unknown, so an accepted reference, a higher-precision computation, or a bound is used instead.

Three error sources should be distinguished:

  • Modelling error: the equations or assumptions do not represent the physical system exactly.
  • Measurement error: input data differ from the quantity being measured because of bias, noise, resolution, or environmental effects.
  • Numerical error: finite precision, rounding, truncation, or an imperfect numerical algorithm changes the computed result.

A result with many displayed digits is not necessarily accurate. Display precision must not be confused with knowledge of the physical quantity.

Floating-point arithmetic

Digital systems usually represent real numbers using finite binary floating-point formats. Many decimal fractions cannot be represented exactly in binary. Arithmetic is therefore approximately performed as

fl(a ∘ b) = (a ∘ b)(1 + δ), |δ| ≤ u

where fl denotes floating-point evaluation, ∘ is an operation, δ is a relative rounding error, and u is the unit roundoff under the stated arithmetic format and rounding rule. This simplified model applies when overflow, underflow, and exceptional cancellation are absent.

Cancellation occurs when nearly equal numbers are subtracted. For example, evaluating a formula in a mathematically equivalent but numerically unstable form can lose significant digits. A stable reformulation, scaling, or higher precision may be preferable.

Conditioning and stability

A problem is well-conditioned if small input changes produce small output changes. It is ill-conditioned if small input changes can produce large output changes. An algorithm is stable if it does not introduce unnecessarily large errors while solving the problem. A well-conditioned problem can be badly computed by an unstable algorithm, and a stable algorithm cannot remove sensitivity inherent in an ill-conditioned problem.

For a scalar function y = f(x), a local relative condition measure is often approximated by

κ(x) ≈ |x f′(x) / f(x)|

provided f(x) and x are nonzero and f is differentiable. This is a sensitivity indicator, not an error guarantee.

3. Units, dimensions, and plausibility checks

A computational result must satisfy dimensional consistency. If velocity is calculated from distance d in metres and time t in seconds, then

v = d / t

has units m·s⁻¹. Adding quantities with incompatible units is invalid; multiplying and dividing units must follow the algebra of dimensions.

A practical unit-checking procedure is:

  1. Write units beside every input.
  2. Convert to a consistent system before substitution.
  3. Check the dimensions of each intermediate expression.
  4. Check the final unit against the requested quantity.
  5. Test the order of magnitude against physical expectations.

A useful plausibility check is a limiting case. For a first-order charging model

V(t) = Vf + (V0 − Vf)e^(−t/τ)

where V₀ is initial voltage, V_f is final voltage, t is time, and τ > 0 is the time constant, the model requires V(0) = V₀ and approaches V_f as t becomes large. Any implementation failing either test is incorrect, regardless of how smooth its plot appears.

4. Calculators and spreadsheets

A calculator is appropriate for a short, transparent calculation. Enter expressions using explicit parentheses and retain guard digits until the final step. Check whether the calculator is in degrees or radians: trigonometric functions use radians in calculus and most programming environments.

Spreadsheets are useful for data tables, parameter sweeps, charts, and simple numerical models. A robust spreadsheet should:

  • separate input, calculation, and output regions;
  • label units in headings;
  • use named or clearly referenced cells;
  • avoid unexplained hard-coded constants;
  • include checks for missing, negative, or out-of-range values;
  • display appropriate significant figures;
  • protect formulas from accidental editing;
  • record the software version and date;
  • include an independent check or balance condition.

Worked example: spreadsheet-style model

A motor position is approximated by

θ(t) = θ₀ + ω₀t + ½αt²

where θ₀ is initial position, ω₀ is initial angular velocity, α is constant angular acceleration, and t is time. Let θ₀ = 0.20 rad, ω₀ = 1.50 rad·s⁻¹, α = 0.80 rad·s⁻², and t = 2.00 s. Substitution gives

θ = 0.20 + (1.50)(2.00) + ½(0.80)(2.00)²
θ = 0.20 + 3.00 + 1.60 = 4.80 rad

The units are consistent because radians are dimensionless in SI, angular velocity has units s⁻¹, and angular acceleration has units s⁻². A spreadsheet should calculate this from cells rather than embed the four numerical values in one opaque formula. A second check uses ω(t) = ω₀ + αt = 3.10 rad·s⁻¹; the positive velocity and increasing position agree with α > 0.

5. MATLAB and Python for reproducible computation

Programming becomes valuable when a calculation is repeated, parameterised, visualised, or embedded in a larger algorithm. A minimal reproducible script should identify inputs, perform calculations in a visible order, and report units and results.

Python example:

import math

theta0 = 0.20       # rad
omega0 = 1.50       # rad/s
alpha = 0.80        # rad/s^2
t = 2.00             # s

theta = theta0 + omega0*t + 0.5*alpha*t**2
omega = omega0 + alpha*t
print(f"theta = {theta:.3f} rad")
print(f"omega = {omega:.3f} rad/s")

The corresponding MATLAB expressions are:

theta0 = 0.20; omega0 = 1.50; alpha = 0.80; t = 2.00;
theta = theta0 + omega0*t + 0.5*alpha*t^2;
omega = omega0 + alpha*t;
fprintf('theta = %.3f rad\n', theta)

Good practice includes functions for reusable operations, tests for known cases, assertions for valid inputs, comments explaining assumptions rather than repeating syntax, and version control for code and data. A random numerical simulation should record its random seed. External packages should be identified and versioned.

Numerical root finding

For an equation f(x) = 0, the bisection method begins with an interval [a,b] satisfying f(a)f(b) < 0, assuming f is continuous on the interval. The intermediate value theorem then guarantees at least one root in the interval. Repeatedly bisecting gives m = (a+b)/2 and retains the half-interval containing a sign change. After n iterations, the interval width is (b−a)/2ⁿ, so the midpoint error is at most

|x* − mn| ≤ (b − a) / 2^(n+1)

where x* is a root in the retained interval. Bisection is reliable but generally slower than Newton’s method. Newton’s iteration is

x_(k+1) = xk − f(xk) / f′(xk)

and requires a differentiable f with f′(x_k) ≠ 0. It can converge rapidly near a suitable root but may diverge, cycle, or converge to an unintended root if the initial estimate is poor. A bracketed method is often preferable when reliability matters more than speed.

6. Symbolic algebra and visualisation

Symbolic systems manipulate expressions exactly where possible. They can factor polynomials, differentiate, integrate, solve equations, and simplify expressions. For example, differentiating position gives velocity:

d/dt [θ₀ + ω₀t + ½αt²] = ω₀ + αt

Symbolic output must still be interpreted. A computer algebra system may return multiple complex roots when only real positive lengths are physically admissible. It may divide by an expression that could be zero, or simplify under assumptions that were not stated. Always inspect domain restrictions, units, boundary conditions, and special cases.

Visualisation is an analytical tool, not merely presentation. A graph can reveal discontinuities, saturation, oscillation, outliers, poor sampling, or parameter sensitivity. Graphs should include axis labels, units, an informative legend, appropriate scales, and a stated data range. Avoid truncating an axis in a way that exaggerates a small difference, and do not connect data points with a continuous curve unless the model justifies interpolation.

For sampled data at times tᵢ, a simple forward-difference estimate of the derivative is

f′(ti) ≈ [f(t_(i+1)) − f(ti)] / [t_(i+1) − ti]

This formula assumes adjacent samples are sufficiently close and that f is smooth over the interval. It is one-sided and generally less accurate than a centred difference when values on both sides are available.

7. Validation, uncertainty, and sensitivity

Independent validation

Useful validation checks include:

  • dimensional analysis;
  • substitution back into the original equation;
  • comparison with a limiting or known case;
  • comparison between hand calculation, spreadsheet, and code;
  • residual analysis;
  • conservation or balance checks;
  • comparison with experimental data;
  • sensitivity analysis.

For a computed solution x̂ to f(x) = 0, the residual is

r = f(x̂)

A small residual indicates that x̂ nearly satisfies the implemented equation. It does not prove that the equation models reality or that x̂ is accurate when the problem is ill-conditioned.

Uncertainty propagation

If a result y = f(x₁, x₂, …, xₙ) depends on measured inputs with small, independent standard uncertainties u(xᵢ), first-order propagation gives

u(y) ≈ √[∑ᵢ (∂f/∂xᵢ)² u(xᵢ)²]

This assumes a linear approximation near the measured values and negligible covariance. With correlated inputs, covariance terms must be included:

u(y)² ≈ ∑ᵢ∑ⱼ (∂f/∂xᵢ)(∂f/∂xⱼ) Cov(xᵢ,xⱼ)

For y = ab with independent uncertainties, the relative form is

[u(y)/|y|]² ≈ [u(a)/|a|]² + [u(b)/|b|]²

Worked example: sensor-derived speed

A linear encoder measures displacement d = 0.500 m with standard uncertainty u(d) = 0.002 m over t = 0.250 s with u(t) = 0.001 s. The speed is v = d/t = 2.00 m·s⁻¹. Since

∂v/∂d = 1/t, ∂v/∂t = −d/t²

independent propagation gives

u(v) = √[(u(d)/t)² + (d u(t)/t²)²]
= √[(0.002/0.250)² + (0.500×0.001/0.250²)²]
≈ 0.0113 m·s⁻¹

A suitable report is v = (2.000 ± 0.011) m·s⁻¹, if the uncertainties are standard uncertainties and the assumptions are stated. The uncertainty should not be reported with more meaningful digits than the measurement process supports.

Sensitivity analysis changes one input at a time, or uses a designed parameter study, to identify influential variables. It supports design decisions and tells an engineer where improved measurement or calibration would have the greatest benefit.

8. AI-assisted computational practice

AI systems can generate code, explain an algorithm, suggest test cases, convert pseudocode between languages, and identify possible edge cases. They are useful as assistants, not as authoritative mathematical or engineering sources. AI-generated output can contain incorrect equations, plausible-looking fabricated references, insecure code, hidden assumptions, or errors caused by ambiguous units.

A safe workflow is:

  1. State the problem, units, constraints, and desired output explicitly.
  2. Ask for assumptions and an explanation, not only a final number.
  3. Inspect every equation and line of code.
  4. Test normal, boundary, invalid, and extreme inputs.
  5. Recalculate important results independently.
  6. Compare with authoritative textbooks, standards, laboratory data, or documentation.
  7. Record the tool, model or version, date, prompt context, and human checks where institutional policy requires disclosure.

Do not paste confidential designs, personal data, passwords, unpublished research, or export-controlled information into an unapproved service. AI assistance does not transfer responsibility: the engineer remains accountable for safety, accuracy, intellectual property, and professional decisions.

9. Data protection, ethics, and governance

Computational work may involve sensor logs, production records, photographs, employee information, or customer data. Apply data minimisation: collect only what is needed, restrict access, remove identifiers where possible, encrypt sensitive files, and retain data only for a justified period. Follow applicable institutional policy and privacy, cybersecurity, intellectual-property, and safety requirements.

Ethical computational practice includes:

  • reporting failed trials and inconvenient results rather than selectively presenting successes;
  • distinguishing measured data from simulated or AI-generated data;
  • preserving raw data and documenting transformations;
  • citing algorithms, libraries, datasets, and external assistance;
  • not claiming validation when only verification was performed;
  • assessing consequences of automation, bias, and unequal error rates;
  • obtaining review for safety-critical or regulated decisions.

Governance requires traceability. A defensible computational record identifies the problem version, input data, units, code or spreadsheet, software environment, parameter values, validation tests, uncertainty, reviewer, and approval status. Reproducibility is not only a research virtue; it is a safety and maintenance requirement in engineering.

10. Applied case: validating a conveyor speed estimate

Background. An illustrative mechatronics cell uses an incremental encoder to estimate conveyor speed. The control system reports displacement every 0.10 s. A design requirement is 0.80 ± 0.02 m·s⁻¹.

Problem. At one interval, the encoder reports d = 0.081 m. The timing system reports Δt = 0.100 s. The encoder uncertainty is 0.001 m and timing uncertainty is 0.0005 s. The engineer must calculate speed, uncertainty, and decide whether the requirement is met.

Analysis. The estimate is

v = d/Δt = 0.081/0.100 = 0.810 m·s⁻¹

Using independent first-order propagation,

u(v) = √[(u(d)/Δt)² + (d u(Δt)/Δt²)²]
= √[(0.001/0.100)² + (0.081×0.0005/0.100²)²]
≈ 0.0101 m·s⁻¹

The estimate is therefore approximately (0.810 ± 0.010) m·s⁻¹ under the stated uncertainty model. The nominal value differs from 0.80 m·s⁻¹ by 0.010 m·s⁻¹, within the ±0.02 m·s⁻¹ requirement. However, a single sample does not establish long-term compliance.

Approach and validation. The engineer plots 60 s of speed estimates, checks for missing pulses, compares the encoder estimate with a calibrated tachometer, and tests the code on synthetic data with known speed. A residual plot is used for the tachometer comparison. The team also checks whether acceleration or belt slip violates the constant-speed assumption during the interval.

Outcome. The result is accepted provisionally, but the system is assigned a calibration check and a rule requiring an alarm if a rolling average or uncertainty-aware limit exceeds the specification. Raw data, software version, calibration certificate, and validation results are archived.

Learning points. The calculation is only one part of the decision. Units, uncertainty, sampling assumptions, independent comparison, and traceability determine whether the result is fit for engineering use.

11. Limitations and emerging practice

Computational methods can conceal errors at scale: a wrong spreadsheet formula may be copied into thousands of rows, and a biased dataset may produce a highly precise but misleading model. Numerical approximations also depend on sampling, discretisation, solver tolerances, and initial conditions. More decimal places do not correct a wrong model.

Contemporary practice increasingly combines digital twins, real-time data streams, automated calibration, edge computing, open-source scientific software, and machine-learning components. These developments create opportunities for predictive maintenance and adaptive control, but they increase requirements for cybersecurity, explainability, versioned models, drift monitoring, and human oversight. Engineers should ask not only whether a model predicts accurately in development, but whether it remains reliable after sensors age, operating conditions change, and data distributions shift.

Best practice is consequently conservative and evidence-based: use the simplest adequate model, expose assumptions, test failure modes, quantify uncertainty, preserve provenance, and require human review where errors can affect safety or rights.

Chapter Summary

Computational mathematics is a complete engineering activity rather than a button-pressing exercise. Reliable work defines the problem, builds an explicit model, selects a suitable tool, implements it reproducibly, verifies the implementation, validates the model, quantifies error and uncertainty, and communicates limitations. Calculators and spreadsheets are effective for transparent calculations; MATLAB and Python support reusable algorithms and simulation; symbolic systems assist exact reasoning; visualisation reveals behaviour; and AI tools can accelerate drafting while requiring rigorous human verification. Dimensional analysis, residuals, limiting cases, independent calculations, sensitivity analysis, and uncertainty propagation are central safeguards. Ethical practice requires honest reporting, data protection, intellectual-property awareness, traceability, and governance appropriate to risk.

Key Terms

Computational mathematics: Applying mathematical models and numerical methods through computational tools.

Verification: Checking that an implementation correctly solves the intended mathematical problem.

Validation: Checking that a model and result adequately represent the intended physical or operational system.

Modelling error: Error caused by simplifying or incorrectly representing reality.

Numerical error: Error introduced by finite precision, rounding, truncation, or an approximate algorithm.

Absolute error: The magnitude of the difference between an approximation and a reference value.

Relative error: Absolute error divided by the magnitude of the reference value.

Floating-point arithmetic: Finite digital representation and computation of real-number approximations.

Cancellation: Loss of significant digits when nearly equal quantities are subtracted.

Conditioning: Sensitivity of a mathematical problem to changes in its inputs.

Stability: Resistance of an algorithm to amplifying computational errors.

Residual: The value obtained when an approximate solution is substituted into an equation.

Uncertainty: Quantified limited knowledge about a measured or computed quantity.

Sensitivity analysis: Study of how output changes when inputs or assumptions change.

Reproducibility: Ability to regenerate a result from recorded data, methods, and software.

Symbolic algebra: Exact or formal manipulation of mathematical expressions.

Data provenance: Record of a dataset’s origin, transformations, and usage history.

AI-assisted computation: Use of artificial-intelligence systems to support, but not replace, engineering judgement.

Review Questions

Short Answer Questions

  1. Distinguish verification from validation.
  2. Why can displayed precision exceed actual accuracy?
  3. State two checks that can reveal an incorrect computational result.
  4. What assumptions underlie first-order uncertainty propagation?
  5. Give two risks associated with entering engineering data into an unapproved AI service.

Long Answer Questions

  1. Explain the computational mathematics workflow from problem definition through documentation, using a mechatronics example.
  2. Compare calculators, spreadsheets, Python/MATLAB, symbolic algebra, visualisation, and AI-assisted tools in terms of strengths and risks.
  3. Explain modelling, measurement, and numerical error, and show how they can interact in an engineering calculation.
  4. Derive the uncertainty expression for speed v = d/t using first-order propagation and discuss its assumptions.
  5. Discuss how reproducibility, data governance, and professional ethics apply to a safety-relevant computational model.

Analytical / Application Questions

  1. A sensor reports d = 1.250 m ± 0.005 m over t = 1.60 s ± 0.01 s. Calculate speed and its first-order uncertainty, assuming independent standard uncertainties.
  2. A Newton solver converges to a value with a small residual, but the result violates a known positive-length constraint. Analyse possible causes and propose a validation procedure.
  3. Design a reproducible spreadsheet or Python workflow for comparing a motor’s measured and simulated position over time. Specify inputs, checks, plots, uncertainty information, and documentation requirements.

Multiple Choice Questions with Answers

Question 1

Which statement best distinguishes verification from validation?

A. Verification checks the model against reality, while validation checks syntax.

B. Verification checks implementation of the intended mathematics, while validation checks adequacy for the physical system.

C. Verification estimates uncertainty, while validation converts units.

D. Verification is performed only by AI, while validation is performed only by humans.

Correct Answer: B. Verification checks implementation of the intended mathematics, while validation checks adequacy for the physical system.

Question 2

For d = 0.500 m and t = 0.250 s, the calculated speed is:

A. 0.125 m·s⁻¹

B. 0.250 m·s⁻¹

C. 2.00 m·s⁻¹

D. 2.50 m·s⁻¹

Correct Answer: C. 2.00 m·s⁻¹

Question 3

What condition is required to begin the bisection method for a continuous function?

A. f′(x) must be zero at both endpoints.

B. The endpoints must have equal function values.

C. The product f(a)f(b) must be negative.

D. The initial interval must contain exactly two roots.

Correct Answer: C. The product f(a)f(b) must be negative.

Question 4

A small residual for an approximate root primarily shows that:

A. The physical model is definitely valid.

B. The approximate value nearly satisfies the implemented equation.

C. All measurement uncertainty is negligible.

D. The algorithm is globally convergent.

Correct Answer: B. The approximate value nearly satisfies the implemented equation.

Question 5

Which practice most improves spreadsheet reliability?

A. Hiding all intermediate calculations.

B. Rounding every intermediate value to two digits.

C. Separating inputs, calculations, and outputs and labelling units.

D. Replacing formulas with manually typed results.

Correct Answer: C. Separating inputs, calculations, and outputs and labelling units.

Question 6

In the first-order charging model, what is V(0)?

A. 0

B. V_f

C. V₀

D. τ

Correct Answer: C. V₀

Question 7

For independent inputs in first-order uncertainty propagation, variances are generally:

A. Added after taking square roots of each uncertainty.

B. Added as squared sensitivity-weighted terms.

C. Subtracted to remove measurement noise.

D. Ignored when the output has many decimal places.

Correct Answer: B. Added as squared sensitivity-weighted terms.

Question 8

Which is a principal risk of unverified AI-generated engineering code?

A. It always uses too few variables.

B. It cannot produce syntactically valid code.

C. It may contain plausible but incorrect assumptions or calculations.

D. It automatically discloses all confidential data publicly.

Correct Answer: C. It may contain plausible but incorrect assumptions or calculations.

Question 9

The expression κ(x) ≈ |x f′(x)/f(x)| is used as an indicator of:

A. Data storage capacity

B. Problem sensitivity or conditioning

C. Spreadsheet file size

D. Electrical resistance

Correct Answer: B. Problem sensitivity or conditioning

Question 10

Which action best supports ethical computational practice?

A. Report only trials that support the hypothesis.

B. Remove raw data after producing the final graph.

C. Record assumptions, transformations, software versions, and failed checks.

D. Treat simulated data as measured data if the graph looks realistic.

Correct Answer: C. Record assumptions, transformations, software versions, and failed checks.

Engineering Mathematics I
Chapter 14 of 14