How many answers

Two circles, four answers

A four-bar with its crank held still is two circles, and two circles meet twice. Bézout's theorem says four. The two missing answers are not a rounding error and are not special to these link lengths — they are the same two points for every pair of circles ever drawn, and they are the beginning of a way of counting that has so far been done by hand.

Assumes Four bars and four pins.

Hold a four-bar’s crank still and ask where the rest of it can be.

The coupler pin is a fixed distance from the crank pin and a fixed distance from the far ground pivot. Two distances, two circles, and the pin is where they cross. Everybody who has ever drawn a linkage knows the answer: twice. The open configuration and the crossed one, and which of them a drawing shows depends on which one the illustrator drew.

Two circles, four answers, two of them nowhere. A four-bar with its crank held at 52° is two circles: the coupler pin is 3.5 from the crank pin and 3 from the far ground pivot. Two quadratics in two unknowns, so Bézout's number is four — and the tracker finds two. The other two paths run off to infinity, and they do so for every pair of circles ever drawn: two circles meet the line at infinity in the same two points, and those are what the fourth and third answers are.
Fig. 1 The site’s own four-bar with the crank at 52°. The coupler pin sits at one of the two crossings, and the mechanism drawn through each is a different machine with the same four lengths.

Now write the same question down as algebra. A circle is a quadratic:

(xax)2+(yay)2=b2(x - a_x)^2 + (y - a_y)^2 = b^2

Two of them, in two unknowns. And there is a theorem about how many solutions a system like that has — Bézout’s — which says the answer is the product of the degrees. Two times two.

Four.

The gap is not an error

It would be comfortable to say that two of the four are “complex” and move on, and that is not what is happening here. The two solutions the tracker finds are both real, both distinct, and both are configurations of a machine that could be built. There is no third or fourth pair of coordinates anywhere in the plane.

The two missing answers are at infinity, and they are the same two for every pair of circles that has ever been drawn.

Write a circle in homogeneous coordinates — put x=X/Wx = X/W, y=Y/Wy = Y/W and clear denominators — and the quadratic becomes

X2+Y22axXW2ayYW+(ax2+ay2b2)W2=0.X^2 + Y^2 - 2a_xXW - 2a_yYW + (a_x^2 + a_y^2 - b^2)W^2 = 0.

The line at infinity is W=0W = 0. Set it, and everything with a WW in it disappears, leaving X2+Y2=0X^2 + Y^2 = 0: the two points (1,±i,0)(1, \pm i, 0). They do not depend on the centre, they do not depend on the radius, and they do not depend on which circle the question started from. Every circle passes through both of them.

So two circles always share those two points, always meet in four, and always have exactly two crossings left over for the plane. The four-bar’s two assemblies are what is left of Bézout’s four after the geometry of circles has taken its cut.

That is a satisfying enough story on its own. What makes it worth a field is that the same accounting runs all the way up, and above the four-bar nobody can do it in their head.

What the count is a property of

Here is the part that changes how the rest of this site should be read.

Bézout’s number depends on the degrees of the equations and on nothing else. Not the link lengths, not the crank angle, not whether the mechanism is any good. Change every number in a four-bar and the system is still two quadratics in two unknowns, so it still has four solutions counted properly, and still two in the finite plane.

The count is a property of the family, not of the member.

This is not how the subject usually talks. A four-bar “has two assembly modes”; a planar three-legged platform “has up to six”; the Gough platform “has forty solutions”. The phrase up to is doing a great deal of work in the middle one, and it is worth pulling apart, because there are two different numbers hiding under it.

The complex count is fixed. Every member of the family has it. It does not move when the lengths move.

The real count is not. How many of those solutions have no imaginary part is a property of the particular member, and it changes — discontinuously — as the lengths change. Two solutions that were real can meet and become a complex conjugate pair, and at the instant they meet the mechanism is at a singularity.

The four-bar is the case where both halves are visible at once. Take the crank round and the two crossings of the circles approach each other, meet, and vanish — and the configuration where they meet is the toggle, which this site has already spent an essay on without ever saying that it is a discriminant going to zero.

That is what a toggle is, algebraically. The quadratic that decides where the two circles cross has a discriminant, the discriminant is a polynomial in the link lengths and the crank angle, and it is zero exactly at the toggles. Above it two real answers; below it none; on it, one answer of multiplicity two.

