The linkage that is only nearly right
Assumes Where the precision points go.
Everything in this field so far has been exact. A construction, a theorem, and a linkage that satisfies its conditions to fourteen decimal places — three positions, four, five, three angle pairs. The exactness has never been the point; it has been a consequence of asking for as many conditions as there are free numbers.
Ask for fewer conditions and there is freedom left over. Ask for more and there is no solution. Ask for a range — be close everywhere, rather than exact anywhere — and the problem changes character entirely, because “close everywhere” is not a set of equations.
It is an objective, and an objective has to be chosen.
That sentence is the whole departure. Every construction in this field so far has been indifferent to preference: Burmester’s dyad condition is what it is, and two people prescribing the same three poses get the same centre-point curve. An objective is a preference, written down as a formula, and two reasonable people write down different ones. The mathematics stops being about the mechanism and starts being about what the mechanism is for.
Three linkages, one function
The same over the same range, by three routes.
The interpolant. Three Chebyshev precision points, the 3 × 3 linear solve, exact at three places. Worst error 0.2232°, root-mean-square error 0.1476°.
A least-squares fit. Minimise the sum of squared error over 121 samples across the range, by search over the three link lengths. Worst 0.3900°, RMS 0.1203°.
A minimax fit. Same search, minimising the largest error instead. Worst 0.2105°, RMS 0.1463°.
Read the rows and the pattern is immediate. Each fit wins on the measure it was given and loses on the other.
The least-squares fit is 18% better than the interpolant on RMS and 75% worse on the maximum. The minimax fit is 6% better on the maximum and slightly worse on RMS than least squares. There is no linkage here that is best at everything, and the choice between them is a choice about what “accurate” is going to mean.
The assertion that had to be rewritten
The first version of the check in the gate required the fitted linkage to beat the interpolant on the largest error. It failed.
The failure was correct and the check was wrong. The fit was minimising the sum of squares — it had never been shown the maximum, and there was no reason for it to be good at it. Asking an optimiser about a measure it was not given is asking about something it has no opinion on.
So assertEachObjectiveWinsOnlyItsOwnMeasure is now four-way, and every clause is required:
- the least-squares fit beats the interpolant on RMS;
- the minimax fit beats the interpolant on the maximum;
- the least-squares fit is worse than the minimax fit on the maximum;
- the minimax fit is worse than the least-squares fit on RMS.
The last two are what make it a statement about objectives rather than a statement that optimisation is good. Without them, one fit that happened to be better at everything would pass, and this essay’s point would be unsupported by the thing checking it.
There is a fifth clause and it is the trade the whole essay is about: the fitted linkage passes through none of the precision points exactly, where the interpolant passes through three. The check requires that too. What optimisation buys is bought with exactness, and it is worth having on the record rather than implied.
An optimised linkage has no precision points, and that is visible
The clearest way to tell the three designs apart is to count the zero crossings of the error curve.
The interpolant crosses zero exactly three times, at its three precision points, because that is what it was built to do. Each crossing is a place where the linkage is right.
Both fits cross zero more often — five or six times across the range — and none of the crossings is anywhere in particular. They are wherever the error happens to change sign, which is a consequence of the optimisation rather than a specification. A crossing of a fitted curve is not a guarantee about that input; it is the point where being slightly high turned into being slightly low.
That distinction matters when somebody later asks “at what input is this mechanism exact?” For the interpolant the answer is three specific values, known in advance and choosable. For a fit the honest answer is that the question does not apply.
What is being optimised over
Three numbers: the crank, coupler and rocker, with the ground link fixed at 1 to remove the scale.
That is a small search space and it is smaller than it needs to be. The two angle offsets — where the crank’s zero and the rocker’s zero sit — are also free, and including them would give five parameters and a better fit. They are left out here for a reason worth stating: the comparison is against a three-point interpolant, which has three free numbers, and an optimiser given five parameters against an interpolant given three is not a comparison of methods but of budgets.
The objective is the structural error over 121 samples spread evenly across the range, with a large penalty added for any sample the mechanism cannot reach.
That penalty is not a fudge. A linkage that comes apart partway through its sweep is infinitely bad at generating a function over that sweep, and an optimiser is entitled to be told so. Without it the search wanders happily into regions where the mechanism assembles at some samples and not others, and reports a small error computed over the samples that worked.
Why the optimiser has no derivative
The search is Nelder–Mead — a simplex method that only ever compares objective values and never differentiates. That is an unusual choice in 2026 and it is deliberate.
The objective here is the structural error, and computing it means solving the mechanism at 121 crank angles. At some of those angles, for some parameter values, the mechanism does not assemble. So the objective is not merely non-convex; it is not everywhere defined, and its domain has a boundary whose location is itself the answer to a nonlinear problem.
A gradient method needs a rule for what the gradient is at the edge of the feasible region, and any such rule is a piece of invention. A simplex needs no rule, because it can only compare — it moves away from bad points without needing to know why they are bad.
The cost is that it is slow and it finds a local minimum. Both are real limitations and neither is hidden: the fits above took a few hundred objective evaluations, each of which is 121 solves, and there is no claim anywhere that they are global.
What “the best” would mean
Chebyshev’s equioscillation theorem says the best minimax approximation has its error peaks all of equal height. The interpolant’s evenness — smallest peak over largest — is 0.924, and that is what Chebyshev spacing achieves without optimising at all.
The minimax fit should push it towards 1, and improve the maximum, and it does: 0.2105° against 0.2232°.
Six per cent. For an optimiser, over a search space of three numbers, with several hundred evaluations, against a choice of interpolation points made by a formula.
That is the honest headline of this essay and it points the other way from the usual one. The classical spacing gets most of the available improvement for nothing. The gap between a well-chosen interpolant and an optimised design, on this problem, is a few per cent — and the gap between a well-chosen interpolant and a badly-chosen one is a factor of three, which the previous essay measures.
An engineer’s time is better spent on where the points go than on optimising afterwards, at least at three points and on this function. That conclusion would not survive many more precision points, or a function that bends more, and it is stated as a measurement rather than as advice.
Two measures, and what each is a statement about
The choice between the sum of squares and the maximum is not a matter of taste, and it is worth setting out what each one asserts about the machine.
Least squares minimises the average of the squared error over the range. It is a statement that errors compound or accumulate — that being slightly wrong in many places is what matters — and it is the right objective when the mechanism’s output is integrated, averaged, or fed into something that smooths. It is also, not coincidentally, the objective with the best numerical behaviour: the squared error is smooth in the parameters wherever the mechanism assembles, so a search over it is well behaved.
Minimax minimises the largest error anywhere. It is a statement that there is a tolerance, and that the mechanism either stays inside it or does not. That is the shape of almost every specification a component is bought against, and it is the objective an engineer usually means by “accurate to a fifth of a degree”.
The two disagree in a predictable direction. Least squares is happy to accept a large error in a small region if that buys small errors over a wide one; minimax is not. The measurement above shows exactly that: the least-squares linkage’s worst error is 0.39° and the minimax linkage’s is 0.21°, while their average errors differ by less than a fiftieth of a degree.
Minimax is also the harder search. Its objective is the maximum of many functions, which is non-smooth wherever the argmax changes from one sample to another — the objective has corners, and a gradient method would struggle at exactly the points where the answer lives. That is a second reason the simplex method is used here, and it is the more principled of the two.
Why the fitted linkage is not the best possible
Neither fit is claimed to be the global optimum, and the reasons are worth listing because the claim is easy to make by accident.
The search is local. Nelder–Mead descends from where it starts and stops when the simplex is small. A different start would find a different minimum, and nothing here shows that any of them is the lowest.
The seed came from the interpolant. Both fits start from the Chebyshev interpolant’s link lengths, which is a sensible choice and a strong prior — it means the fits are exploring the neighbourhood of a design that already works, and the improvement measured is the improvement available near that design.
The objective is sampled. 121 points, not the whole range. A minimax fit over 121 samples is not a minimax fit over the interval, and the difference is bounded by how much the error curve can move between adjacent samples. On a curve this smooth that is small; it is not zero.
Three parameters. Adding the two angle offsets would give more room and a better answer.
Each of those would make the fits better. None of them changes the finding, which is about the relationship between the three linkages rather than about any one of them, and that relationship is forced by the objectives rather than by how well the search went.
Where the exactness went
It is worth being clear about what has been given up, because “approximately right everywhere” sounds strictly better than “exactly right in three places” and is not.
An exact precision point is a guarantee. It says that at this input, the output is this, to the accuracy of manufacture. A designer can put a precision point where accuracy matters — at a calibration value, at a range boundary, at the operating point — and know that the structural error there is zero by construction.
A fit has no such place. Its error is small everywhere and zero nowhere, and there is no input at which the designer can say the mechanism is right.
For a component that is calibrated against a standard at one point, that is a genuine loss. For a component whose accuracy matters uniformly across its range, it is not a loss at all. The two situations are common and different, and the objective should be chosen from the situation rather than from the fashion.
The penalty is doing more work than it looks
The unreachable-sample penalty deserves a second look, because it is the only place in this construction where the mechanism enters the optimisation as anything other than a function evaluator.
Without it, the search has no reason to stay in the region of parameter space where the linkage is a working machine over the whole sweep. Three positive numbers always give a four-bar; whether that four-bar’s crank can rotate through the required 90° is Grashof’s question, and it is not in the objective anywhere else.
With the penalty, that condition enters in a peculiar form: not as a constraint the optimiser knows about, but as a very large value of the thing it is minimising, sampled at the crank angles that fail. The optimiser has no idea it is respecting a classical criterion. It simply avoids a region where the numbers are bad.
That is a legitimate way to impose a constraint and it has a known weakness. A penalty region with a hard edge makes the objective discontinuous, and a simplex crossing that edge sees a step rather than a slope — so the search slows down near the boundary and can get stuck against it. A design whose optimum sits on the Grashof boundary would be found badly, and there is no reason to think that never happens: linkages that just barely rotate are often the compact ones.
Handling that properly means a constrained optimisation with the condition written out algebraically, which is a different piece of machinery than this file contains. It is named here as a limit of the method rather than left for a reader to discover from a fit that stalls.
The three-parameter search is not the interesting one
The optimisation here is small on purpose, and the version of this problem that people actually run is much larger and much harder.
A serious approximate synthesis optimises over everything: link lengths, angle offsets, the coupler point, sometimes the mapping itself — nine or more parameters — against hundreds of sampled positions, with constraints for Grashof condition, transmission angle, packaging and branch consistency. The objective is non-convex, the feasible region is disconnected, and the answer depends heavily on where the search started.
That last is the subject of the next essay, and it is where the classical constructions come back into the story: an atlas of coupler curves, or an exact synthesis through a few positions, is a very good way of producing the starting guess that a general optimiser cannot supply for itself.
The one thing that does not change with scale is the finding above. An optimiser returns the minimum of the function it was given, and the function it was given is a choice made by a person, and no amount of optimisation compensates for choosing the wrong one. Least squares and minimax differ here by a factor of two on the maximum error, on a three-parameter problem where both converged.
The three linkages each being best by a different measure is the finding, and the honest conclusion from it is one a designer has to make rather than compute. There is no linkage that is best, because best is not a property a mechanism has until somebody says which norm they are minimising — and the three norms in play here are three different engineering requirements. Least squares minimises the average departure, which is what matters when the error accumulates over a stroke. Minimax minimises the worst departure, which is what matters when a single excursion is what fails. Interpolation forces the error to zero at chosen places, which is what matters when particular positions are the ones that count. So the question which linkage is best is the question which of the errors hurts, and it belongs upstream of any synthesis. That is worth stating because approximate synthesis is often presented as producing an answer; it produces a family of answers indexed by a norm, and choosing the norm is the design decision the optimisation cannot make.
What this makes readable
Essays that name this one as a prerequisite.
- The steering that is never right Machines you have met
- Where an optimiser starts The problem backwards
About the same objects
Not linked from either essay — found by the objects both name.
- A calibration is a synthesis with more equations least-squares · structural error
- Reading a residual least-squares · structural error
- The straightest point there is precision-point · structural error
What links here
The 8 of 13 essays linking to this one that name the most of the same objects.
- Where the precision points go The problem backwards
- The steering that is never right Machines you have met
- How many points may be prescribed The problem backwards
- Prescribing a curve rather than points The problem backwards
- A demand that is an equation The curve as an equation
- A gap with corners in it Links with a width
- A sweep that missed nothing Links with a width
- Branches were components all along One path to the tool
The objects this essay names
Each one links to every other essay that touches it.
Approximate synthesisFunction generationLeast-squaresMinimaxNelder meadObjective functionPrecision-pointStructural error