Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Steps near a saddle

The question. What should Newton’s method do when the stiffness matrix is not positive definite?

Finding the shape that balances fitted a bowl to the energy at the present shape and stepped to the bottom of it. That works when the energy curves upward in every direction. A body of tissue that is squeezed, twisted or pushed far from its balance can have an energy that curves downward in some direction, and then the fitted shape is not a bowl and has no bottom. The simulator meets such shapes in most of its steps, so the choice of what to do there decides how fast it finds a balance, and sometimes which balance it finds.

By the end you will be able to say why Newton’s step can point uphill, work out by hand the step of each of three cures for a small example, and say what each costs and which balance it leads to.

When the bowl is a saddle

In many directions at once, the energy near the present shape is copied by the quadratic of Finding the shape that balances:

In words: the change of energy for a move of the nodes is, nearly, the slope times the move plus half the move’s curvature. Here is the gradient, the unbalanced forces with their sign reversed, in newtons, and the stiffness matrix, in newtons per metre. The curvature along a direction is : how fast the slope changes for each metre moved that way. is positive definite when that curvature is positive in every direction.

Newton’s step is the move that makes the slope of zero:

When is positive definite this is the bottom of a bowl, and the step goes downhill: its slope is negative. When curves downward in some direction the same equation still has a solution, but it is the centre of a saddle, a point that is lowest along some directions and highest along others, like the middle of a horse’s saddle or a pass between two hills. Newton’s step then goes towards that centre, and in the directions where the saddle is highest that is uphill.

A shape where the forces balance can itself be a saddle. It is a balance, but not a stable one: the smallest push along a downward direction lets the body roll away, as a pencil stood on its point is balanced and falls. A shape is a stable balance when its forces balance and its stiffness is positive definite.

Three cures

Repair each brick

The cure the simulator uses by default, introduced in Finding the shape that balances, repairs the matrix brick by brick: each brick’s own stiffness has its downward curvatures set to zero, and the repaired bricks are added up. A sum of bricks none of which curves downward cannot curve downward either, so the step from the repaired stiffness always points downhill (Teran et al. 2005, sections 3 and 5). The same authors note that the repair “only alters individual steps towards a minimum of the strain energy and not those minima themselves”. A variant takes the size of each downward curvature instead of setting it to zero; it changes one line of the repair (Chen et al. 2024).

The cost is speed near the answer. A brick’s own stiffness can curve downward even in a body at a stable balance, which its neighbours hold steady; in the squeezed column of the laboratory below it does. There the repaired matrix is not the true one, and each step solves the wrong equation by a little. Newton’s method doubles its correct digits at each step only when the matrix is the true stiffness. With the repaired one it gains a fixed number of digits each step instead, which is called linear convergence (Longva et al. 2023, section 4.1).

Shift the whole matrix

The second cure adds a shift: the same stiffness , in newtons per metre, added to every free coordinate:

In words: pretend every coordinate is also tied to where it is by a spring of stiffness . is the identity matrix. A shift raises the curvature along every direction by exactly , because . If curves downward by at most along any direction, any shift larger than makes the shifted matrix positive definite, which is proved in the appendix of proved properties.

Nobody knows in advance, but Cholesky factorisation says whether a guess was large enough: it fails exactly when the matrix is not positive definite. The simulator’s shifted step tries the exact stiffness first. If that fails it tries a shift of 1 N/m, then four times as much, and so on until the factorisation succeeds. After a step that the line search took in full, it lowers the shift fourfold for the next step, and drops it once it is below a sixteenth of the first.

Near a stable balance the exact stiffness factorises, no shift is used, and the steps are Newton’s own: the doubling of digits comes back. Each failed try costs a factorisation, and a large shift makes the step short, so the shift is no better than the repair far from the answer, only near it.

Trust only a short step

The third family of cures limits the step’s length to a radius in which the quadratic is trusted to copy the energy, and takes the best step within that radius. Along a direction in which the quadratic curves downward, the best step inside the radius runs to its edge: a trust-region step follows the downward curvature instead of discarding it. The conjugate-gradient method of Solving many equations at once can find such a step approximately, without factorising anything (Steihaug 1983, abstract). A recent variant borrows the trust region’s test instead: at each step it chooses how strongly to repair the bricks by how well the last step’s quadratic predicted the energy (Chen et al. 2024, section 4). The simulator does not take trust-region steps.

The mass term of a time step

One more matrix has the same effect as a shift. When the tissue has mass and each time step is solved as a minimisation, the step’s energy gains a term for the inertia of the nodes, and the stiffness gains the mass of each node divided by the square of the time step, . If every node’s mass is at least , this works like a shift of at least , and once that exceeds the matrix is positive definite; that too is proved in the appendix. For the arm’s bricks of 8 mm and steps of 5 ms it is about 20 N/m for each node.

A worked example

Two coordinates, two bricks. The first brick’s stiffness is : it curves downward along the second coordinate. The second brick’s is . Their sum is , which curves downward by 2 N/m along the second coordinate. The gradient is N.

CureMatrixStep Slope Change of
None
Repair each brick
Shift by 4 N/m

Here is the matrix with and on its diagonal and zeros elsewhere, and the last column is the quadratic of the true along each step. To check the first row: . Its slope is positive, so the step goes uphill, and even the quadratic it was made from rises by 0.75 along it: Newton’s step has gone to the top of the saddle along the second coordinate.

For the shift, the first try, , gives , which still curves downward, and its factorisation fails. The second, , gives , which factorises. Its step is .

Both cures point downhill, and they point in different directions. The repair sees along the second coordinate only the second brick’s curvature, 1 N/m, and steps twice as far that way as the shift does. From the same shape they lead the search along different paths.

Close to a balance

Near a stable balance the exact stiffness is positive definite, and the cures differ in what they leave of Newton’s method.

  • Shift: none is needed, and the steps are Newton’s. The unbalanced force falls as it did in Finding the shape that balances, each step squaring the error: , , .
  • Repair: if any brick still curves downward, the repaired matrix differs from the true one by that brick’s repair, and the error shrinks by about the same factor every step.
  • Mass term, used only to make the matrix factorise: the matrix differs from the true one by in every coordinate, and the error shrinks by the same factor every step. That factor is close to 1 along a direction of small stiffness, so the mass term is slowest of all where the body is softest.

A different path, a different balance

A body can have more than one balance, as Finding the shape that balances noted, and the path a search takes decides which it reaches. The laboratory below shows the simplest case. A column of tissue squeezed between two plates stays straight at first. Squeezed past a certain share of its height, the straight shape is still a balance but a saddle, and two stable balances appear beside it, the column bowed to one side or to the other. A search started from a nearly straight column can end in any of the three, depending on how it steps.

The same holds on the arm, less visibly. Two ways of choosing the steps reached balances of the 2 kg curl that differed by up to 0.13° at the elbow and by millimetres in the muscles’ surfaces: each was a balance, and the arm has more than one near its starting shape.

What the arm’s searches do

The simulator’s own measurements of its searches on the arm, through the whole curl of a 2 kg weight, with the tissue solved as it was before it was given mass and with the repaired stiffness as the cure:

  • The balances are minima. Of 38 balances probed, 36 had a positive definite exact stiffness; the other two needed a shift of under 0.1 N/m, a nearly flat direction rather than a saddle.
  • The repaired stiffness carries most steps. 72 % of the Newton steps used it, because the exact stiffness failed to factorise; in a later count, between 68 % and 78 % did. Most of the failures came far from a balance: 62 % of them with more than 10 N unbalanced, where the tolerance is 10 mN.
  • The mass term of a 5 ms step would not cure them. Added to the failed matrices, it made only 3.6 % of them positive definite: their downward curvature is far larger than 20 N/m.
  • Shifting is not faster over the whole curl. Over the curl’s first 12 steps, a shift that starts each time from a quarter of the last one that worked was estimated, from counts of the solver’s work, to take 0.74 of the time; over the whole curl it took 1.17 times as long, and reached a slightly different balance.
  • The slow finish. About half of the Newton steps start with less than 1 N left unbalanced. Only 16 % of them start from a shape that a contact point entering or leaving contact had just produced, so it is not the switching of contact that slows the finish.
  • Nor is it the repair. With a shift that shrinks with the unbalanced force, 100 N/m times the force as a share of the search’s first, and a few conjugate-gradient iterations on the exact stiffness after it, the repaired stiffness was used in a sixth of the Newton steps instead of nearly three quarters. The curl then took 2,543 Newton steps begun below 1 N, against 2,542 with the repair: the slow finish stayed. In the middle such step the shape was still 1.7 mm from where its search ended. The steps were accurate in energy, but moved nodes 0.1 to 2 mm for less than 1 N of force, and the force left after a full step grew with the step’s length. A third of them were in searches that had halved a move of the bones after a first search failed. Of these steps with the shift, 12 % followed a contact switch.

