Numerical methods: the slope is the contract
הוצג| English | משמעות |
|---|---|
| Euler method | the first-order stepper: y next equals y plus h times the slope here |
| trapezoidal rule/ˈtræpɪzɔɪdl ruːl/ | the order-2 integrator: half h times the sum of the panel's two ends |
| Simpson's rule | the order-4 integrator: h over 3 times ends plus four middles plus twos |
| round-off error | floating-point noise per operation, accumulating as steps multiply |
| truncation error | the error of the method's own approximation, falling as h to the order |
When no closed form exists
- The real rig has a nonlinear damper and a clipped floor input. Everything after "no closed form" is this unit: approximating honestly, and knowing the cost.
- Three instruments: the Euler method 欧拉法 (order 1), the trapezoidal rule 梯形法则 (order 2), Simpson's rule 辛普森法则 (order 4).
The slopes are the contract
- Measured on y' = -y and on the integral of e^x over [0,1]: Euler errors 4.0e-2, 1.9e-2, 9.4e-3 (halve h, halve the error); trapezoid 8.9e-3, 2.2e-3, 5.6e-4 (quarter it); Simpson 3.7e-5, 2.3e-6, 1.5e-7 (sixteenth it - measured 15.9).

Which method, which order?
Route each instrument to its measured slope.
Euler errors at h = 0.2, 0.1: 4.0e-2 and 1.9e-2. The error at h = 0.05 (two significant figures)?
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
Order 1: halve h, halve the error.
Trapezoid 1.04e-2 at h = 1/4. At h = 1/8?
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
Order 2: quarter it.
Match method to order and behaviour.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
Three slopes and one floor.
Choose h with evidence
- Budget 1e-4 over one second: Euler needs h ~ 1e-4 (10,000 steps); a fourth-order stepper needs h ~ 0.1 (ten steps).
- Push Simpson to a million panels and the error stops falling: round-off error 舍入误差 accumulates ~1e-16 per step - the U-curve's floor is real.
Simpson 2.4e-5 at h = 1/4. At h = 1/16 (two significant figures)?
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
Two halvings: 2.4e-5 / 256.
Pushing Simpson to a million panels, the error stops falling because:
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
The U-curve floor: truncation falls, round-off rises.
Three numerics slips
- Reporting a result without its error estimate.
- Assuming smaller h always helps. It helps until round-off wins.
- Validating against the same physics you encode. Validate on a closed form first.
A 1e-4 budget over one second needs which h for Euler (error about 0.19h)?
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
The budget and the slope fix h; a fourth-order method gets there in ten.
Validate a solver against a closed-form case before trusting it on the real physics.
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
e^-t and pi are this unit’s witnesses.
A numerical result without an error estimate is finished work.
רמת קושי 1/5 · 100 מטבעות + בונוס קטן בהשלמה הראשונה היום
It is a number; the estimate makes it a result.
Recap
- Euler O(h); trapezoid O(h^2); Simpson O(h^4) - measured, not memorised.
- Read h off the budget and the slope; say so in the report.
- Truncation error 截断误差 falls, round-off rises: the U-curve is the whole story.