A MATLAB program integrates a smooth power signal over a fixed time interval to estimate transferred energy. The program uses the composite trapezoidal rule with uniform time step hhh.
Two runs give E(0.4 s)=12.8 JE(0.4\ \text{s})=12.8\ \text{J}E(0.4 s)=12.8 J and E(0.2 s)=12.2 JE(0.2\ \text{s})=12.2\ \text{J}E(0.2 s)=12.2 J. For this calculation, assume the following error model is exact over the step sizes considered:
where E∗E_*E∗ is the underlying energy and CCC is an unknown constant shared by both runs.
Find the extrapolated estimate, the value of E∗E_*E∗ inferred by removing the modelled step-size error. Also find the absolute error of the 0.2 s0.2\ \text{s}0.2 s result and the largest positive step size predicted to keep the absolute error at or below 0.05 J0.05\ \text{J}0.05 J.
Report the extrapolated energy and absolute error in joules to two decimal places. Report the largest step size in seconds to three decimal places.
Unlock full course notes by signing up
Checking the Candidate Residual
A scalar MATLAB solver accepts a candidate only when both its absolute displacement step and its absolute force residual meet their tolerances. At iteration 4 of a maximum of 20 iterations, its variables are:
Which expression correctly sets the logical variable converged according to this requirement?
Tracing a Bisection Calibration
An engineering calibration requires the positive, dimensionless gain ggg satisfying
A MATLAB implementation uses bisection, which repeatedly halves an interval while retaining endpoints with opposite function signs. Its initial bracket is [1,2][1,2][1,2].
When a Small Residual Hides a Large Error
A displacement calibration calculation for a very soft spring uses the exact linear residual model
where xxx is in metres. A numerical solver returns an estimate x^\hat{x}x^ with signed residual f(x^)=+0.000100 Nf(\hat{x})=+0.000100\ \text{N}f(x^)=+0.000100 N. This passes its residual tolerance of 0.000150 N0.000150\ \text{N}0.000150 N.
Repairing a Length-Unit Mismatch
A nonlinear spring calculation solves
A programmer stores extension as u in millimetres, with x=u/1000x=u/1000x=u/1000 when numerical values are used. The residual calculation below correctly returns newtons, but the update mixes length units: