Solving many equations at once
The question. A muscle cut into bricks has thousands of corners, and every one of them moves in every Newton step. How are thousands of equations solved together, and why does soft tissue make them slow?
Finding the shape that balances reduced a deformable body to a loop: guess a shape, work out the unbalanced force on every corner, and solve for the move that would cancel it if every force changed in simple proportion to the moves. That last instruction hides almost all the computing time of a tissue simulation. This chapter opens it up.
By the end you will be able to solve a pair of equations three ways by hand, say why the equations of a body of bricks are mostly zeros, predict how the work of an iterative solver grows as tissue is made harder to squeeze, and say which solver the simulator uses where.
The equations
Each Newton step asks for the solution of
Here is the list of unknowns, the move of every free corner along x, y and z, in metres. The list holds the unbalanced force on each of those coordinates, in newtons. The matrix is the stiffness matrix of Finding the shape that balances: its entry in row and column says how much the force on coordinate changes for each metre that coordinate moves, in newtons per metre. In words: find the moves that, through the stiffness of the body, produce exactly the forces that are missing.
These are linear equations: each unknown appears multiplied by a fixed number, and nothing is squared or put through a curve. A block of 8 × 8 × 16 bricks has 1377 corners. With three of its faces resting against smooth surfaces, as in the second laboratory below, it has 3744 unknowns, and so 3744 equations.
The matrix has two properties that every method below leans on.
It is sparse. A sparse matrix is one in which almost every entry is zero (Driscoll and Braun, section 8.1). The force on a corner depends only on the bricks that touch it, so its equations mention only that corner and the corners it shares a brick with: itself and at most 26 neighbours. Each row of therefore has at most entries that are not zero, out of 3744. Each corner talks only to its neighbours, however large the body.
It is symmetric, and at a balance it is positive definite. A symmetric matrix is one whose entry in row , column equals its entry in row , column . Here that says the force on corner from moving corner equals the force on from moving , and it holds because both come from one stored energy. A symmetric matrix is positive definite when every possible move costs energy: the dot product , taken over all the entries of the two lists, is positive (Driscoll and Braun, section 2.9). A body at a stable balance has this property: pushing it any way at all stores energy.
Solving by elimination
The method learned at school is elimination: use one equation to remove one unknown from all the others, repeat until one equation in one unknown is left, then work backward. Its cost for a full matrix of equations is about multiplications and additions (Driscoll and Braun, theorem 2.5.9), and about half that when the matrix is symmetric and positive definite, where the method is called Cholesky factorisation (Driscoll and Braun, section 2.9). A factorisation is an elimination carried out once and kept, so that the same matrix can be used again with a new right-hand side for little further work.
For 3744 unknowns, a third of is operations. Make the bricks half the size and there are eight times as many unknowns and 512 times the work. A full matrix is hopeless.
A sparse one is not, because eliminating an unknown changes only the equations that mention it. Picture a chain of beads on a string, each tied to the next. The first bead appears in two equations, its own and its neighbour’s. Removing it changes one equation and creates no new tie. So does removing the second, and the whole chain is done in a number of operations in proportion to its length and not to its cube. The factors of a matrix whose entries lie in a narrow band about the diagonal stay inside that band, and the work is in proportion to the number of equations times the square of the band’s width (Driscoll and Braun, section 2.9).
The danger is the opposite case. Take a hub tied to four beads that are not tied to each other. Eliminate the hub first, and its equation is added into all four of the others: each bead’s equation now mentions every other bead, and twelve entries that were zero no longer are. Eliminate the four beads first and the hub last, and no new entry appears at all. New entries made by elimination are called fill-in (Driscoll and Braun, section 8.1), and the factors of a sparse matrix usually have many more entries than the matrix itself (Shewchuk 1994, section 1). How many depends on the order in which the unknowns are removed.
A sparse factorisation therefore begins by choosing its order. The library the simulator uses on the desktop picks, at each stage, an unknown with few remaining ties (faer, the default ordering of its sparse Cholesky factorisation). For the block of 3744 unknowns the whole solve then takes about three hundredths of a second on a desktop computer. The other common order, nested dissection, cuts the mesh in two by a plane, orders each half the same way, and removes the plane’s unknowns last. On the nine slender bodies of the arm built of tissue it gave factors with 2.1 to 3.8 times as many entries and took 5.8 times as long to factorise: a plane across the arm cuts through every body lying side by side, and its unknowns become one dense block.
Cholesky factorisation has one more use. It breaks down, by meeting the square root of a negative number, exactly when the matrix is not positive definite (Driscoll and Braun, section 2.9). The simulator treats that failure as information: the present shape is not near a stable balance, and the Newton step needs the care described in Finding the shape that balances.
Fill-in in three dimensions
A chain of beads makes no fill-in in any order that follows the chain. A block of bricks is not a chain, and however its unknowns are ordered, elimination fills in. How much decides how small the bricks can be made.
Here is one good order, worked out for a cube of corners, along each edge, so corners in all. Cut the cube in half by the plane of corners across its middle, of them, and number those corners last. Nothing in one half touches the other half except through the plane, so the two halves can be eliminated without ever creating an entry that ties them together. Do the same inside each half, and inside each quarter, and so on. This order is called nested dissection, and its cutting planes are its separators. It was devised for meshes of squares (George 1973, abstract) and later generalised to other meshes (Lipton, Rose and Tarjan, listed as a lead; only their paper’s bibliographic record was checked for this book).
The work is set by the first plane. By the time its corners are reached, eliminating the two halves has tied every one of them to every other, so their equations form a full matrix of rows. A full matrix of rows costs about a third of operations to factorise and keeps about half of entries:
In words: for a block of bricks, the work of factorisation grows as the square of the number of unknowns, and its memory as the four-thirds power. The planes that cut the two halves add less: each has half as many corners as the first, and so an eighth of its work, and there are only two of them. Each later round adds less again. For a mesh of squares the same argument gives a separator of corners and work in proportion to , the result George found. In three dimensions the separators are planes, not lines, which is why a block fills in so much more than a sheet.
Making the bricks half the size puts eight times as many unknowns in the same body. The work of building the matrix, one brick at a time, grows eightfold too; the work of factorising it grows about 64-fold.
The simulator was timed on a block of muscle 40 × 40 × 200 mm, about the size and slenderness of the biceps, held at both ends, on one thread of a desktop computer, with its own factorisation:
| Brick size | Free coordinates | Building the exact stiffness | Factorising and solving |
|---|---|---|---|
| 8 mm | 2,592 | 0.010 s | 0.0046 s |
| 6 mm | 6,144 | 0.020 s | 0.028 s |
| 5 mm | 9,477 | 0.032 s | 0.056 s |
| 4 mm | 17,787 | 0.061 s | 0.30 s |
| 3 mm | 38,808 | 0.155 s | 1.48 s |
| 2 mm | 130,977 | 0.52 s | 29.4 s |
From 8 to 4 mm the unknowns grew 6.9 times and the factorisation 64 times; from 4 to 2 mm, 7.4 and 99 times. Building the matrix grew 6 and 8.5 times. Measured, the factorisation grows as the 2.2th to 2.3th power of the unknowns, a little faster than the square; the default order is chosen one unknown at a time, not by planes. At 8 mm factorising takes 30 % of the time of building the matrix and factorising it; at 2 mm it takes 95 %.
Scaled from the same measurements, the curl of a 2 kg weight with the whole arm, which takes about 17 minutes on eight threads with bricks of 8 mm, would take about an hour and a half on bricks of 5 mm, about 5 hours on 4 mm, about 21 hours on 3 mm and about two weeks on 2 mm, with the factor needing about 14 GB of memory at 2 mm. These are estimates: they assume each step takes as many Newton steps as now. Below about 5 mm the factorisation decides the cost, and that is why the direct solver runs out there.
The simulator’s desktop solver can also eliminate in a nested-dissection order of its own, made by cutting the arm with planes. On the arm’s bodies at 8 mm it made factors with 2.1 to 3.8 times as many entries as the default order, and took 5.8 times as long to factorise. The arm is not a cube: it is nine slender bodies side by side, which the default order eliminates along their length with little fill, while a plane across the arm cuts through every body at once. Nested dissection pays on large, compact blocks.
Solving by repeated improvement
The other family of methods never touches the matrix except to multiply it by a list of numbers, which for a sparse matrix is cheap and creates no fill-in. They start from a guess and improve it.
The idea rests on the energy. Among all moves , the solution of is the one that makes
as small as possible. In words: half the energy stored by the move, less the work the forces do through it. For a positive definite this function is a bowl, its gradient, the uphill direction, is , and the solution is its lowest point, where the gradient is zero (Shewchuk 1994, section 3). So the downhill direction is
In words: the residual is what is left of the right-hand side after the present guess has been put into the equations. It is zero at the solution, and everywhere else it points downhill.
Steepest descent moves from the guess along the residual to the lowest point on that line, and repeats from there. To find how far to go, write the new guess as , with the unknown distance, and multiply out, using the symmetry of and :
This is a parabola in , and it is lowest where its slope, , is zero:
In words: go a distance equal to the squared length of the residual divided by the curvature of the bowl along it (Shewchuk 1994, section 4).
Conjugate gradients take the same first step. From then on each step goes along the residual with a part of the previous direction mixed back in:
In words: the new direction is the new downhill direction plus a share of the old one, and the share is the ratio of the squared lengths of the new and old residuals (Shewchuk 1994, section 8). The mixing is chosen so that a move along the new direction leaves the slope along every earlier direction at zero. Directions related in this way are called conjugate. Nothing gained by an earlier step is then undone by a later one, and with unknowns the solution is reached in at most steps (Hestenes and Stiefel 1952).
A worked example
Two equations in two unknowns:
In the notation above, has the rows and , is and is .
By elimination. Subtract of the first equation from the second. That removes and leaves , so . Put this into the first: , so .
By steepest descent, from the guess .
| Step | Residual | New guess | ||||
|---|---|---|---|---|---|---|
| 1 | 3.24 | 16.2 | 0.2 | |||
| 2 | 2.0736 | 10.368 | 0.2 | |||
| 3 | 1.3271 | 6.6355 | 0.2 |
To check a row: at the guess the first equation gives , so nothing is left of it, and the second gives where 0 was wanted, so the residual is .
The path is a staircase, each step at right angles to the last, and each residual is 0.8 times the one before: 1.8, 1.44, 1.152. To shrink the residual a millionfold takes 62 steps, for two unknowns.
By conjugate gradients. Step 1 is the same and ends at with the residual . Then
and the new guess is . Two unknowns, two steps, and the answer is exact.
Why some bowls are slow
The bowl of the worked example is a valley. Along the direction it is steep: turns into , nine times itself. Along it is shallow: turns into , once itself. The condition number of a symmetric positive definite matrix, written , is the ratio of its bowl’s greatest curvature to its least (Shewchuk 1994, section 6.2). Here it is 9.
Steepest descent in a valley bounces from wall to wall and makes little way along the floor. From the worst starting point, every step leaves the fraction
of the error (Shewchuk 1994, equations 27 and 28). In words: a round bowl, , is finished in one step, and the narrower the valley the nearer this fraction is to 1. The worked example started from such a point, and is the 0.8 found there. For large the number of steps needed grows in proportion to .
Conjugate gradients do better. After steps the error is at most
times what it was at the start (Shewchuk 1994, equation 52). In words: the same formula with the square root of the condition number in place of the condition number, so the steps needed grow as (Driscoll and Braun, observation 8.6.7). For and a millionfold reduction, the two limits are about 69 000 steps for steepest descent and about 730 for conjugate gradients (Shewchuk 1994, section 10). That is a great improvement, and it is still a number that grows with .
Why tissue is slow
Tissue keeps its volume: its bulk modulus, the stiffness against a change of volume, is tens of thousands of times its shear modulus, the stiffness against a change of shape. Seen as a bowl, a move of the corners that squeezes a brick climbs a wall set by the bulk modulus, and a move that only changes its shape runs along a floor set by the shear modulus. The harder the tissue is to squeeze, the narrower the valley, the larger the condition number, and the more steps an iterative solver takes.
The block of 3744 unknowns shows it. The same gentle pull was solved for with three values of the bulk modulus, by conjugate gradients, run until a hundred-millionth of the residual was left, and by sparse Cholesky factorisation. The times are for one desktop computer and matter only in proportion to each other.
| Bulk modulus ÷ shear modulus | Conjugate-gradient iterations | Conjugate gradients | Factorisation |
|---|---|---|---|
| 1 | 86 | 30 ms | 29 ms |
| 100 | 485 | 143 ms | 27 ms |
| 31 623 | 1971 | 595 ms | 29 ms |
Factorisation does the same arithmetic whatever the numbers in the matrix are. Conjugate gradients take 23 times as many iterations for tissue about as hard to squeeze as muscle as for tissue that squeezes as easily as it shears.
Preconditioning
A preconditioner is a cheap, rough solve applied to the residual in every step of an iterative method, which has the effect of reshaping the bowl into a rounder one (Shewchuk 1994, section 12). The simplest divides each equation by its own diagonal entry (Driscoll and Braun, section 8.8). The simulator’s goes one better and solves, for each corner, the three equations of that corner alone, ignoring its neighbours.
This evens out differences between corners, such as a small brick beside a large one or soft tissue beside stiff. It does nothing for the wall and the floor of the valley, because squeezing a brick is a matter of how neighbouring corners move together, and that is exactly what the preconditioner ignores. A perfect preconditioner would be the matrix itself, which is the problem we started with (Shewchuk 1994, section 12).
In the worked example both diagonal entries are 5, so the preconditioner divides everything by 5. Scaling the whole problem by a constant changes none of the steps, which is why the simulator’s solver walks the same path as the hand calculation.
Which solver the simulator uses
On the desktop, every Newton step of a deformable body is solved by sparse Cholesky factorisation. Its work does not depend on the bulk modulus, and its failure reports that the matrix is not positive definite.
In the browser, where the laboratories of this book run, that library is not built in, and the same step is solved by conjugate gradients with the corner-by-corner preconditioner. The bodies in the laboratories are small enough for this to be quick.
On the CPU or on the GPU
A desktop build can also factorise on an NVIDIA graphics card. The factorisation is the same sparse Cholesky, in the same 64-bit numbers, done by NVIDIA’s cuDSS library instead of faer (cuDSS 1.0; faer). It is a solver back end: a choice of where the same arithmetic runs. The desktop application offers it in its header, beside the theme, when the card and the library are there, and KENOMA_SOLVER=cuda chooses it for a run without a window. Small systems, such as the laboratories’, stay on the CPU, where the card’s fixed cost per call is larger than the whole job.
Two things must stay the same for the choice to be safe.
- The test of positive definiteness. The search on a saddle needs to know when the matrix is not positive definite (Steps near a saddle). A Cholesky factorisation finds out by meeting a pivot that is not positive, on either device. The card says where it stopped, and the back end passes that on as a failure, exactly as the CPU does.
- The precision. A graphics card for games does 64-bit arithmetic at about a sixtieth of its 32-bit rate: measured on the machine this book was written on, 0.75 against 46 trillion operations a second. The back end still factorises in 64 bits. A 32-bit factor of a matrix whose bulk modulus is ten thousand times its shear modulus can meet a pivot that is not positive where the 64-bit one does not, and that would change which steps the search takes.
The two devices still do not give the same numbers to the last digit. Each eliminates the unknowns in its own order and adds the pieces of each sum in its own order, so their steps differ by rounding, about one part in . A single solve cannot tell. A whole curl can: When two runs disagree shows that a change that small sends the search down a different path to a different balance of the same test. So a run on the card is judged the way any change of the solver’s path is judged, against the spread of the CPU’s own runs, not frame by frame.
Building the matrix on the card
Factorising is only half of a Newton step on the arm. Before it the matrix has to be built. Each of the arm’s 3,424 bricks has a 24 × 24 block of second derivatives, worked out at its eight sample points from the tissue’s law and its fibres; the blocks are added into the matrix, and the rows of the nodes that follow other nodes are folded onto the nodes they follow. On the CPU this took as long as the factorisation, and the trial shapes of each line search (forces only) half as long again.
The card now does that too. Each brick gets 64 of the card’s threads, one for each pair of its corners, and every sum is formed in a fixed order, so a run on the card repeats exactly. Two things stay on the CPU. The fibre laws, a muscle’s force–length curve and its rate law, are a function of one number at each sample point, its fibre stretch: the card works out the stretches, the CPU evaluates the laws with the same code as before, and the card uses the results. The contact between bodies, which must find where each point of one muscle lies in the bricks of another, also stays on the CPU, spread over its threads. For one evaluation of the arm’s matrix the card agrees with the CPU to a few parts in of the largest entry.
Measured on the default curl with 2 kg, on the machine this book was written on, the whole run took 3,940 s with the card against 9,902 s on the CPU alone, and a Newton iteration 0.21 s against 0.44 s: about twice as fast, not the ten times that was asked for. What is left is spread over many pieces of a few milliseconds each, none of them dominant: the factorisations themselves, the contact between bodies and the fibre laws on the CPU, and the copies between the two. The run on the card follows a different path to the same balances, as any change of the solver’s arithmetic does (When two runs disagree), and is judged the same way.
Keeping the matrix on the card
Built on the card, the matrix still travelled: about 12.6 MB back to the CPU after every assembly, and its lower half, about 9 MB, out to the card again to be factorised. Now it stays where it was built. The factorisation picks its entries out of the card’s copy through a map made once for each pattern, and only the blocks that contact between bodies adds, which the CPU works out, cross over. The few blocks of the matrix that such contact reaches inside its pattern are copied back, have the CPU’s pieces added in the order the CPU always added them, and are written again. Nothing else changes, so the card’s matrix is the same, digit for digit, as before: the curl’s first 12 steps give the same states to the last digit either way. The other things the search does with the matrix (multiplying it by a vector, finding its largest diagonal entry, adding to its diagonal) are done on the card too, again to the same digits.
Two more jobs moved to the card with it. The bricks’ forces are added up into each corner’s force there, in the order the CPU added them, so only one force per corner comes back instead of 24 numbers per brick. And the fibre laws of the arm’s muscle bellies and tendons, the force–length curves, the force–velocity law and the work integrals, are worked out at every sample point on the card, from the same formulas in the same order; the card’s exponential and logarithm can differ from the CPU’s in the last digit, so these values, unlike the rest, agree to that digit and not always beyond it.
On the curl’s first 12 steps all this cut what comes back from the card each Newton iteration from about 21 MB to under 7 MB. The time per iteration hardly moved, because the copies took only a few milliseconds; the time is in the work itself. What still crosses each iteration is what the CPU still computes, above all the contact between bodies (about 9 MB a step out to the card).
Contact on the card
After the matrix moved, the largest job left on the CPU was contact: the arm’s muscles against its bones, against each other, and the tethers of loose tissue between them. On the curl’s first steps each evaluation read about 51,600 surface points against the bones’ distance grids and 9,300 points of one muscle against the planes of another, of which only about 60 and 200 actually press, plus about 900 tethered points, which always pull. Those three kinds of term now run on the card too.
The card finds every point’s gap, pressure and energy, and sends back one byte per point: does it press? The CPU then lists the pressing points with the nodes each one reaches (a small list, a few hundred points), and the card adds up each node’s force and each block of the matrix from those points, in the order the CPU always added them. For the bones and the muscles kept apart, a term’s energy, forces and matrix blocks are then the CPU’s to the last digit; for the tethers, whose law uses the hyperbolic tangent and a logarithm, to the last digit of those functions, as for the fibre laws. The blocks that fall inside the matrix’s pattern stay on the card and are added there; the ones that join two bodies, outside it, still come back to the CPU, because that is where the factorisation’s patterns are worked out.
Measured on the curl’s first 12 steps (the same machine, under the same load from other jobs), assembling the matrix took 40 to 54 ms instead of 70 to 83, and a Newton iteration 148 to 209 ms instead of 174 to 272: about 10 to 25 per cent less. What comes back to the CPU each iteration grew by about 5 MB (the blocks between bodies), and what goes out shrank by about 1 MB. On the whole curl with 2 kg a Newton iteration took 0.19 s on the card against 0.35 s on the CPU alone: still under twice as fast, not the ten times asked for. The run on the card again follows a different path to the same balances, as any change of arithmetic does, and is judged against the CPU’s own spread; it lies within it but for the shape of the surfaces, which differ by up to 18 mm at one point against 12 mm between two CPU runs.
Thirty-two bits after all?
A factor in 32-bit numbers is cheaper to compute, and the search does not need its steps to the last digit: Newton’s method corrects an inexact step at the next iteration, as long as the forces it is driven by are exact. So the matrix and the forces can stay in 64 bits while the factor alone is made in 32, each solve then being refined: the 64-bit matrix measures how far the 32-bit answer misses, and the 32-bit factor corrects the miss. Each correction gains digits only while the matrix’s condition number, the ratio of its largest to its smallest stretch, times the 32-bit rounding error, , is below one: refinement of this kind is guaranteed to converge for condition numbers up to about (Carson and Higham 2018, Table 9.1).
Estimated on the curl’s own matrices (Lanczos’s method, 27 matrices of the setup and first steps), the condition numbers run from to , about in the middle; scaled so that every diagonal entry is one, from to . So the refinement works, but slowly: 5 to 6 corrections a solve on average, and one solve in eight or so does not settle in ten and is done again with a 64-bit factor. Measured on the card, the 32-bit factorisation was 1.7 times quicker, but the solves became nine times slower, and the curl’s first steps took longer, not shorter. The 64-bit factor stays the default; the mixed one is an option to measure with, not a speed-up.
Try it: two ways down a bowl
The lab draws the bowl of the worked example from above. The rings are curves of equal height, and both methods start at . Each press of Step takes one step of each.
- Check the worked example. Press Step once: both methods are at and 0.8 of the residual is left. Press again: steepest descent is at with 0.64 left, and conjugate gradients are at with nothing left. A third press takes steepest descent to . The readouts say it needs 62 steps in all.
- Predict, then check. Set the narrowness to 1, a round bowl. How many steps will each method need? One: the residual points straight at the lowest point.
- Predict, then check. Set the narrowness to 99. What fraction of the residual will each steepest-descent step leave, and how many steps does it need? The fraction is , and it needs 684 steps. Conjugate gradients still need two.
- Read the last plot. The steps steepest descent needs rise in a straight line with the narrowness, about seven steps for each unit. The measured points lie on the formula.
Try it: harder to squeeze, slower to solve
A block of tissue stands on a smooth table against two smooth walls and is pulled gently upward. Each press of Step multiplies its bulk modulus by about 3.2, so that two presses multiply it by ten, and solves the linear equations of the first Newton step again by conjugate gradients. Factorisation is not available in the browser; its behaviour is the right-hand column of the table above.
- Start. With the bulk modulus equal to the shear modulus, the 264 unknowns take 33 iterations. The block stretches by 1.481 mm and its volume grows by 2.78 %.
- A hundred times harder to squeeze. Press Step four times. The count is 108, the stretch 1.115 mm and the change of volume 0.028 %.
- Predict, then check. Where is the stretch heading? Toward the dashed line, 1.111 mm, the stretch of tissue whose volume cannot change at all. Press Play to the end, where the bulk modulus is 100 000 times the shear modulus: 257 iterations.
- Fewer bricks. Choose 2 × 2 × 4 bricks and run again. There are 96 unknowns, and at the end conjugate gradients take 129 iterations to find them. With exact arithmetic they could not need more than 96; the rounding of the computer’s numbers slowly spoils the relation between the directions (Shewchuk 1994, section 9).
- More bricks. Choose 4 × 4 × 8 bricks: 560 unknowns, 44 iterations at the start and 452 at the end.
What this model leaves out
- Stronger preconditioners. There are preconditioners that look further than one corner, such as a factorisation with its fill-in thrown away (Driscoll and Braun, section 8.8). The simulator’s one stronger preconditioner, a multigrid, is in Pressure as an unknown, and multigrid; where iteration would be slow it factorises.
- Bodies too large to factorise. For a large enough body the factors, with all their fill-in, no longer fit in the computer’s memory, and iteration is the only way left (Shewchuk 1994, section 1). The bodies of this book are far smaller: Pressure as an unknown, and multigrid measures where the factorisation stops paying, with bricks between 3 and 2 mm on a block and, by estimate, 2.5 to 3 mm on the arm.
- Tissue tied to a moving skeleton. Here the body stood alone. How its equations are joined to those of the skeleton is the subject of Tissue and skeleton together.
- Shapes far from balance. There the matrix may fail to be positive definite and the bowl is no longer a bowl. What the simulator does then is the subject of Steps near a saddle.
Summary
- Each Newton step of a deformable body solves . The matrix is sparse, because each corner shares bricks with at most 26 others, and symmetric, because the forces come from one energy.
- Elimination, kept as a factorisation, costs the same whatever the stiffnesses are. For a sparse matrix its cost is set by fill-in, and so by the order in which unknowns are removed. On a block of bricks even a good order makes the work grow as the square of the unknowns: halving the bricks multiplies it by 64 to 100.
- Solving is finding the bottom of a bowl. Steepest descent zigzags and needs steps in proportion to the condition number; conjugate gradients need steps in proportion to its square root.
- Tissue that hardly changes volume makes the bowl a narrow valley, and a corner-by-corner preconditioner does not widen it.
- The simulator factorises on the desktop, on the CPU or, where one is present, on an NVIDIA graphics card in the same 64-bit precision, which can also build the matrix and keep it there between the steps; it uses preconditioned conjugate gradients in the browser.
Next: a stiffness matrix that is not positive definite, and what Newton’s method should do with it: Steps near a saddle.