An angle has to stop being an angle

None of this works until the equations are polynomials, and a mechanism’s natural description is not polynomial. A crank at angle θ puts its pin at (acosθ,asinθ)(a\cos\theta, a\sin\theta), and cos\cos is not a polynomial in anything.

There are two standard repairs and the choice between them is a real decision.

The tangent half-angle substitution puts t=tan(θ/2)t = \tan(\theta/2), so that cosθ=(1t2)/(1+t2)\cos\theta = (1-t^2)/(1+t^2) and sinθ=2t/(1+t2)\sin\theta = 2t/(1+t^2). One unknown per angle, and after clearing the denominators everything is polynomial. It is the compact choice, it is what most of the literature uses, and it has a defect that matters here: tt runs off to infinity at θ=π\theta = \pi. A configuration with the crank pointing backwards is not a configuration the substitution can express, and a four-bar spends a good deal of its turn near it.

The other repair costs an unknown and loses nothing. Replace θ by the pair (c,s)(c, s) and add the equation c2+s2=1c^2 + s^2 = 1. A point on a circle is a perfectly good algebraic object; it is only the parameterisation of the circle by an angle that is not. Every planar system in this field does it that way, and the price is exactly one extra unknown and one extra quadratic per angle — which is why the three-legged platform has four unknowns rather than three, and why its Bézout number is sixteen rather than eight.

Paying that price is what makes the number honest. A count that silently excluded θ=π\theta = \pi would be a count of the configurations the coordinates could name.

Every path, in the plane of one unknown. The 4 tracked paths of the four-bar coupler pin, projected onto the complex plane of Bx. Each curve starts at a solution of the start system and ends at a solution of the target or leaves the frame on its way to infinity. This run is γ random, start constants complex, and it found 2 solutions.
Fig. 2 The four-bar’s four paths, drawn in the complex plane of the coupler pin’s x coordinate. Two settle onto real values — the two crossings — and two leave the frame. Nothing about a path’s early behaviour says which it will be.
Every path, in the plane of one unknown. The 16 tracked paths of the 3-RPR platform, projected onto the complex plane of x. Each curve starts at a solution of the start system and ends at a solution of the target or leaves the frame on its way to infinity. This run is γ random, start constants complex, and it found 6 solutions.
Fig. 3 The same machinery on a system with more of everything. The paths that arrive are the answers and the ones that leave are the over-count, and the ratio between them is worse here than on the four-bar.

The same question arises in space and has a third answer, because a rotation in three dimensions is worse than an angle. The Gough platform’s equations use a quaternion, and the reason is the same one: a quaternion’s entries are coordinates on a sphere, and a sphere is algebraic where a set of three Euler angles is not. That choice has a consequence the essays in this field keep running into, which is that a quaternion and its negative are the same rotation — so every pose of the platform appears twice in the algebra, and the raw counts here are all even for a reason that has nothing to do with mechanisms.

What became of Bézout's paths. four-bar coupler pin: 2 of 4 paths arrived at a solution and 2 went to infinity; 3-RPR platform: 6 of 16 paths arrived at a solution and 10 went to infinity. The surplus is not merely wasted — it is cheap: a path on its way to infinity is abandoned in a handful of steps, while every path that arrives is tracked in full.
Fig. 4 The four-bar’s four paths and the planar platform’s sixteen, with the fraction that arrives at a solution. Half and three eighths — the losses are structural rather than a matter of luck.

Newton cannot count

Every solver on this site until now has been Newton–Raphson, and it is worth being precise about what Newton is and is not for.

Newton is given a configuration near the one wanted and driven to a residual of 101510^{-15}. It is fast, it is exact to the last bit, and it is completely uninterested in how many other answers there are. Give it a different starting guess and it lands somewhere else, or on the same place, and it will not say which.

That gives the site a way of counting that it has actually used: start Newton from a great many guesses and see how many distinct places it lands. lib/parallel.js does exactly this for the Gough platform, from four hundred starting poses, and it is scrupulous about what the result is — the docstring calls it “a lower bound found by search” and says so everywhere the number appears.

