Finding the shape that balances
The question. Given how a piece of tissue is held, loaded and switched on, what shape does it take?
The last chapter turned a body into a list of node positions and showed how the stored energy, and the force on every node, follow from that list. In every laboratory since the second chapter of this part, the simulator has then quietly found the one shape in which all those forces balance. This chapter opens that step. It is a search, the same search for a block of sixteen bricks as for a whole muscle, and it rests on one idea from the mathematics toolkit: walking downhill.
By the end you will be able to state balance as the lowest point of an energy, carry out Newton’s method by hand for one unknown, explain why its step is sometimes too bold and how that is repaired, and say what it means for the search to have finished.
Balance is the bottom of a valley
A body is in equilibrium when the forces on every part of it add up to zero. For a body of bricks that means: on every node that is free to move, the push of the tissue and the applied load cancel.
Both kinds of force come from energies. The tissue pushes each node with minus the gradient of the stored energy . A constant load, such as a weight hung on the end of a muscle, has an energy too: the chapter on energy called it potential energy, weight times height, and it falls as the weight descends. For a load on a node at position it is , lower the further the node moves the way the load pushes. Add the two:
In words: the potential energy of the body and its loads is the stored energy of the tissue minus, for every loaded node, the load times how far the node has gone along it. It is in joules, and it is a function of the positions of all the free nodes.
The total force on a node is minus the gradient of with respect to that node’s position. So the forces all balance exactly where the gradient of is zero: on level ground. And of the level places, the one a body settles into is the bottom of a valley. There a small push meets a force that sends the body back, whereas on a hilltop it would roll away (Dourmashkin 2022, section 14.6).
The shape that balances is the shape of least potential energy. Finding it is a walk downhill on a landscape with as many directions as the body has free coordinates.
Two things are left out of this picture on purpose. The tissue has no mass here, so nothing overshoots or swings: the shape depends only on the supports, loads and activation of the moment. The simulator’s arm gives its tissue weight and inertia; Tissue that has weight and When tissue’s own inertia matters add them, and each time step is then still a search of this kind, for the lowest point of a potential with one more term. The biceps model quoted in earlier chapters was solved in the same way, as a sequence of balanced shapes (Blemker et al. 2005, section 2.3). And the fibres’ active pull has been given an energy, as the chapter on fibres explained, so that it sits inside with everything else.
Newton’s method in one variable
Start with a landscape that has one direction. Take the block of the chapter on stored energy: the neo-Hookean solid, 40 mm long, 20 mm square, with a shear modulus of 5 kPa. Rest one end against a plate and put a steady load on the other, positive for a pull. Suppose the block keeps its volume exactly, so that its sides follow its length and one number describes its shape: the stretch ratio .
Its stored energy is its reference volume times the energy density found in that chapter, and its loaded end is at , so
With J, or 80 mJ, and m.
A walker on this curve can measure two things where they stand. The slope says which way is downhill:
The curvature is the rate of change of the slope, and says how quickly the slope is changing, which is to say how tight the valley is:
Both follow from the power rule, as in the chapter on stored energy.
The idea. The curve itself is complicated, but a parabola is not, and a parabola with the same height, slope and curvature as the curve is a good copy of it nearby. A step away from the present place, that parabola has the height
Its own slope, , is zero at its lowest point. Solving for :
In words: the Newton step is minus the slope divided by the curvature. It goes straight to the bottom of the parabola that matches the curve where you stand. Go there, measure the slope and curvature again, and repeat. This is Newton’s method (Boyd & Vandenberghe 2004, section 9.5.1).
A worked example
Let the load be a pull of 1.8 N, so mJ, and start at the reference length.
| Step | Stretch ratio | Slope (mJ) | Curvature (mJ) | Newton step |
|---|---|---|---|---|
| start | 1 | |||
| 1 | 1.3 | 0.1004 | ||
| 2 | 1.4004 | −0.767 | 138.3 | 0.0055 |
| 3 | 1.4059 | −0.0019 | 137.6 | 0.00001 |
| 4 | 1.4059 | −0.00000001 | 137.6 |
The slope shrinks by a factor of 5, then 20, then 400, then 160,000. Once the walker is close, each step roughly squares the error of the one before, so the number of correct digits about doubles every step. That behaviour is called quadratic convergence, and it is why the method is worth its trouble (Boyd & Vandenberghe 2004, section 9.5.3).
A step can be too bold
The parabola is a copy of the curve only nearby. Far from where it was fitted it can be badly wrong, and the method trusts it all the way to its bottom.
A push. Change the load to a push of 4 N, so mJ, and start again from the reference length.
| Quantity | Calculation | Result |
|---|---|---|
| Potential energy at the start | 160 mJ | |
| Slope | 160 mJ | |
| Curvature | 240 mJ | |
| Newton step | −0.667 | |
| Stretch ratio after the step | 0.333 | |
| Potential energy there | 177.8 mJ |
The step went downhill and ended higher than it started, by 17.8 mJ. The block was asked to squash to a third of its length in one go. The true curve climbs steeply there, because of the in the energy, which grows without limit as the block is flattened. The parabola fitted at knows nothing of that wall. The step has overshot the valley and landed on the far slope.
It can be worse. With a push of 6 N the slope at the start is 240 mJ, the Newton step is exactly −1, and the method asks for a stretch ratio of zero: a block with no length. A push harder than that asks for a negative length, a block turned inside out, which the chapter on deformation ruled out for any real material and for which the energy has no value at all.
The line search
The repair keeps what was good about the step and drops what was not. The direction was right: the slope says so. Only the length was wrong. So try the full step, and if the potential energy has not fallen, try half of it, then a quarter, and so on, until it has. This is a line search, of the kind called backtracking (Boyd & Vandenberghe 2004, section 9.2).
For the push of 4 N the first halving is enough:
| Quantity | Calculation | Result |
|---|---|---|
| Half step | −0.333 | |
| Stretch ratio | 0.667 | |
| Potential energy there | 124.4 mJ |
That is 35.6 mJ lower than the start, and the step is accepted. From there the parabola is a good copy, full steps are taken, and the search runs 0.6129, 0.61798, 0.618034. The balance is at , where .
Two details complete the rule as the simulator applies it. A shortened step is accepted only if the energy has fallen by at least a small share, one ten-thousandth, of what the slope promised for a step of that length, so that a fall too small to mean anything is not counted. And a trial shape in which any brick is turned inside out is rejected outright, whatever its energy, and the step is halved again.
Because the slope always points downhill, a short enough step always lowers the energy, so the halving always ends. A search made this way can only go down. Far from the answer it takes shortened steps; close to it the full step is accepted every time and the doubling of digits sets in (Boyd & Vandenberghe 2004, sections 9.2 and 9.5.3).
Try it: one variable
The block here is the simulator’s own, cut into bricks, and its energy and slope are read from the simulator; only its shape is held to the one-number family described above.
- Check the worked example of the push. The lab opens with the push of 4 N and no line search. The slope reads 160 mJ, the curvature 240 mJ and the full step −0.667. Press Step once. The stretch ratio is 0.333 and the potential energy has risen by 17.78 mJ. On the plot, the dashed parabola fitted at the start has its bottom far to the left of the valley.
- Repair it. Switch the line search on and press Step. The same step is halved once: stretch ratio 0.667, potential energy 124.44 mJ.
- Count the steps. Keep stepping until the lab reports balance, with and without the line search. Both end at 0.6180. With the line search it takes 5 steps and without it 7: the overshoot is paid for by having to climb back.
- Predict, then check. Set the load to a push of 6 N without the line search and press Step. What is the full step? Exactly −1, and the lab stops, because a block of no length has no energy to measure. Switch the line search on: half the step is taken, and the search ends at 0.5321 in 5 steps.
- A pull. Set the load to +1.8 N. The search needs no help: 1.3, 1.4004, 1.4059, and the slope plot falls faster at every step.
- Start somewhere else. Set the load back to a push of 4 N and the starting stretch ratio to 1.6, with the line search on. The search ends at the same 0.6180, in 5 steps: the bottom of the valley does not depend on where the walk began. Now switch the line search off. From this start the full step is −2.156, which asks for a negative length, and the lab stops at once.
Many variables at once
A body of bricks has not one unknown but hundreds: 135 coordinates for the small block, tens of thousands for a muscle. The method is the same, with each quantity grown to fit.
- The slope becomes the gradient of , written : one number for each free coordinate, in newtons. Each is the unbalanced force on that coordinate, with its sign reversed.
- The curvature becomes a table with a row and a column for every free coordinate. Its entry in row and column says how much the force on coordinate changes for each unit that coordinate moves, in newtons per metre. It is a matrix, called the stiffness matrix and written .
- The parabola becomes a bowl in many dimensions, and the step to its bottom is no longer one division. It is the list of moves , one for each coordinate, in metres, that satisfies
In words: the stiffness matrix times the Newton step equals minus the gradient. That is as many equations as there are unknowns, all tangled together, since moving one node changes the forces on its neighbours. Solving them is most of the work of each step, and it is the subject of a later chapter, Solving many equations at once. Here the solution is taken as given.
One thing eases the task. A node feels only the bricks it belongs to, so the force on it changes only when it or one of its near neighbours moves. Most entries of are therefore zero.
The line search carries over unchanged: move every node by the full step, by half of it, by a quarter, until the potential energy has fallen and no brick is inside out. A cleverer search, which fits a curve to the energy along the step and jumps to its lowest point, was tried on the arm built of tissue bodies, as it was solved before its tissue was given mass, and took more Newton steps than halving: where bodies touch or bricks are nearly inside out, the energy along the step jumps, and the fitted curve then points to short steps. Tried again on the arm with its tissue’s mass, a cubic fitted to the energy along the step saved Newton steps while the elbow moved and cost more while the arm was turned to the curl’s start, so it was not adopted either. Halving stays.
One new difficulty has no counterpart on a curve. In many dimensions the ground can curve upward in some directions and downward in others, like a saddle. At a saddle the bottom of the matching bowl is not downhill at all, so a Newton step aimed at it can go the wrong way.
The tissue’s stiffness matrix is often of that kind, and not only far from balance. On the arm built of tissue bodies curling a weight, solved without the tissue’s mass, it was so in 73 % of the Newton steps, 3,920 of 5,357. In the first twelve time steps it was so in 40 of the 132 Newton steps that began with less than 1 N unbalanced. Most of the downward curvature came from the volume term’s pressure in a few bricks of each body.
The simulator does two things about it.
- It shifts the matrix. It adds a small stiffness, the same in every direction: 100 N/m times the largest unbalanced force as a share of the largest at the start of the search. That lifts the matrix enough to curve up everywhere. The shift shrinks with the unbalanced force, so the last steps of a search are plain Newton steps. Only when the shifted matrix still curves downward somewhere does the simulator use a repaired matrix instead, in which every brick’s downward curvatures have been set to zero.
- It improves the step. A few iterations of the method of conjugate gradients, a way of solving many equations by repeated improvement (Solving many equations at once), on the exact matrix refine the step from the shifted or repaired one, stopping if they meet a downward direction. The step that results always points downhill, and the line search does the rest.
So every Newton step of the arm starts from the shifted matrix, and the exact matrix is never factorised as it stands. The balances themselves are true minima: of 38 that were checked on the arm, 36 curve upward in every direction, and the other two are flat to within 0.1 N/m in one. Steps near a saddle measures what such repairs cost near the balance.
What “converged” means
The walker never reaches the exact bottom, and does not need to. A computer keeps about sixteen digits of each number, so a force of exactly zero is not on offer.
The search watches one number, the residual: the largest unbalanced force on any free coordinate of any node, in newtons. It stops when the residual is below a tolerance set in advance, and the search is then said to have converged. In the laboratories with the muscle block the tolerance is a millionth of a newton, on a block that pulls with tens of newtons.
If the steps allowed run out first, or no shortened step lowers the energy, the simulator reports that the search did not converge. It does not hand back the last shape as if it were the answer.
How many steps it takes
These counts are from the laboratories of this part, each started from the shape named.
| Case | Started from | Steps |
|---|---|---|
| Neo-Hookean block held at a stretch of 1.3 | the stretched shape that keeps its volume | 2 |
| Muscle block, 12 N, activation switched from 0 to 0.2 | the relaxed block balanced under the weight | 9 |
| The same, activation 1 and 24 N | the relaxed block balanced under the weight | 8 |
| Rubber bar bent by 0.05 N, averaged bricks | the straight bar | 17 |
| The same bar under 0.1 N | the straight bar | 25 |
A good starting guess is worth a great deal: the stretched block starts next to its answer and is done in two steps. The muscle block has to shorten by nearly half, and spends its first six steps finding the valley and its last three falling into it. The bar is the hardest of the three although its material is the simplest. Its free end has to swing down along an arc. Each full step moves the nodes along straight lines instead, which stretches the bricks’ volume, and against a bulk modulus a thousand times the shear modulus the line search cuts such steps short again and again. The bulk modulus is what makes the difference: in the laboratory of the last chapter, the same bar takes 9 steps with a bulk modulus a hundred times the shear modulus, 6 steps with ten times, and 5 with once.
Try it: a block of bricks
This is the block of the chapter on volume, with its 135 coordinates. The arrows are the unbalanced forces on its nodes.
- Check the table. The block starts relaxed and balanced under 12 N, 49.59 mm long, and the fibres are switched on to 0.2. The largest unbalanced force reads 2.85 N. Step until the lab reports balance: 9 steps, ending at 27.05 mm long and 24.33 mm wide, the shape found in the chapter on volume.
- Watch the first step. Press Reset, then Step once. The potential energy has fallen by 41.6 mJ, yet the largest unbalanced force has risen from 2.85 N to 39.6 N. The trial shape has lost 3.7 % of its volume, and the bulk modulus answers with large forces. The line search judges a step by its energy, and by that measure this one was a step forward.
- Find the two phases. Keep stepping and watch the plot of the unbalanced force. For six steps it wanders between half a newton and forty. Then it falls: 0.44 N, 0.00024 N, 0.0000004 N. Those last three steps are the doubling of digits.
- Predict, then check. Start the search from the block at its optimal length, not yet loaded. Will it end at a different shape? No: 27.05 mm again, in 8 steps. The potential energy falls by less along the way, 107 mJ against 258 mJ, because this start is closer to the answer.
- Make it work harder. Set the activation to 1 and the weight to 24 N. The answer is a block 23.40 mm long, reached in 7 or 8 steps from either start. A problem several times larger in force does not take several times as many steps.
What this model leaves out
- Solving for the step. The equations were taken as solved. Solving many equations at once shows how, and why tissue that keeps its volume makes them hard.
- Time. The tissue here has no mass and moves through no time; each shape is a balance. Stiff equations and implicit steps takes up tissue that moves, and When tissue’s own inertia matters gives it the mass the simulator’s arm has.
- More than one valley. A landscape can have several. Active fibres beyond their optimal length make one that does, as the chapter on fibres noted, and the search then ends in whichever valley its starting shape leads down to. Steps near a saddle shows how the path of a search decides the balance it reaches.
- Bodies that touch. A neighbour in the way is a wall across the landscape, and no energy of the kind used here describes it. Tissues that touch adds it.
A longer treatment of this kind of search is listed among the sources as a lead: Nocedal & Wright 2006. Only its bibliographic record was checked for this book, and nothing here is taken from it.
Summary
- A body is in balance where its potential energy, the stored energy minus the work the loads have done, is lowest.
- Newton’s method fits a parabola to the energy at the present shape and steps to the parabola’s bottom: minus the slope divided by the curvature. Close to the answer, each step about doubles the number of correct digits.
- A full step can overshoot, raise the energy or turn the body inside out. A line search halves the step until the energy has fallen.
- With many unknowns the slope is the list of unbalanced forces, the curvature is the stiffness matrix, and each step solves .
- The search has converged when the largest unbalanced force on any node is below a tolerance. In these laboratories that took between 2 and 25 steps.
Next: every body so far has been a block, chosen because it cuts neatly into bricks. A muscle has no flat faces and no square corners: A muscle from its surface.