What the arm’s searches meet near the balance is a landscape nearly flat in some directions, where a small force is worth millimetres, not a fault of the repair. So the simulator’s arm now takes the shifted step with the conjugate-gradient refinement in every search, and the repaired stiffness only when the shifted matrix still fails to factorise. It also stops a search sooner than the force test alone would. Once the largest unbalanced force is below 1 N, a search may stop when the step it has just found promises to lower the potential by less than J, provided no node is still pushed by more than 1 % of the pull of the weakest active muscle, about 0.14 to 0.5 N in the curl. Measured on twelve steps of the curl, this energy test saved a third of the Newton steps of the time steps and cost 18 % more while the arm was first turned to its starting pose, for answers within 0.0001° and 0.004 N·m of the force test’s.

Try it: a column that bows

The column is 48 mm tall and 12 mm square, of relaxed tissue, glued to a plate at each end. The straight squeezed column is balanced first, then the search starts from it bent sideways by 0.2 mm at its middle. Each press of Step is one Newton step with the stiffness chosen.

  1. Start. The column is squeezed by 25 %, past the point where it can stay straight, and each step uses the repaired stiffness. Press Play. The search ends bowed 9.99 mm sideways, after 65 steps. On the plot the force first rises, as the column bows out, then falls by about the same factor at each step.
  2. Predict, then check. Choose the shifted stiffness. It ends at the same bow in 31 steps, and its last three steps take the force from to to newtons: the doubling of digits.
  3. No repair. Choose the exact stiffness with no repair. In 5 steps it reaches a balance: the straight column. The notice says it is a saddle, and the readouts say the exact stiffness is not positive definite there. The search has found a balance that no real column would stay in.
  4. The mass term. Choose the mass term of a 5 ms step. Every matrix factorises, yet the search takes 110 steps to the bowed balance.
  5. Predict, then check. Squeeze by 15 %, where the straight column is stable. Which cures will find it fastest? The shift and the exact stiffness take 4 steps, the same steps, since no shift is needed. The repair takes 23, although nothing here is a saddle: some squeezed bricks still curve downward, and repairing them slows the finish. The mass term takes 77.
  6. Find the bowing point. Step the squeeze up from 18 %. Up to 20 % the straight column is stable; at 21 % it is not, and the search bows by 3.6 mm. Near that point the repaired stiffness needs more than 200 steps at 20 % and 21 %, and the shifted one 9 and 33: close to bowing, one direction is nearly flat, and a method that converges by a fixed factor crawls along it.

What this model leaves out

  • Trust regions. The simulator does not take trust-region steps; only the idea is described here.
  • Contact. Bodies that touch switch contact points on and off between steps, which changes the energy the search follows; Tissues that touch treats contact.
  • Real inertia. The mass term here only reshapes the matrix; the forces are those of a balance. A time step in which the tissue’s mass also moves it is another problem with another answer, begun in Stiff equations and implicit steps.

Summary

  • Newton’s step solves . When curves downward in some direction, that step heads for a saddle and can go uphill.
  • Repairing each brick always gives a downhill step and keeps the balances, but near a balance it converges only linearly.
  • Shifting the whole matrix by until it factorises also gives a downhill step, and near a stable balance it becomes Newton’s step again. A shift, or a time step’s mass term , larger than the worst downward curvature always makes the matrix positive definite.
  • Different steps can lead to different balances; one of them may be a saddle.
  • On the arm the balances are minima. The slow finish near them comes from nearly flat directions, not from the repair: it stayed when a fading shift replaced the repair, which the arm now uses, with a stop on the energy a step would still gain.

Next: each of these steps still needs its equations solved, and factorisation grows costly as the bricks get smaller; the next chapter builds an iterative solver meant to take over: Pressure as an unknown, and multigrid.