A lower bound is the right description and it has a property that is easy to miss: it looks exactly like an answer. Run the search with ten times as many starts and it returns the same number. That is what a complete search looks like. It is also what a search looks like when the next solution’s basin of attraction is too small to hit.

There is no experiment available to the search that distinguishes the two.

That is worth dwelling on, because the search is not a bad method and this is not a criticism of it. Starting Newton from many guesses is fast, it is trivially parallel, it needs no theory beyond the solver already written, and — as the last essay in this field shows — on the platform this site draws it happens to give the right answer. What it cannot do is report its own completeness, and completeness is the entire content of a count. A method that answers “at least six” when asked “how many” has answered a different question, and the difference only becomes visible when something else answers the original one.

The same shape of problem turns up whenever a number is obtained by looking rather than by construction. A sweep that finds the mechanism assembles at every one of 360 sampled crank angles has not shown that it assembles at every angle; it has shown that 360 particular ones work. A survey that finds no counterexample has found no counterexample. Most of the time the distinction is pedantic and occasionally it is the whole story, and there is no way to tell which case is which from inside the survey.

What this field is going to do about it

The rest of this field replaces the search with something that cannot be incomplete.

The method is homotopy continuation, and the idea is one sentence: take a system of the same shape whose solutions can be written down, deform it into the one at issue, and follow every solution as it moves. Each one arrives somewhere — at a solution, or at infinity — and a run that begins with all of them ends with all of them.

For the four-bar that machinery is comic overkill, and that is exactly why it is where the field starts. The answer is known. Two circles meet twice, and the closed form is one square root. So the four-bar is the only system here whose right answer is available on paper, and therefore the only one that can catch the machinery being confidently wrong.

It is checked that way. assertFourBarHasTwoAssemblies tracks all four paths, keeps the two that arrive, and compares them against the circle–circle intersection computed directly. They agree to 4.4×10164.4 \times 10^{-16} — which is the last bit of a double — and the two paths that do not arrive leave for infinity, as the circular points require.

What became of Bézout's paths. four-bar coupler pin: 2 of 4 paths arrived at a solution and 2 went to infinity; 3-RPR platform: 6 of 16 paths arrived at a solution and 10 went to infinity; Gough, generic: 80 of 1458 paths arrived at a solution and 1378 went to infinity. The surplus is not merely wasted — it is cheap: a path on its way to infinity is abandoned in a handful of steps, while every path that arrives is tracked in full.
Fig. 5 What became of the paths, for three systems of increasing size. Half the four-bar’s leave. Ten of the platform’s sixteen leave. Of the Gough platform’s 1,458, thirteen hundred and seventy-eight leave.
The twelve that were at infinity, coming back. Every solution of the platform's direct kinematics, plotted by how far from the origin it sits, as the six anchors are jittered. At no jitter the site's own platform has 56 solutions and the largest is at 25.8. At a jitter of 0.2 there are 80, and the extra ones arrive from far out — they were never missing, they were at infinity.
Fig. 6 Where the solutions at infinity go when the system is jittered. They come back with finite norms, which is the evidence that they are artefacts of the formulation rather than answers the mechanism has.

The over-count gets worse, quickly

Look at the second row of that figure and the case starts to be less comfortable.

A planar three-legged platform — three actuated legs of prescribed length, one moving triangle — is written with four unknowns: where the platform is, and the cosine and sine of how far it has turned, with c2+s2=1c^2 + s^2 = 1 as the fourth equation. Four quadratics. Bézout says sixteen.

The answer is six. Ten of the sixteen paths run off to infinity.

And by the time the same accounting reaches the six-legged platform in space, Bézout’s number is 1,458 and the answer is 80. Eighteen paths tracked for every solution found.

Two things follow, and they pull in opposite directions.

The first is that Bézout’s number is a bad estimate. It is a bound and it is nowhere near tight, because it counts intersections in a projective space where mechanisms do not live. Every structural fact about the equations — that they are circles, that a rotation matrix is orthogonal, that an angle appears only through its cosine and sine — is a fact Bézout does not know, and every one of them takes solutions away to infinity.

The second is that the surplus is cheap. A path on its way to infinity announces itself within a few steps: its coordinates grow, and there is no reason to keep following. Tracking 1,458 paths to find 80 solutions sounds eighteen times as expensive as tracking 80, and it is not, because 1,378 of them are abandoned almost immediately. On the Gough platform the whole complete run takes three and a half seconds.

That measurement matters more than it looks, and the essay on the paths that leave is about it, because the obvious optimisation turned out to be slower than the thing it was optimising.

Where this sits relative to the rest of the site

Nothing in this field replaces the solver. A figure of a mechanism is still a solved configuration, and it will go on being one: drawing a four-bar needs coordinates, and coordinates come from Newton.

What the field adds is a different question asked of the same equations. The solver answers where is it. This answers how many are there, and those turn out to be questions with different instruments, different failure modes and — the point of the whole field — different standards of proof.

The three consequences it will reach, in order:

  • A mechanism family’s complex solution count is fixed and its real count is not, so the number of ways a machine can be put together is a property of its dimensions rather than of its design. The count that does not move measures this over 676 sets of leg lengths for one platform.
  • The platform this site has been drawing since the parallel field is not a general one, and does not have the forty poses its own library quotes. It has twenty-eight, and the missing twelve are at infinity, where a special architecture keeps them.
  • The sixteen was right. The lower bound the site has been careful to label as a lower bound turns out to be the exact answer, and nothing available to the search could have said so.

Only the second of those is a correction. The other two are the same fact from opposite sides: a number nobody can check is not made trustworthy by being correct.

Two circles, four answers, two of them nowhere. A four-bar with its crank held at 138° is two circles: the coupler pin is 3.5 from the crank pin and 3 from the far ground pivot. Two quadratics in two unknowns, so Bézout's number is four — and the tracker finds two. The other two paths run off to infinity, and they do so for every pair of circles ever drawn: two circles meet the line at infinity in the same two points, and those are what the fourth and third answers are.
Fig. 7 The same four-bar with its crank near the other end of its turn. The two circles still cross twice, and the two crossings have moved towards each other — the configuration where they meet is the toggle.

The honest limit of the method

Homotopy continuation is numerical, and it is worth stating plainly what that costs before the field leans on it.

Every path is followed by taking steps and correcting with Newton at each one. A step too large lands nearer some other solution’s path, the corrector converges to that one, and two paths have been merged — one solution counted twice and one lost. Nothing about the arithmetic complains: the endpoint is a genuine solution of the target system, refined to 101310^{-13}, and it is simply the wrong one.

There is no certificate here that this has not happened. What there is instead is redundancy, and this site’s usual habit of two routes:

  • Bézout’s number is known in advance, so every path is accounted for. Each one converges, or leaves, or fails, and the three add to the number that was started with.
  • A symmetry the system is known to have must appear in the answer. The Gough platform’s equations are written in quaternions, and a quaternion and its negative are the same rotation — so every solution must come with its own negative, and the count must be even. That check has already caught a lost path: a run that returned 79 returned an impossible number, and 79 looks like a number.
  • And the answer is compared against a second, quite different method, which is where monodromy comes in, along with the discovery that it is the unreliable one.

None of that is a proof. It is the ordinary situation of this site — a claim with a test it could fail — applied to a claim about counting, which is the one place where being nearly right is not a smaller version of being right.

The four-bar has two assemblies. It is the last number in this field that anybody will be able to check by looking.

The over-count getting worse quickly is the reason this field exists, and it is worth putting the general shape of it in one place. A bound over the complex numbers is easy and a count over the reals is not. Bézout’s theorem gives a number from the degrees alone, in a line of arithmetic, and it is right about the complex solutions; how many of them are real depends on the coefficients, changes as the mechanism moves, and cannot be read off any degree. So the field’s whole difficulty is the gap between those two, and every instrument it builds — homotopy continuation, monodromy, root counts — exists to close it. That is worth knowing before reading further, because it says which numbers in this field are cheap and which are expensive: the bound is free and the count is the work, and a paper quoting the first as though it were the second has quoted the easy half.

What this makes readable

Essays that name this one as a prerequisite.

About the same objects

Not linked from either essay — found by the objects both name.

What links here

The 8 of 15 essays linking to this one that name the most of the same objects.

The objects this essay names

Each one links to every other essay that touches it.

Assembly branchBezoutCircular pointsComplex solutionFour-barKinematic solveLoop closurePolynomial system