Generator embedding optimization: Difference between revisions

Cmloegcmluin (talk | contribs)
m fix EBK
Cmloegcmluin (talk | contribs)
Line 5,372: Line 5,372:


=Coinciding-damage method=
=Coinciding-damage method=
The third and final specific optimization power we'll take a look at in this article is <math>p = ∞</math>, for minimax tuning schemes.
The method for minimax tuning schemes is similar to the zero-damage method used for miniaverage tuning schemes, where <math>p = 1</math>. However, there are two key differences:
# Instead of gathering only the points created where target-intervals' damage graphs coincide with ''zero'' damage, we also gather any points where target-intervals's damage graphs coincide with ''nonzero'' damage.
# Where the <math>p=1</math> method is not capable of tie-breaking when the basic mini-<math>p</math>-mean is a range of tunings rather than a single unique optimum tuning, this <math>p=∞</math> method ''is'' capable of tie-breaking, to find the true single unique optimum tuning.
==History==
This method was originally developed by [[Keenan Pepper]] in 2012,<ref>See https://yahootuninggroupsultimatebackup.github.io/tuning-math/topicId_20405.html and https://yahootuninggroupsultimatebackup.github.io/tuning-math/topicId_21022.html</ref>, in a 142-line long [[Python]] file called [https://github.com/keenanpepper/tiptop/blob/main/tiptop.py tiptop.py].
Keenan developed his algorithm specifically for the minimax-S tuning scheme (historically known as "TOP"), the original and quintessential all-interval tuning scheme. The all-interval use case is discussed below in the "For all-interval tuning schemes" section.
Specifically, Keenan's method was developed for its tie-breaking abilities, at a time where the [[power-limit method]]'s ability to tie-break was unknown or not popular.
Keenan's method was modified in 2021-2023 by [[Douglas Blumeyer]] in order to accommodate ordinary tunings — those with target-interval sets where the optimization power is <math>∞</math> and the norm power may be anything or possibly absent — and this is what will be discussed immediately below. Douglas's modifications also included support for held-intervals, and for alternative complexities, both of which are discussed in sections below, and also an improvement that both simplifies it conceptually and allows it to identify optimum tunings more quickly. [[Dave Keenan]] further modified Keenan's method during this time so that it can find exact solutions in the form of generator embeddings, which is also reflected in all the explanations below.
The explanation of how this method works is mostly by Douglas Blumeyer, but Dave Keenan and Keenan Pepper himself both helped tremendously with refining it. (Douglas takes credit for any shortcomings, however. In particular, he apologizes: he didn’t have time to make it shorter.)
==Coinciding-damage points==
===Points for finding damage minimaxes===
Damage ''minimaxes'' are always found at points in tuning damage space where individual target-interval [[Dave_Keenan_%26_Douglas_Blumeyer's_guide_to_RTT:_tuning_fundamentals#3D_tuning_damage_graphs|hyper-V]] damage graphs intersect, or cross, to form a point.
This doesn't mean that every such point will be a damage minimax. It only means that every damage minimax will be such a point.
Now, the reason why a damage minimax point must be a point of intersection of target-interval damage graphs like this is because a minimax can only occur at a point on the max damage graph where it ''changes slope'', and the max damage graph can only change slope where damage graphs cross. In other words, whenever damage graphs cross, then on one side of the crossing, one is on top, while on the other side, the other is on top.
(For the duration of this explanation, we'll be illustrating things in 2D tuning damage space, because it's simplest. We'll wait until the end to generalize these ideas to higher dimensions.)
But many times when damage graphs cross, while this is still true about which target-interval's damage is on top switching, they were all sloping with the same sign, i.e. all up, or all down:
[[File:Same sign slope.png|frameless|600x600px]]
And minimax points will never happen at these sorts of crossings. So we have to be more specific.
A minimax point cannot be just any point where the max damage graph changes slope. It must be at a point where the sign of the slope changes ''between positive and negative''. This will create what we call a "local minimum", the sort of thing that could be our ''mini''-max, or minimum maximum. ("Local minimum" is a technical term, but the "local" part of it turns out not to be relevant to this problem, and it may cause more confusion to attempt to explain why not, so we'll just ignore it.)
We might call this sort of point a <math>-+</math> point, in reference to the signs of the slopes to either side. And by analogy, the other kinds would be <math>--</math> or <math>++</math> points.
[[File:Max point.png|frameless|600x600px]]
When damage graphs cross while sloping in opposite directions, like this <math>-+</math> point, then when we move in ''either'' direction away from such a coinciding-damage point, at least one of these target-intervals' damages will be going up. And by the nature of the ''maximum'', all it takes is ''one'' of their damages going up in order for their ''max'' damage to go up.
And so if we look at it the other way around, it means that from any direction coming in ''toward'' this point, the maximum damage is going ''down'', and that once we reach this point, there's nowhere lower to go. That's what we mean by a "minimum."
As for the "local" part of "local minimum", this only means that there might be other minima like this one. In order to deal with that part of the term better, we'll have to start looking not only at two target-intervals' damages at a time, but all of them at once.
[[File:Point_set.png|thumbnail|600x600px]]
When we zoom out and consider all the crossings among all our target-intervals, not just these two, we can see all sorts of different crossings. We have some <math>--</math> points and <math>++</math> on the periphery, and some <math>-+</math> points in the middle. Notice that we included among those the zero-damage points on the floor, which aren't exactly ''crossings'', per se, but they are closely related, as we'll see soon enough; they sort of make their own local minima all by themselves. (This isn't even ''all'' of the crossings, by the way; it's hard to tell, but the slopes of the red and green lines on the left are such that eventually they'll cross, but way, way off the left side of this view.)
Notice that most of the points are <math>-+</math> type points (9 of them, including the zero-damage ones). Fewer of them are the mere change-of-slope types, the <math>--</math> or <math>++</math> type (5 of them, including the one off-screen to the left). However, of these 9 important <math>-+</math> points, only one of them is the actual minimax! In other words, for every other <math>-+</math> point, when we consider all the other target-intervals too, we find that at least one of their damage graphs passes above it. The minimax point is the only <math>-+</math> that's on top.
So our minimax tuning is found at a point where:
* We have a crossing of target-interval damage graphs,
* But not just any one of those: it has to be a <math>-+</math> type crossing,
* But not just any one of those: it has to be the one that's on top.*
Now, it might seem inefficient to check 14 points, the ones that only meet the first bullet's criterion, just to find the one we want that meets all three bullet's criteria. But actually, for a computer, 14 points is easy peasy. If we compared that with how many points it would check while following the general method for solving this, that could be thousands of times more, and it still would only be finding an approximate solution; the general method has a weaker understanding of the nature of the problem it's solving. In fact, this diagram shows a very simple 3-limit temperament with only 4 target-intervals, and the typical case is going to be 7-limit or higher with a dozen or more target-intervals, which gets exponentially more complex. But even then it may still be fewer points for the computer to check overall, even though many of them are not going to work out.
And you might wonder: but why don't we just scan along the max graph and pick the <math>-+</math> point? Well, the problem is: we don't have a function for the max damage graph, other than defining it in terms of all the other target-interval damage graphs. So it turns out that checking all of these crossing points is a more efficient way for a computer to find this point, than doing it the way that might seem more obvious to a human observer.
<nowiki>*</nowiki> Once we start learning about tie-breaking, we'll see that this is not always exactly the case. But it's fine for now.
===Points for finding damage miniaverages===
In our explanation of the zero-damage method for <math>p=1</math>, we saw a similar thing in action for damage ''miniaverages''. But these can only be found at a strict ''subset'' of such coinciding-damage points. Specifically, a damage miniaverage is found somewhere among the subset of coinciding-damage points wherever a sufficient count of individual target-intervals' hyper-V-shaped damage graphs intersect ''along the zero-damage floor of the world'', in other words, along their creases.
We won't find miniaverages at any of the other coinciding-damage points, at various heights above the zero-damage floor wherever enough hyper-V's intersect to form a point. We do find mini''max''es there, because (to review the previous section) in any direction away from such a point, at least one of the damages will be going up, and all it takes is one damage to go up to cause the ''max'' damage to go up. But the same fact is not true of ''average'' damage.
In 2D we can see plainly that we don't create any local minimum, or even any change of slope, in our average graph at just any crossing of two damage graphs. On one side of their intersection, one is going up and the other is going down. On the other side of their intersection, the same one is still going up and the same other one is still going down! The average is changing at the same rate.
[[File:Average point.png|frameless|600x600px]]
So the only points where we can say for certain that in any direction no intersecting target-interval's damage has anywhere further down to go are the places where enough creases cross to make a point where they're ''already along the zero-damage floor''. So these are the only points worth looking for a damage miniaverage:
[[File:Average point floor.png|frameless|600x600px]]
===Zero-damage coincidings===
So: both types of points are coinciding-damage points. In fact, it may be helpful for some readers to think of the zero-damage method and its zero-damage point set as the (coinciding-)zero-damage method and its (coinciding-)zero-damage point set. It simply uses only a specialized subset of coinciding-damage points.
Because both types of points are coinciding-damage points, both types are possible candidates for damage minimax tunings. We can see that zero-damage coincidings are just as valid for getting local minima in the max damage graph:
[[File:Max point floor.png|frameless|600x600px]]
As we'll see in the next subsection, when intersecting on the zero-damage floor, we actually need one fewer target-interval to create a point. So <math>\textbf{i}_2</math> isn't even ''really'' necessary here. We just thought it'd be more confusing to leave it off than it would be to keep it in, even though this means we have to accept that the target-intervals are multiples of each other, e.g. we could think of <math>\textbf{i}_1</math> and <math>\textbf{i}_2</math> here as <math>\frac32</math> and <math>\frac94</math>, respectively, with prime-count vectors {{vector|-1 1}} and {{vector|-2 2}}, though it's not like that's a problem or anything. In 3D tuning damage space we wouldn't have this multiples problem; there's a lot more natural and arbitrary looking angles that creases can be made to intersect. But in 3D we'd still have the one-fewer-necessary-on-the-floor problem, which is a bigger problem. And in general it's best to demonstrate ideas as simply as possible, so we stuck with 2D.
But this also creates the terminological problem whereby in 2D, a single target-interval damage graph bouncing off the floor is wanted as a "coinciding-damage" point. In this case, we can reassure ourselves by imagining that the unison is always sort of in our target-interval set, and its graph is always the flat plane on the floor, since it can never be damaged. So in a way, the target-interval's damage coincides with the unison, and/or the unison is thought of as the "missing" interval, the one fewer that are required for an intersection here.
We may observe that the latter kind of point, the coinciding-''zero''-damage points — those where damage graphs intersect on the zero-damage floor — may seem to be less likely candidates for minimax tunings, considering that by the nature of being on the zero-damage floor, where no target-interval's damage could possibly be any lower, there's almost certainly some target-interval with higher damage (whose damage is still increasing in one direction or another). And this can clearly be seen on the diagram we included a bit earlier. However, as we'll find in the later section about tie-breaking, and hinted at in an asterisked comment earlier, these points are often important for tie-breaking between tunings which are otherwise tied with each other when it comes to those higher-up damages (i.e. at least one direction, a higher-up damage is neither going up nor going down, such as along an intersection of two damage graphs whose creases are parallel).
===Generalizing to higher dimensions: counts of target-intervals required to make the points===
Another difference between the specific zero-damage points and general coinciding-damage points is that zero-damage points require one fewer target-interval damage graph to intersect in order to produce them. That's because a hyper-V's crease along the zero-damage floor has one fewer dimension than the hyper-V itself.
Perhaps this idea is best understood by explaining separately, for specific familiar dimensions of tuning damage space:
* In 3D tuning damage space, for every hyper-V, the main part of each of its two "wings" is a plane, and we know that it takes two intersecting planes to reduce us to a line, and three intersecting planes to reduce that line further to a single point. But each hyper-V's crease is already a line, so it only takes two intersecting hyper-V creases to reduce us to a point.
* In 2D tuning damage space, each wing of a hyper-V is a line, and it takes two intersecting lines to make a point. But each hyper-V's crease is ''already'' a single point, so we don't even need any intersections here to find points of possible minimax interest!
[[File:Cross to points.png|frameless|900x900px]]
In general, the number of target-intervals whose graphs will intersect at a point — i.e., their damages will coincide — is equal to the dimension of the tuning damage space. So in 3D tuning damage, we need three hyper-V's to intersect. Think of it this way: a 3D point has a coordinate in the format <math>(x,y,z)</math>, and we need one plane, one target-interval, for each element of that coordinate. But for intersections among creases along the floor, we only need one ''less'' than the dimensionality of the tuning damage space to specify a point; that's because we already know that one of the coordinates is 0.
The dimension of the tuning damage space will be equal to the count of generators plus one, or in other words, <math>r + 1</math>, where <math>r</math> is the [[rank]]. This is because tuning damage space has one dimension along the floor for each generator's tuning, and one additional dimension up off the floor for the damage amounts.
===Points vs. lines; tuning space vs. tuning damage space===
Throughout the discussion of this method, we may sometimes refer to "points" and "tunings" almost interchangeably. We'll attempt to dispel some potential confusion.
In tuning damage space, a tuning corresponds with a vertical line, perpendicular to the zero damage floor. Any point on this line identifies this same tuning. If we took an aerial view on tuning damage space, looking straight down on it — as we do in the [[Dave_Keenan_%26_Douglas_Blumeyer%27s_guide_to_RTT:_tuning_fundamentals#Topographic_tuning_damage_graphs|topographic, contour style graphs]] these lines ''would'' look like points. Basically in this view, the only dimensions are for the generators, and the extra dimension for damage is collapsed. In other words, we go from tuning damage space back to simply tuning space.
So a 2D tuning damage space collapses to a 1D tuning space: a single line, a continuum of the single generator's size. And a 3D tuning damage space collapses to a 2D tuning space, with one generators' size per axis.
So what's tricky about this method in this regard is that to some extent we care about ''points'' in tuning damage space, because it's points where key intersections between tuning damage graphs come up. But when two such points fall on the same vertical line, they've identified the same exact tuning, and are thus redundant. So we should be careful to say these are the same ''tuning'', not the same ''point'', but occasionally it may make sense to call them the same ''point'' even if they're offset vertically in tuning damage space, because in tuning space they would be the same point.
It might seem wise to draw the vertical tuning lines that correspond with these points, but in general we've found that this is more noise than it's worth.
==How to gather coinciding-damage points==
===For a general coinciding-damage point===
The first step is to iterate over every combination of <math>r + 1</math> target-intervals, and for each of those combinations, look at all permutations of their relative [[Undirected_value#Direction|direction]]s. The rank <math>r</math> is the same as generator count in the basic case (later on we'll see how sometimes in this method it's different). And by "direction" we mean in the sense of "[[undirected value]]", i.e. are they greater than or less than unison.
Each of these relative direction permutations of target-interval combinations (we can call these "ReDPOTICs", for short) corresponds with a coinciding-damage point, which means a different candidate generator tuning map <math>𝒈</math>. The candidate <math>𝒈</math> which causes the least damage to the target-intervals (according to the <math>∞</math>-mean, i.e. the max statistic) will be elected as our minimax tuning.
 
Let's look at an example. Suppose our target-intervals are <math>\frac32</math>, <math>\frac54</math>, and <math>\frac53</math>. And suppose we are working with a rank-1 temperament, i.e. with one generator.
So our combinations of intervals would be: <math>\{ \{ \frac32, \frac54 \}, \{ \frac32, \frac53 \} , \{ \frac54, \frac53 \} \}</math>.
And each of these three combinations has two relative direction permutations: one where both intervals have the same direction, and one where both intervals have different directions. For the first combination, that is, we'd look at both <math>\{ \frac32, \frac54 \}</math> and at <math>\{ \frac32, \frac45 \}</math>. As you can see, in the latter case, we've made one of the two intervals [[subunison]] (less than <math>\frac11</math>). To be clear, we're checking only permutations of ''relative'' direction here, by which we mean that there's no need to check the case where ''both'' intervals are subunison, or the case where which one of the two intervals is subunison and which one of them stays [[superunison]] is swapped.
We can see why we only worry about relative direction by explaining what we're going to do with these permutations of target-interval combinations: find the interval that is their product. The two permutations we've chosen above multiply to <math>\frac32 × \frac54 = \frac{15}{8}</math> and <math>\frac32 × \frac45 = \frac65</math>. Had we chosen the ''other'' two permutations, they'd've multiplied to <math>\frac23 × \frac45 = \frac{8}{15}</math> and <math>\frac23 × \frac54 = \frac56</math>. These second two intervals are simply the reciprocals of the first two results, and so in terms of tuning they are equivalent (technically speaking, we only care about undirected intervals, i.e. neither <math>\frac{15}{8}</math> nor <math>\frac{8}{15}</math> but rather <math>8:15</math>.
As for ''why'' we care about the intervals that are the products of these ReDPOTICs, we'll look into that in just a moment. In short, it has to do with our originally stated plan: to find places where target-intervals have coinciding amounts of damage. (If you're feeling bold, you might try to work out how this product could relate to that already; if not, don't worry, we'll eventually explain it all in detail.)
Keenan came up with a clever way to achieve this only-caring-about-relative-direction permutations effect: simply restrict the first element in each combination to the positive direction. This effortlessly eliminates exactly half of the possible permutations, namely, the ones that are reciprocals of all the others. Done.
===For a zero-damage point===
Gathering the zero-damage points is much more straightforward. We don't need to build a ReDPOTIC. We don't need to worry about ReD (relative direction), or permutations of (PO) anything. We only need to worry about TIC (target-interval combinations).
But remember, these aren't combinations of the same count of target-intervals. They have one less target-interval each. So let's call them "smaller target-interval combinations", or STICs.
For each STIC, then, we simply want each combination of <math>r</math> of our target-intervals. For our example, with <math>r=1</math>, that'd simply be <math>\{ \{ \frac32 \}, \{ \frac54 \} , \{ \frac53 \} \}</math>.
==How to build constraint matrices==
Once we've gathered all of our coinciding-damage points, both the general kind from ReDPOTICs and the zero-damage kind from STICs, we're ready to prepare '''constraint matrices'''. When we apply these to our familiar inequalities, we can convert them to solvable equalities. More on that in the next section, where we work through an example.
These constraint matrices are not themselves directly about ''optimizing'' tunings; they're simply about ''identifying'' tunings that meet these ReDPOTIC and STIC descriptions. Many of these tunings, as we saw [[#Points for finding damage minimaxes|in an earlier section]], are completely awful! But that's just how it goes. The optimum tuning is among these, but many other tunings technically fit the description we use to find them.
Let's call these matrices <math>K</math>, for "konstraint" ("C" is taken for a more widely important matrix in RTT, the [[comma basis]]).
===For a general coinciding-damage point===
 
With each of our general coinciding points, we can build a constraint matrix from its ReDPOTIC. Perhaps for some readers the approach could be best summed up near instantaneously by listing what these constraint matrices would be for the example we're going with so far:
<math>
\begin{array} {c}
\scriptsize 3/2 \\
\scriptsize 5/4 \\
\scriptsize 5/3
\end{array}
\left[ \begin{array} {c}
+1 \\
+1 \\
0
\end{array} \right]
,
\left[ \begin{array} {c}
+1 \\
{-1} \\
0
\end{array} \right]
,
\left[ \begin{array} {c}
+1 \\
0 \\
+1
\end{array} \right]
,
\left[ \begin{array} {c}
+1 \\
0 \\
{-1}
\end{array} \right]
,
\left[ \begin{array} {c}
0 \\
+1 \\
+1
\end{array} \right]
,
\left[ \begin{array} {c}
0 \\
+1 \\
{-1}
\end{array} \right]
</math>
Each constraint matrix is a <math>(k, r)</math>-shaped matrix, i.e. with one column for each generator and one row for each target. Every entry in these constraint matrices will have either a <math>0</math>, <math>+1</math>, or <math>-1</math>.
* If the value is <math>0</math>, it means that target-interval is not included in the combination.
* If the value is <math>+1</math>, we take the target-interval's superunison value.
* If the value is <math>-1</math>, we take the target-interval's subunison value.
Another way to look at these values is from the perspective of the product that ultimately we make from the combination of target-intervals: these values are the powers to which to raise each target-interval before multiplying a column up. So a power of +1 includes the target-interval as is, a power of -1 reciprocates it, and a power of 0 sends it to unison (so multiplying it in with the rest has no effect).
So, for example, the last constraint matrix here, [0 +1 -1], means that with our example target-interval list [<math>\frac32</math>, <math>\frac54</math>, and <math>\frac53</math>] we've got a superunison <math>\frac54</math> and a subunison <math>\frac53</math> (and no <math>\frac32</math>), so that's <math>\frac54 × \frac35 = \frac34</math>, or in other words, <math>(\frac32)^{0}(\frac54)^{+1}(\frac53)^{-1}</math>. Yes, we're still in suspense about what the purpose of these products is, but we'll address that soon.
Notice that each first nonzero entry in each constraint matrix is <math>+1</math>, per the previous section's point about effecting relative direction.
===For a zero-damage point===
For each of our zero-damage points we can build a constraint matrix from its STIC. Here those are:
<math>
\begin{array} {c}
\scriptsize 3/2 \\
\scriptsize 5/4 \\
\scriptsize 5/3
\end{array}
\left[ \begin{array} {c}
+1 \\
0 \\
0
\end{array} \right]
,
\left[ \begin{array} {c}
0 \\
+1 \\
0
\end{array} \right]
,
\left[ \begin{array} {c}
0 \\
0 \\
+1
\end{array} \right]
</math>
These tell us which interval will be unchanged in the corresponding tuning (take that as a hint for what will happen with the <math>K</math> for ReDPOTICs!).
Note that since, as we noted earlier, relative direction is irrelevant for zero-damage points, these matrices will never contain -1 entries. They will only ever contain 0 and +1.
==A simple example==
For our first overarching example, to help us intuit how this technique works, let's use a simplified example where our target-intervals are even simpler than the ones we looked at so far: just the primes, and thus <math>\mathrm{T} = \mathrm{T}_{\text{p}} = I</math>, an identity matrix we can ignore.
Let's also not weight damage so the weight matrix <math>W = I</math> too.
For our temperament, we'll go with the very familiar 12-ET, so <math>M</math> = {{map|12 19 28}}. Since this mapping is in the 5-prime-limit, our <math>𝒋</math> = 1200 × {{map|<math>\log_2(2)</math> <math>\log_2(3)</math> <math>\log_2(5)</math>}}. And since our mapping  is an equal temperament, our generator tuning map <math>𝒈</math> has only a single entry <math>g_1</math>.
===A system of approximations===
We'll be applying a constraint matrix to our by-now familiar approximation <math>𝒈M \approx 𝒋</math> in order to transform it from an ''approximation'' into an ''equality'', that is, to be able to change its ''approximately equals'' sign into an ''equals'' sign. This is how each of these constraints take us to a single solution.
<math>
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
g_1 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
M \\
\left[ \begin{array} {rrr}
12 & 19 & 28 \\
\end{array} \right]
\end{array}
\approx
\begin{array} {ccc}
𝒋 \\
\left[ \begin{array} {rrr}
1200\log_2(2) & 1200\log_2(3) & 1200\log_2(5) \\
\end{array} \right]
\end{array}
</math>
Another way to view a matrix expression like this<ref>were everything transposed, anyway; a superficial issue</ref> is as a system of multiple expressions — in this case, a system of approximations:
 
<math>
12g_1 \approx 1200\log_2(2) \\
19g_1 \approx 1200\log_2(3) \\
28g_1 \approx 1200\log_2(5)
</math>
One variable to satisfy three approximations… that's asking a lot of that one variable! We can see that if we tried to make these all equalities, it wouldn't be possible for all of them to be true at the same time:
<math>
12g_1 = 1200\log_2(2) \\
19g_1 = 1200\log_2(3) \\
28g_1 = 1200\log_2(5)
</math>
But this of course is the whole idea of tempering: when we approximate some number of primes with fewer generators, we can't approximate all of them exactly at once.
Constraints we apply to the problem, however, ''can'' simplify it to a point where there is an actual solution, i.e. where the count of equations matches the count of variables, AKA the count of generators.
===Apply constraint to system===
So let's try applying one of our constraint matrices to this equation. Suppose we get the constraint matrix [+1 +1 0]. (We may notice this happens to be one of those made from a ReDPOTIC, for a general coinciding-damage point.) This constraint matrix tells us that the target-interval combination is <math>\frac21</math> and <math>\frac31</math>, because those are the target-intervals corresponding to its nonzero entries. And both nonzero entries are <math>+1</math> meaning that both target-intervals are combined in the same direction. In other words, <math>\frac21 × \frac31 = \frac61</math> is going to have something to do with this (and we're finally about to find out what that is!).
We multiply both sides of our <math>𝒈M \approx 𝒋</math> style setup by that constraint, to produce <math>𝒈MK \approx 𝒋K</math>:
<math>
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
g_1 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
M \\
\left[ \begin{array} {rrr}
12 & 19 & 28 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
K \\
\left[ \begin{array} {rrr}
+1 \\
+1 \\
0
\end{array} \right]
\end{array}
\approx
\begin{array} {ccc}
𝒋 \\
\left[ \begin{array} {rrr}
1200\log_2(2) & 1200\log_2(3) & 1200\log_2(5) \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
K \\
\left[ \begin{array} {rrr}
+1 \\
+1 \\
0
\end{array} \right]
\end{array}
</math>
And now multiply that through, to get:
<math>
\begin{align}
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
g_1 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
MK \\
\left[ \begin{array} {rrr}
(12)(+1) + (19)(+1) + (28)(0) \\
\end{array} \right]
\end{array}
&\approx
\begin{array} {ccc}
𝒋K \\
\left[ \begin{array} {rrr}
(1200\log_2(2))(+1) + (1200\log_2(3))(+1) + (1200\log_2(5))(0) \\
\end{array} \right]
\end{array}
\\[15pt]
\left[ \begin{array} {rrr}
g_1 \\
\end{array} \right]
\left[ \begin{array} {rrr}
31 \\
\end{array} \right]
&=
\left[ \begin{array} {rrr}
1200\log_2(2) + 1200\log_2(3) \\
\end{array} \right]
\end{align}
</math>
So now we've simplified things down to a single equation with a single variable. All of our matrices are <math>(1,1)</math>-shaped, which is essentially the same thing as a scalar, so we can drop the braces around them and just treat them as such. And we'll swap the <math>31</math> and <math>g_1</math> around to put constants and variables in the conventional order, since scalar multiplication is commutative. Finally, we can use a basic logarithmic identity to consolidate what we have on the right-hand side:
<math>
31g_1 = 1200\log_2(6)
</math>
So with our constraint matrix, we've achieved the situation we needed, where we have a matching count of equations and generators. We can solve for this generator tuning:
<math>
g_1 = \dfrac{1200\log_2(6)}{31}
</math>
===The meaning of the ReDPOTIC product===
And that's our tuning, the tuning found at this coinciding-damage point.
It's a tuning which makes <math>\frac61</math> pure by dividing it into 31 equal parts.
In cents, our generator <math>g_1</math> is equal to about 100.063 ¢, and indeed 100.063 × 31 = 3101.955, which is exactly <math>1200 × \log_2(6)</math>.
And so that's what the constraint matrix's ReDPOTIC product <math>\frac61</math> had to do with things: this product is an ''unchanged-interval'' of this tuning (the only one, in fact).
But our original intention here was to find the tuning where <math>\frac21</math> and <math>\frac31</math> have coinciding damage. Well, it turns out this is an equivalent situation. If — according to this temperament's mapping {{map|12 19 28}} — it takes 12 steps to reach <math>\frac21</math> and also it takes 19 steps to reach <math>\frac31</math>, and that it therefore takes 31 steps to reach a <math>\frac61</math>, and it is also the case that <math>\frac61</math> is pure, then that implies that whatever error there is on <math>\frac21</math> must be the exact opposite of whatever damage there is on <math>\frac31</math>, since their errors apparently cancel out. So if their errors are exact opposites — negations — then their damages are the same. So we achieve coinciding target-interval damages via an unchanged-interval that they all relate to. Cue the success fanfare.
===Applying a constraint for a zero-damage point===
Let's also try applying a <math>K</math> for a zero-damage point, i.e. one that came from a STIC.
Suppose we get the constraint matrix [0 0 +1]. This constraint matrix tells us that <math>\frac51</math> will be unchanged, because that's the target-interval corresponding to its nonzero entry (all entries of these types of <math>K</math> will only be 0 or +1, recall).
We multiply both sides of our <math>𝒈M \approx 𝒋</math> style setup by that constraint, to produce <math>𝒈MK \approx 𝒋K</math>:
<math>
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
g_1 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
M \\
\left[ \begin{array} {rrr}
12 & 19 & 28 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
K \\
\left[ \begin{array} {rrr}
0 \\
0 \\
+1
\end{array} \right]
\end{array}
\approx
\begin{array} {ccc}
𝒋 \\
\left[ \begin{array} {rrr}
1200\log_2(2) & 1200\log_2(3) & 1200\log_2(5) \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
K \\
\left[ \begin{array} {rrr}
0 \\
0 \\
+1
\end{array} \right]
\end{array}
</math>
And now multiply that through, to get:
<math>
\begin{align}
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
g_1 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
MK \\
\left[ \begin{array} {rrr}
(12)(0) + (19)(0) + (28)(+1) \\
\end{array} \right]
\end{array}
&\approx
\begin{array} {ccc}
𝒋K \\
\left[ \begin{array} {rrr}
(1200\log_2(2))(0) + (1200\log_2(3))(0) + (1200\log_2(5))(+1) \\
\end{array} \right]
\end{array}
\\[15pt]
\left[ \begin{array} {rrr}
g_1 \\
\end{array} \right]
\left[ \begin{array} {rrr}
28 \\
\end{array} \right]
&=
\left[ \begin{array} {rrr}
1200\log_2(5) \\
\end{array} \right]
\\[15pt]
28g_1
&=
1200\log_2(5)
\\[15pt]
g_1
&=
\dfrac{1200\log_2(5)}{28}
\\[15pt]
g_1
&=
99.511
\end{align}
</math>
===Comparing the zero-damage method's unchanged-interval bases with the coinciding-damage method's constraint matrices===
If you recall, the zero-damage method for miniaverage tunings works by directly assembling unchanged-interval bases <math>\mathrm{U}</math> out of combinations of target-intervals. The coinciding-damage method here, however, indirectly achieves unchanged-interval bases via constraint matrices <math>K</math>. It does this both for the zero-damage points such as are used by the zero-damage method, as well as for the general coinciding-damage points that the zero-damage method does not use.
Though we note that even the general coinciding-damage points, where <math>r + 1</math> target-intervals coincide for some possibly nonzero damage, are equivalent to zero-damage points where <math>r</math> intervals coincide for zero damage; the difference is that these unchanged-intervals are not actually target-intervals, but rather products of pairs of directional permutations of them.
The zero-damage method might have been designed to use constraint matrices, but this would probably be overkill. When general coinciding-damage points are not needed, it's simpler to use unchanged-interval bases directly.
===Get damage lists===
From here, we basically just need to take ''every'' tuning we find from the linear solutions like this, and for each one, find its target-interval damage list, and then from that find its maximum damage.
In an earlier section's example we found a candidate tuning where <math>g_1 = \frac{1200\log_2(6)}{31} \approx 100.0632</math>, so we could check damages for this one using our familiar formula:
<math>
\textbf{d} = |\,𝒈M\mathrm{T}W - 𝒋\mathrm{T}W\,|
</math>
And we said that both <math>\mathrm{T}</math> and <math>W</math> are identity matrices to simplify things so we can get rid of those.
<math>
\textbf{d} = |\,𝒈M - 𝒋\,|
</math>
And now substitute in the 100.0632:
<math>
\textbf{d} =
\Large |
\normalsize
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
100.0632 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
M \\
\left[ \begin{array} {rrr}
12 & 19 & 28 \\
\end{array} \right]
\end{array}
-
\begin{array} {ccc}
𝒋 \\
\left[ \begin{array} {rrr}
1200.000 & 1901.955 & 2786.314 \\
\end{array} \right]
\end{array}
\Large |
</math>
Anyway, that's enough busywork for now. You can work that out if you like, and then you'll have to work it out in the same way for every single candidate tuning.
You'll end up with a ton of possible damage lists <math>\textbf{d}</math>, one for each generator tuning <math>𝒈</math> (the <math>K</math> have been transposed here to fit better):
<math>
\begin{array} {c}
\left[ \begin{array} {rrr} +1 & +1 &  0 \end{array} \right] & 𝒈_1 = \left[ \begin{array} {rrr} 100.063 \end{array} \right] & \textbf{d}_1 = \left[ \begin{array} {rrr} 0.757 &  0.757 & 15.452 \end{array} \right] \\
\left[ \begin{array} {rrr} +1 & {-1} &  0 \end{array} \right] & 𝒈_2 = \left[ \begin{array} {rrr} 100.279 \end{array} \right] & \textbf{d}_2 = \left[ \begin{array} {rrr}  3.351 &  3.351 & 21.506 \end{array} \right] \\
\left[ \begin{array} {rrr} +1 &  0 &  +1 \end{array} \right] & 𝒈_3 = \left[ \begin{array} {rrr}  99.657 \end{array} \right] & \textbf{d}_3 = \left[ \begin{array} {rrr}    4.106 & 8.456 & 4.106 \end{array} \right] \\
\left[ \begin{array} {rrr} +1 &  0 & {-1} \end{array} \right] & 𝒈_4 = \left[ \begin{array} {rrr}  99.144 \end{array} \right] & \textbf{d}_4 = \left[ \begin{array} {rrr}  10.265 & 18.208 & 10.265 \end{array} \right] \\
\left[ \begin{array} {rrr} 0 &  +1 &  +1 \end{array} \right] & 𝒈_5 = \left[ \begin{array} {rrr}  99.750 \end{array} \right] & \textbf{d}_5 = \left[ \begin{array} {rrr} 2.995 & 6.697 &  6.697  \end{array} \right] \\
\left[ \begin{array} {rrr} 0 & +1 & {-1} \end{array} \right] & 𝒈_6 = \left[ \begin{array} {rrr}  98.262 \end{array} \right] & \textbf{d}_6 = \left[ \begin{array} {rrr} 20.855 & 34.976 & 34.976 \end{array} \right] \\
\left[ \begin{array} {rrr} +1 &  0 &  0 \end{array} \right] & 𝒈_7 = \left[ \begin{array} {rrr} 100.000 \end{array} \right] & \textbf{d}_7 = \left[ \begin{array} {rrr} 0.000  &  1.955 &  13.686\end{array} \right] \\
\left[ \begin{array} {rrr} 0 & +1 &  0 \end{array} \right] & 𝒈_8 = \left[ \begin{array} {rrr} 100.103 \end{array} \right] & \textbf{d}_8 = \left[ \begin{array} {rrr}  1.235 &  0.000 & 16.567 \end{array} \right] \\
\left[ \begin{array} {rrr} 0 &  0 & +1 \end{array} \right] & 𝒈_9 = \left[ \begin{array} {rrr}  99.511 \end{array} \right] & \textbf{d}_9 = \left[ \begin{array} {rrr}  5.866 & 11.242 & 0.000 \end{array} \right] \\
\end{array}
</math>
The first six of these are from ReDPOTICs, for general coinciding-damage points. The last three are from STICs, for zero-damage points.
For each damage list, we can find the coinciding damages. In the first tuning, it's the first two target-intervals' damages, both with <math>0.757</math>. In the fifth tuning, it's the second and third target-intervals' damages, both with <math>6.697</math>. Etcetera. Note that these coinciding damages are not necessarily the ''max'' damages of the tuning; for example, the third tuning shows the first and third target-intervals both equal to <math>4.106</math> damage, but the second interval has more than twice that, at <math>8.456</math> damage. That's fine. In many cases, in fact, the tuning we ultimately want is one of these where the coinciding damages are not the max damages.
===Identify minimax===
In order to identify the minimax is generally pretty straightforward. We gather up all the maxes. And pick their min. That's the min-i-max.
So here's the maxes:
<math>
\begin{array} {c}
𝒈_1 = \left[ \begin{array} {rrr} 100.063 \end{array} \right] & \text{max}(\textbf{d}_1) = 15.452 \\
𝒈_2 = \left[ \begin{array} {rrr} 100.279 \end{array} \right] & \text{max}(\textbf{d}_2) = 21.506 \\
𝒈_3 = \left[ \begin{array} {rrr}  99.657 \end{array} \right] & \text{max}(\textbf{d}_3) = 8.456 \\
𝒈_4 = \left[ \begin{array} {rrr}  99.144 \end{array} \right] & \text{max}(\textbf{d}_4) = 18.208 \\
𝒈_5 = \left[ \begin{array} {rrr}  99.750 \end{array} \right] & \text{max}(\textbf{d}_5) = 6.697 \\
𝒈_6 = \left[ \begin{array} {rrr}  98.262 \end{array} \right] & \text{max}(\textbf{d}_6) = 34.976 \\
𝒈_7 = \left[ \begin{array} {rrr} 100.000 \end{array} \right] & \text{max}(\textbf{d}_7) = 13.686 \\
𝒈_8 = \left[ \begin{array} {rrr} 100.103 \end{array} \right] & \text{max}(\textbf{d}_8) = 16.567 \\
𝒈_9 = \left[ \begin{array} {rrr}  99.511 \end{array} \right] & \text{max}(\textbf{d}_9) = 11.242 \\
\end{array}
</math>
Out of these maximum values, 6.697 is the minimum. So that's our minimax tuning, <math>𝒈_5</math>, where the generator is 99.750 ¢ and the max damage to any of our target-intervals is 6.697 ¢(U).
Had there been a tie here, i.e. had some other tuning besides <math>𝒈_5</math> also had 6.697 ¢ for its maximum damage, such that more than one tuning tied for minimax, then we would need to move on to tie-breaking. That gets very involved, so we'll look at that in detail in a later section..
==A bigger example==
The rank-1 temperament case we've just worked through, which has just one generator, was a great introduction, but a bit too simple to demonstrate some of the ideas we want to touch upon here.
* Some aspects of the constraint matrices require multiple generators in order to illustrate effectively.
* And we didn't demonstrate with weighting yet.
* And we didn't demonstrate with a more interesting target-interval set yet.
* And we didn't compute an exact solution via generator embedding yet.
Dang!
So let's work through another example, this time of
* a rank-3 temperament,
* using complexity-weight damage,
* a more interesting target-interval set,
* and get our answer in the form of a generator embedding.
===Prepare constraint matrix===
If we have three generators, we will have ''many'' coinciding-damage points, each one corresponding to its own constraint matrix <math>K</math>. For this example, we're not going to bother showing all of them. It would be way too much to show. Let's just follow the logic from start to finish with a single constraint matrix.
Let's suppose our target-interval list is <math>\{ \frac65, \frac75, \frac85, \frac95, \frac76, \frac43, \frac32, \frac87, \frac97, \frac98 \}</math>. We've labeled each of the rows of our <math>K</math> here with its corresponding target-interval:
<math>
\begin{array} {rrr}
\scriptsize{6/5} \\
\scriptsize{7/5} \\
\scriptsize{8/5} \\
\scriptsize{9/5} \\
\scriptsize{7/6} \\
\scriptsize{4/3} \\
\scriptsize{3/2} \\
\scriptsize{8/7} \\
\scriptsize{9/7} \\
\scriptsize{9/8} \\
\end{array}
\left[ \begin{array} {rrr}
0 & 0 & 0 \\
+1 & +1 & +1 \\
+1 & 0 & 0 \\
0 & {-1} & 0 \\
0 & 0 & 0 \\
0 & 0 & {-1} \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{array} \right]
</math>
As we can see, this is one of the ReDPOTIC types of constraints, for a general coinciding-damage point. (We won't work through a STIC type for this example; there's actually nothing particularly helpful that we don't already understand that would be illustrated by that.)
So this constraint matrix makes three statements:
# The first column tells us that the (possibly-weighted) errors for <math>\frac75</math> and <math>\frac85</math> are opposites (same value but opposite sign), because the damage to <math>\frac75 × \frac85</math> is zero.
# The second column tells us that the (possibly-weighted) errors for <math>\frac75</math> and <math>\frac95</math> are identical, because the damage to <math>\frac75 × \frac59</math> is zero.
# The third column tells us that the (possibly-weighted) errors for <math>\frac75</math> and <math>\frac43</math> are identical, because the damage to <math>\frac75 × \frac34</math> is zero.
Here's something important to observe that we couldn't confront yet with the simpler single-generator example. Note that while there is always one row of the constraint matrix for each generator, ''each row of the constraint matrix has no particular association with any one of the generators''. In other words, it wouldn't make sense for us to label the first column of this <math>K</math> with <math>g_1</math>, the second with <math>g_2</math>, and the third with <math>g_3</math> (or any other ordering of those); each column is as relevant to one of those generators as it is to any other. Any one of the generators may turn out to be the one which satisfies one of these constraints. Said another way, when we perform matrix multiplication between this <math>K</math> matrix and the <math>M\mathrm{T}W</math> situation, each row of <math>K</math> touches each row of <math>M\mathrm{T}W</math>, so <math>K</math>'s influence is exerted across the board.
Another thing to note is that we set up the constraint matrix so that there's one target-interval that has a non-zero entry in each row, and that this is also the ''first'' target-interval column with a non-zero entry, i.e. the one that's been anchored to the positive direction. As we can see, in our case, that target-interval is <math>\frac75</math>. Setting up our constraint matrix in this way is how we establish — using the transitive property of equality — that all four of these target-intervals with non-zero entries somewhere their column will have coinciding (equal) damages. Because if A's damage equals B's, and B's damage equals C's, then we also know that A's damage equals C's. And same for D. So we end up with A's damage = B's damage = C's damage = D's damage. All four have coinciding damage.
Eventually we want to multiply this constraint matrix by <math>M\mathrm{T}W</math> and by <math>\mathrm{T}W</math>. So let's look at those next.
===Prepare tempered and just sides of to-be equality===
For our mapping, let's use the [[mingen|minimal generator form]] of [[Breed_family#Breed|breed temperament]], and for weights, let's use complexity-weighted damage (<math>W = C</math>).
<math>
\scriptsize
\begin{array} {ccc}
M \\
\left[ \begin{array} {rrr}
1 & 1 & 1 & 2 \\
0 & 2 & 3 & 2 \\
0 & 0 & 2 & 1
\end{array} \right]
\end{array}
\begin{array} {ccc}
\mathrm{T} \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r|r}
1 & 0 & 3 & 0 & {-1} & 2 & {-1} & 3 & 0 & {-3} \\
1 & 0 & 0 & 2 & {-1} & {-1} & 1 & 0 & 2 & 2 \\
{-1} & {-1} & {-1} & {-1} & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 1 & 0 & 0 & {-1} & {-1} & 0 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
C \\
\text{diag}(\log_2(\left[ \begin{array} {rrr}
30 & 35 & 40 & 45 & 42 & 12 & 6 & 56 & 63 & 72 \\
\end{array} \right]))
\end{array}
</math>
And that resolves to the following:
<math>
\scriptsize
\begin{array} {ccc}
M\mathrm{T}C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & \log_2(35) & 2\log_2(40) & \log_2(45) & 0 & \log_2(12) & 0 & \log_2(56) & 0 & {-\log_2(72)} \\
{-\log_2(30)} & {-\log_2(35)} & {-3\log_2(40)} & \log_2(45) & 0 & {-2\log_2(12)} & 2\log_2(6) & {-2\log_2(56)} & 2\log_2(63) & 4\log_2(72) \\
{-2\log_2(30)} & {-\log_2(35)} & {-2\log_2(40)} & {-2\log_2(45)} & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 \\
\end{array} \right]
\end{array}
</math>
And what we've got on the other side of the equality is <math>\mathrm{T}W</math>. Note that we're not using <math>𝒋\mathrm{T}W</math> here, since we're shooting for a generator embedding <math>G</math> such that <math>G\mathrm{T}W \approx \mathrm{T}W</math>; in other words, we took <math>𝒋G\mathrm{T}W \approx 𝒋\mathrm{T}W</math> and canceled out the <math>𝒋</math> on both sides.
<math>
\scriptsize
\begin{array} {ccc}
\mathrm{T} \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r|r}
1 & 0 & 3 & 0 & {-1} & 2 & {-1} & 3 & 0 & {-3} \\
1 & 0 & 0 & 2 & {-1} & {-1} & 1 & 0 & 2 & 2 \\
{-1} & {-1} & {-1} & {-1} & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 1 & 0 & 0 & {-1} & {-1} & 0 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
C \\
\text{diag}(\log_2(\left[ \begin{array} {rrr}
30 & 35 & 40 & 45 & 42 & 12 & 6 & 56 & 63 & 72 \\
\end{array} \right]))
\end{array}
</math>
And that resolves to the following:
<math>
\begin{array} {ccc}
\mathrm{T}C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & 0 & \log_2(40) & 0 & {-\log_2(42)} & 2\log_2(12) & {-\log_2(6)} & 3\log_2(56) & 0 & {-3\log_2(72)} \\
\log_2(30) & 0 & 0 & 2\log_2(45) & {-\log_2(42)} & {-\log_2(12)} & \log_2(6) & 0 & 2\log_2(63) & 2\log_2(72) \\
{-\log_2(30)} & {-\log_2(35)} & {-\log_2(40)} & {-\log_2(45)} & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & \log_2(35) & 0 & 0 & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 \\
\end{array} \right]
\end{array}
</math>
===Apply constraint===
Now we've got to constrain both sides of the problem. First the left side:
<math>
\scriptsize
\begin{array} {ccc}
M\mathrm{T}C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & \log_2(35) & 2\log_2(40) & \log_2(45) & 0 & \log_2(12) & 0 & \log_2(56) & 0 & {-\log_2(72)} \\
{-\log_2(30)} & {-\log_2(35)} & {-3\log_2(40)} & \log_2(45) & 0 & {-2\log_2(12)} & 2\log_2(6) & {-2\log_2(56)} & 2\log_2(63) & 4\log_2(72) \\
{-2\log_2(30)} & {-\log_2(35)} & {-2\log_2(40)} & {-2\log_2(45)} & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
K \\
\left[ \begin{array} {rrr}
0 & 0 & 0 \\
+1 & +1 & +1 \\
+1 & 0 & 0 \\
0 & {-1} & 0 \\
0 & 0 & 0 \\
0 & 0 & {-1} \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{array} \right]
\end{array}
→ \\
\begin{array} {c}
M\mathrm{T}CK \\
\left[ \begin{array} {c}
\log_2(35·40^2) & {-\log_2(\frac{45}{35})} & \log_2(\frac{35}{12}) \\
{-\log_2(35·40^3)} & {-\log_2(35·45)} & \log_2(\frac{12^2}{35}) \\
{-\log_2(35·40^2)} & \log_2(\frac{45^2}{35}) & {-\log_2(35)} \\
\end{array} \right]
\end{array}
</math>
And now the right side:
<math>
\scriptsize
\begin{array} {ccc}
\mathrm{T}C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & 0 & \log_2(40) & 0 & {-\log_2(42)} & 2\log_2(12) & {-\log_2(6)} & 3\log_2(56) & 0 & {-3\log_2(72)} \\
\log_2(30) & 0 & 0 & 2\log_2(45) & {-\log_2(42)} & {-\log_2(12)} & \log_2(6) & 0 & 2\log_2(63) & 2\log_2(72) \\
{-\log_2(30)} & {-\log_2(35)} & {-\log_2(40)} & {-\log_2(45)} & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & \log_2(35) & 0 & 0 & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
K \\
\left[ \begin{array} {rrr}
0 & 0 & 0 \\
+1 & +1 & +1 \\
+1 & 0 & 0 \\
0 & {-1} & 0 \\
0 & 0 & 0 \\
0 & 0 & {-1} \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{array} \right]
\end{array}
→ \\
\begin{array} {c}
\mathrm{T}CK \\
\left[ \begin{array} {c}
\log_2(40^3) & 0 & {-\log_2(12^2)} \\
0 & {-\log_2(45^2)} & \log_2(12) \\
{-\log_2(35·40)} & \log_2(\frac{45}{35}) & {-\log_2(35)} \\
\log_2(35) & \log_2(35) & \log_2(35) \\
\end{array} \right]
\end{array}
</math>
So now we can put them together as an equality, making sure to include the generator embedding that we're solving for on the left-hand side:
<math>
\small
\begin{array} {c}
G \\
\left[ \begin{array} {c}
g_{11} & g_{12} & g_{13} \\
g_{21} & g_{22} & g_{23} \\
g_{31} & g_{32} & g_{33} \\
g_{41} & g_{42} & g_{43} \\
\end{array} \right]
\end{array}
\begin{array} {c}
M\mathrm{T}CK \\
\left[ \begin{array} {c}
\log_2(35·40^2) & {-\log_2(\frac{45}{35})} & \log_2(\frac{35}{12}) \\
{-\log_2(35·40^3)} & {-\log_2(35·45)} & \log_2(\frac{12^2}{35}) \\
{-\log_2(35·40^2)} & \log_2(\frac{45^2}{35}) & {-\log_2(35)} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\mathrm{T}CK \\
\left[ \begin{array} {c}
\log_2(40^3) & 0 & {-\log_2(12^2)} \\
0 & {-\log_2(45^2)} & \log_2(12) \\
{-\log_2(35·40)} & \log_2(\frac{45}{35}) & {-\log_2(35)} \\
\log_2(35) & \log_2(35) & \log_2(35) \\
\end{array} \right]
\end{array}
</math>
===Solve for generator embedding===
To solve for <math>G</math>, we take the inverse of <math>M\mathrm{T}CK</math> and right-multiply both sides of the equation by it. This will cancel it out on the left-hand side, isolating <math>G</math>:
<math>
\begin{align}
GM\mathrm{T}CK &= \mathrm{T}CK \\
GM\mathrm{T}CK(M\mathrm{T}CK)^{-1} &= \mathrm{T}CK(M\mathrm{T}CK)^{-1} \\
G\cancel{M\mathrm{T}CK}\cancel{(M\mathrm{T}CK)^{-1}} &= \mathrm{T}CK(M\mathrm{T}CK)^{-1} \\
G &= \mathrm{T}CK(M\mathrm{T}CK)^{-1}
\end{align}
</math>
And now we just multiply those two things on the right-hand side together:
<math>
\scriptsize
\begin{array} {c}
\mathrm{T}CK \\
\left[ \begin{array} {c}
\log_2(40^3) & 0 & {-\log_2(12^2)} \\
0 & {-\log_2(45^2)} & \log_2(12) \\
{-\log_2(35·40)} & \log_2(\frac{45}{35}) & {-\log_2(35)} \\
\log_2(35) & \log_2(35) & \log_2(35) \\
\end{array} \right]
\end{array}
\begin{array} {c}
(M\mathrm{T}CK)^{-1} \\
\left[ \begin{array} {c}
3\log_2(35)\log_2(45) - \log_2(12)\log_2(\frac{405}{7}) &
\log_2(35)\log_2(45) - \log_2(12)\log_2(\frac{405}{7}) &
2\log_2(35)\log_2(45) - \log_2(12)\log_2(\frac{18225}{7}) \\
-\log_2(35)\log_2(40) - \log_2(144)\log_2(56000) &
-\log_2(12)\log_2(56000) &
-\log_2(35)\log_2(40) - \log_2(12)\log_2(1400) \\
-8\log_2(40)\log_2(45) - \log_2(35)\log_2(\frac{18225}{8}) &
-\log_2(45)\log_2(56000) &
-\log_2(40)\log_2(45) - \log_2(35)\log_2(\frac{405}{8}) \\
\end{array} \right] \\
\hline
\log_2(\frac98)\log_2(12)\log_2(35) - \log_2(40)\log_2(45)\log_2(\frac{20736}{35})
\end{array}
</math>
To find <math>G</math>.
<math>
\scriptsize
\begin{array} {c}
G \\
\left[ \begin{array} {c}
g_{11} & g_{12} & g_{13} \\
g_{21} & g_{22} & g_{23} \\
g_{31} & g_{32} & g_{33} \\
g_{41} & g_{42} & g_{43} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\mathrm{T}CK(M\mathrm{T}CK)^{-1} \\
\left[ \begin{array} {c}
\begin{array} {c}
9\log_2(35)\log_2(40)\log_2(45) \\
+ 2\log_2(12)\log_2(35)\log_2(\frac{18225}{8}) \\
+ 2\log_2(12)\log_2(40)\log_2(86821875)
\end{array} & &
\begin{array} {c}
3\log_2(35)\log_2(40)\log_2(45) \\
- 3\log_2(12)\log_2(40)\log_2(\frac{405}{7}) \\
+ 2\log_2(12)\log_2(45)\log_2(56000)
\end{array} & &
\begin{array} {c}
6\log_2(35)\log_2(40)\log_2(45) \\
+ 2\log_2(35)\log_2(12)\log_2(\frac{405}{8}) \\
+ \log_2(12)\log_2(40)\log_2(1929375)
\end{array} \\[9pt]
\begin{array} {c}
2\log_2(45)\log_2(35)\log_2(40) \\
+ 3\log_2(45)\log_2(144)\log_2(56000) \\
- 8\log_2(12)\log_2(40)\log_2(45) \\
- \log_2(12)\log_2(35)\log_2(\frac{18225}{8})
\end{array} & &
\begin{array} {c}
\log_2(12)\log_2(45)\log_2(56000)
\end{array} & &
\begin{array} {c}
\log_2(35)\log_2(40)\log_2(45) \\
- 5\log_2(12)\log_2(40)\log_2(45) \\
- \log_2(12)\log_2(35)\log_2(\frac{405}{8}) \\
- 2\log_2(12)\log_2(45)\log_2(1400)
\end{array} \\[9pt]
\begin{array} {c}
\log_2(144)\log_2(40)\log_2(\frac{405}{7}) \\
- \log_2(144)\log_2(45)\log_2(56000) \\
+ 4\log_2(35)\log_2(40)\log_2(45) \\
+ \log_2(35)\log_2(144)\log_2(3240000)
\end{array} & &
\begin{array} {c}
\log_2(12)\log_2(40)\log_2(\frac{405}{7}) \\
- \log_2(12)\log_2(45)\log_2(56000) \\
- \log_2(35)\log_2(40)\log_2(45) \\
+ \log_2(35)\log_2(45)\log_2(56000) \\
+ \log_2(12)\log_2(35)\log_2(3240000) \\
- \log_2(35)\log_2(35)\log_2(45)
\end{array} & &
\begin{array} {c}
\log_2(12)\log_2(40)\log_2(\frac{18225}{7}) \\
+ 2\log_2(35)\log_2(40)\log_2(45) \\
+ \log_2(12)\log_2(35)\log_2(3645000) \\
- \log_2(12)\log_2(45)\log_2(1400)
\end{array} \\[9pt]
\begin{array} {c}
-8\log_2(35)\log_2(40)\log_2(45) \\
-\log_2(35)\log_2(144)\log_2(3240000)
\end{array} & &
\begin{array} {c}
\log_2(35)\log_2(35)\log_2(45) \\
- \log_2(35)\log_2(45)\log_2(5600) \\
- \log_2(12)\log_2(35)\log_2(3240000)
\end{array} & &
\begin{array} {c}
-\log_2(35)\log_2(40)\log_2(45) \\
-\log_2(12)\log_2(35)\log_2(3645000)
\end{array}
\end{array}\right] \\
\hline
\log_2(\frac98)\log_2(12)\log_2(35) - \log_2(40)\log_2(45)\log_2(\frac{20736}{35})
\end{array}
</math>
Egads!
===Convert generator embedding to generator map===
Taking the values from the first column of this, we can find that our first generator, <math>\textbf{g}_1</math>, is exactly equal to:
<math>
\small
\sqrt[
\log_2(\frac98)\log_2(12)\log_2(35) - \log_2(40)\log_2(45)\log_2(\frac{20736}{35})
]
{
\rule[15pt]{0pt}{0pt}
2^{(
9\log_2(35)\log_2(40)\log_2(45) + 2\log_2(12)\log_2(35)\log_2(\frac{18225}{8}) + 2\log_2(12)\log_2(40)\log_2(86821875)
)}
}
\hspace{1mu} \overline{\rule[15pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[15pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[15pt]{0pt}{0pt}}
\\
\quad\quad\quad
\overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu}
\overline{\rule[11pt]{0pt}{0pt}
·
3^{(
2\log_2(45)\log_2(35)\log_2(40) + 3\log_2(45)\log_2(144)\log_2(56000) - 8\log_2(12)\log_2(40)\log_2(45) - \log_2(12)\log_2(35)\log_2(\frac{18225}{8})
)}
}
\hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}}
\\
\quad\quad\quad
\overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu}
\overline{\rule[11pt]{0pt}{0pt}
·
5^{(
\log_2(144)\log_2(40)\log_2(\frac{405}{7}) - \log_2(144)\log_2(45)\log_2(56000) + 4\log_2(35)\log_2(40)\log_2(45) + \log_2(35)\log_2(144)\log_2(3240000)
)}
}
\hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}}
\\
\quad\quad\quad
\overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu} \overline{\rule[11pt]{0pt}{0pt}} \hspace{1mu}
\overline{\rule[11pt]{0pt}{0pt}
·
7^{(
{-(8\log_2(35)\log_2(40)\log_2(45) + \log_2(35)\log_2(144)\log_2(3240000))}
)}
}
</math>
Clearly, such an exact value is of dubious interest as is. But it may be nice for some types of personalities (including the present author) to know, theoretically speaking, that this expression gives us the truly optimal size of this generator, where the general solution would only find a close approximation. It would look a little less insane if we were using unity-weight damage, or our complexity didn't include logarithmic values.
At some point we do need to convert this to an inexact decimal form to make any practical use of it. But we should wait until the last possible moment, so as to not let rounding errors compound.
Well, this is that last possible moment. So this value works out to about 1.99847, just shy of 2, which is great because it's supposed to be a tempered octave. In cents it is 1198.679 ¢.
We won't show the exact exponential form for the other generators <math>\textbf{g}_2</math> and <math>\textbf{g}_3</math>; the point has been made. The practical thing to do is simply multiply this <math>G</math> by <math>𝒋</math>, to find <math>𝒈</math>. We'll go ahead and show things in decimals now:
<math>
\begin{array} {ccc}
𝒋 \\
\left[ \begin{array} {rrr}
1200.000 & 1901.955  & 2786.314 & 3368.826 \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
G \\
\left[ \begin{array} {r}
10.156 & 2.701 & 5.530 \\
1.831 & 1.140 & 0.306 \\
3.662 & 1.281 & 2.612 \\
{-7.325} & {-2.561} & {-4.224} \\
\end{array} \right]
\end{array}
=
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
1198.679 & 350.516 & 265.929 \\
\end{array} \right]
\end{array}
</math>
And so that's the tuning (in cents) we find for this constraint matrix! (But remember, this is only one of many candidates for the minimax tuning here — it is not necessarily the actual minimax tuning. We picked this particular ReDPOTIC / constraint matrix / coinciding-damage point / candidate tuning example basically at random.)
===System of equations style===
In our simpler example, we looked at our matrix equation as a system of equations. It may be instructive to consider this related approach toward this result.
Suppose instead that rather than going for a ''matrix'' solution in <math>G</math>, we went straight for a single ''vector'', our generator tuning map <math>𝒈</math>. In other words, we don't save the conversion from <math>G</math> to <math>𝒈</math> via <math>𝒋</math> to the end; we build this into our solution. So rewind back to before we did a matrix inverse, and instead we multiply each side of the equation by <math>𝒋</math>. The <math>𝒋G</math> goes to <math>𝒈</math>, and we just go ahead and multiply its entries <math>g_1</math>, <math>g_2</math>, and <math>g_3</math> up with everything else:
<math>
\begin{array} {ccc}
𝒈M\mathrm{T}CK \\
\left[ \begin{array} {rrr}
15.773g_1 & {-0.363g_1} & 1.544g_1 \\
{-21.095g_2} & {-10.621g_2} & 2.041g_2 \\
{-15.773g_3} & 5.854g_3 & {-5.129g_3} \\
\end{array} \right]
\end{array}
=
\begin{array} {ccc}
𝒋\mathrm{T}CK \\
\left[ \begin{array} {rrr}
7318.250 & {-2600.619} & 1202.397 \\
\end{array} \right]
\end{array}
</math>
Now the columns of this can be viewed as a system of equations (so we essentially transpose everything to get this new look):
<math>
\begin{array} {r}
15.773g_1 & + & {-21.095g_2} & + & {-15.773g_3} & = & 7318.250 \\
{-0.363}g_1 & + & {-10.621g_2} & + & 5.854g_3 & = & {-2600.619} \\
1.544g_1 & + & 2.041g_2 & + & {-5.129g_3} & = & 1202.397 \\
\end{array}
</math>
These can all be true at once now (again, before the constraint, they couldn't). The values come out to:
<math>
g_1 = 1198.679 \\
g_2 = 350.516 \\
g_3 = 265.929
</math>
This matches what we found for <math>𝒈</math> via solving for <math>G</math>.
The system of equations style is how Keenan's original algorithm works. The matrix inverse style is Dave's modification which may be less obvious how it works, but is capable of solving for generator embeddings.
===Sanity-check===
We can sanity check it if we like. This was supposed to find us the tuning of breed temperament where <math>\frac75 × \frac85 = \frac{56}{25}</math>, <math>\frac75 × \frac59 = \frac79</math> (or we might prefer to think of it in its superunison form, <math>\frac97</math>), and <math>\frac75 × \frac34 = \frac{21}{20}</math> are pure.
Well, breed maps <math>\textbf{i}_1 = \frac{56}{25}</math> {{vector|3 0 -2 1}} to the generator-count vector <math>\textbf{y}_1</math> {{rket|3 -4 -3}}. And <math>𝒈\textbf{y}_1</math> looks like {{rbra|1198.679 350.516 265.929}}{{rket|3 -4 -3}} <math>= 1198.679 × 3 + 350.516 x {-4} + 265.929 × {-3} = 1396.186</math>. Its JI size is <math>1200 × \log_2(\frac{56}{25}) = 1396.198</math> which is pretty close; close enough, perhaps, given all the rounding errors we were accumulating.
And breed maps <math>\textbf{i}_2 = \frac{9}{7}</math> {{vector|0 2 0 -1}} to the generator-count vector <math>\textbf{y}_2</math> {{rket|0 2 -1}}. And <math>𝒈\textbf{y}_2</math> looks like {{rbra|1198.679 350.516 265.929}}{{rket|0 2 -1}} <math>= 1198.679 × 0 + 350.516 × 2 + 265.929 × {-1} = 435.103</math>. Its JI size is <math>1200 × \log_2(\frac97) = 435.084</math>, also essentially pure.
Finally breed maps <math>\textbf{i}_3 = \frac{21}{20}</math> {{vector|-2 1 -1 1}} to the generator-count vector <math>\textbf{y}_3</math> {{rket|0 1 -1}}. And <math>𝒈\textbf{y}_3</math> looks like {{rbra|1198.679 350.516 265.929}}{{rket|0 1 -1}} <math>= 1198.679 × 0 + 350.516 × 1 + 265.929 × {-1} = 84.587</math>. Its JI size is <math>1200 × \log_2(\frac{21}{20}) = 84.467</math>, again, essentially pure.
===Relation to only-held intervals method and zero-damage method===
Note that this <math>G = \mathrm{T}CK(M\mathrm{T}CK)^{-1}</math> formula is the same thing as the <math>G = U(MU)^{-1}</math> formula used for the [[#only held-intervals method]]; it's just that formula where <math>\mathrm{U} = \mathrm{T}CK</math>. In other words, we will find a basis for the unchanged intervals of this tuning of this temperament to be:
<math>
\begin{array} {c}
\mathrm{U} = \mathrm{T}CK \\
\left[ \begin{array} {c}
\log_2(40^3) & 0 & {-\log_2(12^2)} \\
0 & {-\log_2(45^2)} & \log_2(12) \\
{-\log_2(35·40)} & \log_2(\frac{45}{35}) & {-\log_2(35)} \\
\log_2(35) & \log_2(35) & \log_2(35) \\
\end{array} \right]
\end{array}
</math>
Owing to our choice to weight our absolute error to obtain damage, these intervals are quite strange. Not only do we have non-integer entries in our prime-count vectors here, we've gone beyond the rational entries we often find for generator embeddings and unchanged-interval bases, etc. and now have ''irrational entries'' with freaking logarithms in them. So these aren't particularly insight-giving unchanged-intervals, but they are what they are.
So, in effect, the coinciding-damage method is fairly similar to the zero-damage method. Each point in either method's point set corresponds to an unchanged-interval basis <math>\mathrm{U}</math>. It is the case that for the zero-damage method the members of this <math>\mathrm{U}</math> are pulled directly from the target-interval set <math>\mathrm{T}</math>, whereas for the coinciding-damage method here, the members of each <math>\mathrm{U}</math> have a more complex relationship with the members of <math>\mathrm{T}</math> set, being products of relative direction pairs of them instead.
==With held-intervals==
When a tuning scheme has optimization power <math>p = ∞</math> and also specifies one or more held-intervals, we can adapt the coinciding-damage method to accommodate this. In short, we can no longer dedicate every generator toward our target-intervals; we must allocate one generator toward each interval to be held unchanged.
===Counts of target-intervals with held-intervals===
In the earlier section [[#Generalizing to higher dimensions: counts of target-intervals required to make the points]], we looked at how it generally takes <math>r + 1</math> target-interval damage graphs to intersect to make a point, but only <math>r</math> of them on the zero-damage floor.
When there are held-intervals, however, things get a little trickier.
Each additional held-interval added is like taking a cross-section through the tuning damage space, specifically, the cross-section wherever that interval is held unchanged. Tuning damage space is still <math>(r + 1)</math>-dimensional, but now we only care about a slice through that space, a slice with <math>h</math> fewer dimensions. That is, it'll be a <math>(r + 1 - h)</math>-dimensional slice. And within this slice, then, we only need <math>r + 1 - h</math> target-intervals' damages to coincide to make a point, and only <math>r  - h</math> of them to make a point on the floor.
For example, when tuning an octave-fifth form of meantone temperament, we'd know we'd be searching a 3D tuning damage space, with one floor axis for <math>g_1</math> in the vicinity of 1200 ¢ and the other floor axis for <math>g_2</math> in the vicinity of 701.955 ¢. But if we say it's a held-octave tuning we want, then while all of our target-interval's hyper-V's are still exactly as they were, fully occupying the three dimensions of this space, but now we only care about the 2D slice through it where <math>g_1 = 1200</math>.
In that very simple example, only one of the temperament's generators was involved in the mapped interval that the held-interval maps to, so the cross-section is conveniently perpendicular to the axis for that generator, and thus the tuning damage graph with reduced dimension is easy to prepare. However, if we had instead requested a held-{5/4}, then since that maps to {{rket|-2 4}}, using multiple different generators, then the cross-section will be diagonal across the floor, perpendicular to no generator axes.
===Modified constraint matrices===
We do this by changing our constraint matrices <math>K</math>; rather than building them to represent permutations of relative direction for combinations of <math>r + 1</math> target-intervals, instead we only combine <math>r + 1 - h</math> target-intervals for each of these constraint matrices, where <math>h</math> is the count of held-intervals. As a result of this, each <math>K</math> has <math>h</math> fewer columns than before — or at least it would, if we didn't replace these columns with <math>h</math> new columns, one for each of our <math>h</math> held-intervals. Remember, each of these constraint matrices gets multiplied together with other matrices that represent information about our temperament and tuning scheme — our targeted intervals, and their weights (if any) — in order to take a system of approximations (represented by matrices) and crunch it down to a smaller system of equalities (still represented by matrices) that can be automatically solved (using a matrix inverse). So, instead of these constraint matrices doing only a single job — enforcing that <math>r + 1</math> target-intervals receive coinciding damage, each constraint matrix now handles two jobs at once — enforcing that only <math>r + 1 - h</math> target-intervals receive coinciding damage, and that <math>h</math> held-intervals receive zero damage.
In order for the constraint matrices to handle their new second job, however, we must make further changes. The held-intervals must now be accessible in the other matrices that multiply together to form our solvable system of equations. In particular:
# We concatenate the target-interval list <math>\mathrm{T}</math> and the held-interval basis <math>\mathrm{H}</math> together to a new matrix <math>\mathrm{T}|\mathrm{H}</math>.
# We accordingly extend the weight matrix <math>W</math> diagonally so that matrix shapes work out for multiplication purposes, or said another way, so that each held-interval appended to <math>\mathrm{T}</math> gets matched up with a dummy weight.<ref>This weight is irrelevant, since these aren't really target-intervals, they're held-intervals, and so the damage to them must be 0; we can choose any value for this weight other than 0 and the effect will be the same, so we may as well choose 1).</ref>
===Prepare constraint matrix===
Let's demonstrate this by example. We'll revise the example we looked at in the earlier "bigger example" section, with 3 generators (<math>r = 3</math>) and 10 target-intervals (<math>k = 10</math>). The specific example constraint matrix we looked at, therefore, was an <math>(k, r)</math>-shaped matrix, which related <math>r + 1 = 4</math> of those target-intervals together with coinciding damage:
<math>
\begin{array} {rrr}
\scriptsize{6/5} \\
\scriptsize{7/5} \\
\scriptsize{8/5} \\
\scriptsize{9/5} \\
\scriptsize{7/6} \\
\scriptsize{4/3} \\
\scriptsize{3/2} \\
\scriptsize{8/7} \\
\scriptsize{9/7} \\
\scriptsize{9/8} \\
\end{array}
\left[ \begin{array} {rrr}
0 & 0 & 0 \\
+1 & +1 & +1 \\
+1 & 0 & 0 \\
0 & {-1} & 0 \\
0 & 0 & 0 \\
0 & 0 & {-1} \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
0 & 0 & 0 \\
\end{array} \right]
</math>
For a tuning scheme with <math>h = 1</math>, however, we can only get three target-intervals to have coinciding damage at the same time. So we'd never see this constraint matrix for such a scheme. Instead, any example constraint matrix we'd pick would only have two such rows. In order to keep working with something similar to this example, then, let's just drop the last column:
<math>
\begin{array} {rrr}
\scriptsize{6/5} \\
\scriptsize{7/5} \\
\scriptsize{8/5} \\
\scriptsize{9/5} \\
\scriptsize{7/6} \\
\scriptsize{4/3} \\
\scriptsize{3/2} \\
\scriptsize{8/7} \\
\scriptsize{9/7} \\
\scriptsize{9/8} \\
\end{array}
\left[ \begin{array} {rrr}
0 & 0  \\
+1 & +1 \\
+1 & 0 \\
0 & {-1} \\
0 & 0  \\
0 & 0 \\
0 & 0 \\
0 & 0 \\
0 & 0 \\
0 & 0 \\
\end{array} \right]
</math>
But we still want a third column; we still have <math>r = 3</math> generators in this example. But now we need to specify that one of these generators needs to accomplish the job of tuning our held-interval exactly. We do that by adding a column that's all zeros except for a single nonzero entry in the row for that held-interval (if it's not clear ''how'' this enforces that interval to be unchanged, don't worry; it will become clear in a later step when we translate this system of matrices to the system of linear equations which it is essentially shorthand notation for):
<math>
\begin{array} {rrr}
\scriptsize{6/5} \\[2pt]
\scriptsize{7/5} \\[2pt]
\scriptsize{8/5} \\[2pt]
\scriptsize{9/5} \\[2pt]
\scriptsize{7/6} \\[2pt]
\scriptsize{4/3} \\[2pt]
\scriptsize{3/2} \\[2pt]
\scriptsize{8/7} \\[2pt]
\scriptsize{9/7} \\[2pt]
\scriptsize{9/8} \\[2pt]
\style{background-color:#FFF200;padding:5px}{\scriptsize{5/3}} \\[2pt]
\end{array}
\left[ \begin{array} {rrr}
0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
+1 & +1 & \style{background-color:#FFF200;padding:5px}{0}\\
+1 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & {-1} & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} \\
\end{array} \right]
</math>
Oh, right — we didn't ''have'' a row for this held-interval yet. All the rows we had before were for our ''target''-intervals. No big deal, though. We just added an extra row for this, our ''held''-interval, and we can fill out the new entries it creates in the other columns with zeros.
===Modified tempered and just sides of to-be equality===
The consequences of adding this row are more far-reaching than our <math>K</math> matrices, however. Remember, these multiply with <math>M\mathrm{T}C</math> on the left-hand side of the equal sign and <math>\mathrm{T}C</math> on the right-hand side. So matrix shapes have to keep matching for matrix multiplication to remain possible. We just changed the shape of <math>K</math> from an <math>(k, r)</math>-shaped matrix to a <math>(k + h, r)</math>-shaped matrix. The shape of <math>M\mathrm{T}C</math> is <math>(r, k)</math> and the shape of <math>\mathrm{T}C</math> is <math>(d, k)</math>. So if we want these shapes to keep matching, we need to change them to <math>(r, k + h)</math> and <math>(d, k + h)</math>, respectively.
Now that's a rather dry way of putting it. Let's put it in more natural terms. We know what these additions to <math>M\mathrm{T}C</math> and <math>\mathrm{T}C</math> are about: they're the held-intervals that the new entries we added to the constraint matrices are referring to! In particular, we need to expand <math>\mathrm{T}</math> (the actual target-intervals we chose here are arbitrary and don't really matter for this example):
<math>
\begin{array} {ccc}
\mathrm{T} \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r|r}
1 & 0 & 3 & 0 & {-1} & 2 & {-1} & 3 & 0 & {-3} \\
1 & 0 & 0 & 2 & {-1} & {-1} & 1 & 0 & 2 & 2 \\
{-1} & {-1} & {-1} & {-1} & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 & 1 & 0 & 0 & {-1} & {-1} & 0 \\
\end{array} \right]
\end{array}
</math>
to include the held-intervals. We can just tack them on at the end. We said <math>h = 1</math>, that is, that we only have one held-interval, but we haven't picked what it is yet. This is also arbitrary for this example. How about we go with <math>\frac53</math>, with prime-count vector {{vector|0 -1 1 0}}:
<math>
\begin{array} {ccc}
\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}} \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r|r|r}
1 & 0 & 3 & 0 & {-1} & 2 & {-1} & 3 & 0 & {-3} & \style{background-color:#FFF200;padding:5px}{0} \\
1 & 0 & 0 & 2 & {-1} & {-1} & 1 & 0 & 2 & 2 & \style{background-color:#FFF200;padding:5px}{-1} \\
{-1} & {-1} & {-1} & {-1} & 0 & 0 & 0 & 0 & 0 & 0 & \style{background-color:#FFF200;padding:5px}{1} \\
0 & 1 & 0 & 0 & 1 & 0 & 0 & {-1} & {-1} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
</math>
We've got to extend <math>C</math> too. We can pick any weight we want, other than 0. You'll see why when we work out the system of equations in a moment):
<math>
\begin{array} {ccc}
C \\
\text{diag}(\log_2(\left[ \begin{array} {rrr}
30 & 35 & 40 & 45 & 42 & 12 & 6 & 56 & 63 & 72 & \style{background-color:#FFF200;padding:5px}{2} \\
\end{array} \right]))
\end{array}
</math>
(Note that the last entry appears as 2 here, because we placed the <math>\log_2</math> outside the array brackets.)
There's no need to mess with <math>M</math> here.
===Prepare tempered and just sides of to-be equality===
As before, let's work out <math>M\mathrm{T}C</math> and <math>\mathrm{T}C</math> separately, then constrain each of them with <math>K</math>, then put them together in a linear system of equations, solving for the generator tuning map <math>𝒈</math>. Though this time around, all occurrences of <math>\mathrm{T}</math> will be replaced with <math>\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}}</math>.
First, <math>M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})C</math>:
<math>
\scriptsize
\begin{array} {ccc}
M \\
\left[ \begin{array} {rrr}
1 & 1 & 1 & 2 \\
0 & 2 & 3 & 2 \\
0 & 0 & 2 & 1
\end{array} \right]
\end{array}
\begin{array} {ccc}
\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}} \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r|r|r}
1 & 0 & 3 & 0 & {-1} & 2 & {-1} & 3 & 0 & {-3} & \style{background-color:#FFF200;padding:5px}{0} \\
1 & 0 & 0 & 2 & {-1} & {-1} & 1 & 0 & 2 & 2 & \style{background-color:#FFF200;padding:5px}{-1} \\
{-1} & {-1} & {-1} & {-1} & 0 & 0 & 0 & 0 & 0 & 0 & \style{background-color:#FFF200;padding:5px}{1} \\
0 & 1 & 0 & 0 & 1 & 0 & 0 & {-1} & {-1} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
C \\
\text{diag}(\log_2(\left[ \begin{array} {rrr}
30 & 35 & 40 & 45 & 42 & 12 & 6 & 56 & 63 & 72 & \style{background-color:#FFF200;padding:5px}{2} \\
\end{array} \right]))
\end{array}
</math>
Which works out to:
<math>
\small
\begin{array} {ccc}
M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & \log_2(35) & 2\log_2(40) & \log_2(45) & 0 & \log_2(12) & 0 & \log_2(56) & 0 & {-\log_2(72)} & \style{background-color:#FFF200;padding:5px}{0} \\
{-\log_2(30)} & {-\log_2(35)} & {-3\log_2(40)} & \log_2(45) & 0 & {-2\log_2(12)} & 2\log_2(6) & {-2\log_2(56)} & 2\log_2(63) & 4\log_2(72) & \style{background-color:#FFF200;padding:5px}{1} \\
{-2\log_2(30)} & {-\log_2(35)} & {-2\log_2(40)} & {-2\log_2(45)} & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 & \style{background-color:#FFF200;padding:5px}{2} \\
\end{array} \right]
\end{array}
</math>
So that's the same as before, but with the extra column at the right, which is alone in having integer entries owing to its weight being the integer 1. What we're seeing there is that {{vector|0 -1 1 0}} maps to {{rket|0 1 2}} in this temperament, that's all.
Now, we do <math>(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})C</math>:
<math>
\small
\begin{array} {ccc}
\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}} \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r|r|r}
1 & 0 & 3 & 0 & {-1} & 2 & {-1} & 3 & 0 & {-3}
& \style{background-color:#FFF200;padding:5px}{0} \\
1 & 0 & 0 & 2 & {-1} & {-1} & 1 & 0 & 2 & 2
& \style{background-color:#FFF200;padding:5px}{-1} \\
{-1} & {-1} & {-1} & {-1} & 0 & 0 & 0 & 0 & 0 & 0
& \style{background-color:#FFF200;padding:5px}{1} \\
0 & 1 & 0 & 0 & 1 & 0 & 0 & {-1} & {-1} & 0
& \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
C \\
\text{diag}(\log_2(\left[ \begin{array} {rrr}
30 & 35 & 40 & 45 & 42 & 12 & 6 & 56 & 63 & 72 & \style{background-color:#FFF200;padding:5px}{2} \\
\end{array} \right]))
\end{array}
=
\begin{array} {ccc}
(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & 0 & \log_2(40) & 0 & {-\log_2(42)} & 2\log_2(12) & {-\log_2(6)} & 3\log_2(56) & 0 & {-3\log_2(72)} & \style{background-color:#FFF200;padding:5px}{0} \\
\log_2(30) & 0 & 0 & 2\log_2(45) & {-\log_2(42)} & {-\log_2(12)} & \log_2(6) & 0 & 2\log_2(63) & 2\log_2(72) & \style{background-color:#FFF200;padding:5px}{-1} \\
{-\log_2(30)} & {-\log_2(35)} & {-\log_2(40)} & {-\log_2(45)} & 0 & 0 & 0 & 0 & 0 & 0 & \style{background-color:#FFF200;padding:5px}{1} \\
0 & \log_2(35) & 0 & 0 & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
</math>
Again, same as before, but with one more column on the right now.
===Apply constraint===
Now, let's constrain both sides. First, the left side:
<math>
\scriptsize
\begin{array} {ccc}
M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & \log_2(35) & 2\log_2(40) & \log_2(45) & 0 & \log_2(12) & 0 & \log_2(56) & 0 & {-\log_2(72)} & \style{background-color:#FFF200;padding:5px}{0} \\
{-\log_2(30)} & {-\log_2(35)} & {-3\log_2(40)} & \log_2(45) & 0 & {-2\log_2(12)} & 2\log_2(6) & {-2\log_2(56)} & 2\log_2(63) & 4\log_2(72) & \style{background-color:#FFF200;padding:5px}{1} \\
{-2\log_2(30)} & {-\log_2(35)} & {-2\log_2(40)} & {-2\log_2(45)} & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 & \style{background-color:#FFF200;padding:5px}{2} \\
\end{array} \right]
\end{array}
\begin{array}
K \\
\left[ \begin{array} {rrr}
0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
+1 & +1 & \style{background-color:#FFF200;padding:5px}{0}\\
+1 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & {-1} & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} \\
\end{array} \right]
\end{array}
→ \\
\begin{array} {c}
M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK \\
\left[ \begin{array} {c}
\log_2(35·40^2) & {-\log_2(\frac{45}{35})} & \style{background-color:#FFF200;padding:5px}{0} \\
{-\log_2(35·40^3)} & {-\log_2(35·45)} & \style{background-color:#FFF200;padding:5px}{1} \\
{-\log_2(35·40^2)} & \log_2(\frac{45^2}{35}) & \style{background-color:#FFF200;padding:5px}{2} \\
\end{array} \right]
\end{array}
</math>
Same as before, with the rightmost column replaced with a column for our held-interval.
And now the right side:
<math>
\scriptsize
\begin{array} {ccc}
(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})C \\
\left[ \begin{array} {r|r|r|r|r|r|r|r|r}
\log_2(30) & 0 & \log_2(40) & 0 & {-\log_2(42)} & 2\log_2(12) & {-\log_2(6)} & 3\log_2(56) & 0 & {-3\log_2(72)} & \style{background-color:#FFF200;padding:5px}{0} \\
\log_2(30) & 0 & 0 & 2\log_2(45) & {-\log_2(42)} & {-\log_2(12)} & \log_2(6) & 0 & 2\log_2(63) & 2\log_2(72) & \style{background-color:#FFF200;padding:5px}{-1} \\
{-\log_2(30)} & {-\log_2(35)} & {-\log_2(40)} & {-\log_2(45)} & 0 & 0 & 0 & 0 & 0 & 0 & \style{background-color:#FFF200;padding:5px}{1} \\
0 & \log_2(35) & 0 & 0 & \log_2(42) & 0 & 0 & {-\log_2(56)} & {-\log_2(63)} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
\begin{array}
K \\
\left[ \begin{array} {rrr}
0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
+1 & +1 & \style{background-color:#FFF200;padding:5px}{0}\\
+1 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & {-1} & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
0 & 0 & \style{background-color:#FFF200;padding:5px}{0}\\
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} \\
\end{array} \right]
\end{array}
→ \\
\begin{array} {c}
(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK \\
\left[ \begin{array} {c}
\log_2(40^3) & 0  & \style{background-color:#FFF200;padding:5px}{0} \\
0 & {-\log_2(45^2)} & \style{background-color:#FFF200;padding:5px}{{-1}} \\
{-\log_2(35·40)} & \log_2(\frac{45}{35}) & \style{background-color:#FFF200;padding:5px}{1} \\
\log_2(35) & \log_2(35) & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
</math>
Again, same as before, but with the rightmost column replaced with a column for our held-interval.
Now, put them together, with <math>G</math> on the left-hand side, as an equality:
<math>
\small
\begin{array} {c}
G \\
\left[ \begin{array} {c}
g_{11} & g_{12} & g_{13} \\
g_{21} & g_{22} & g_{23} \\
g_{31} & g_{32} & g_{33} \\
g_{41} & g_{42} & g_{43} \\
\end{array} \right]
\end{array}
\begin{array} {c}
M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK \\
\left[ \begin{array} {c}
\log_2(35·40^2) & {-\log_2(\frac{45}{35})} & \style{background-color:#FFF200;padding:5px}{0} \\
{-\log_2(35·40^3)} & {-\log_2(35·45)} & \style{background-color:#FFF200;padding:5px}{1} \\
{-\log_2(35·40^2)} & \log_2(\frac{45^2}{35}) & \style{background-color:#FFF200;padding:5px}{2} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK \\
\left[ \begin{array} {c}
\log_2(40^3) & 0  & \style{background-color:#FFF200;padding:5px}{0} \\
0 & {-\log_2(45^2)} & \style{background-color:#FFF200;padding:5px}{{-1}} \\
{-\log_2(35·40)} & \log_2(\frac{45}{35}) & \style{background-color:#FFF200;padding:5px}{1} \\
\log_2(35) & \log_2(35) & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
</math>
===Solve for generator embedding===
At this point, following the pattern from above, we can solve for <math>G</math> as <math>(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK(M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK)^{-1}</math>. The matrix inverse is the step where the exact values in terms of logarithms start to get out of hand. Since we've already proven our point about exactness of the solutions from this method in the earlier "bigger example" section, for easier reading, let's lapse into decimal numbers from this point forward:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {c}
g_{11} & g_{12} & g_{13} \\
g_{21} & g_{22} & g_{23} \\
g_{31} & g_{32} & g_{33} \\
g_{41} & g_{42} & g_{43} \\
\end{array} \right]
\end{array}
=
\begin{array} {ccc}
(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK \\
\left[ \begin{array} {rrr}
15.966 & 0  & \style{background-color:#FFF200;padding:5px}{0} \\
0 & {-10.984} & \style{background-color:#FFF200;padding:5px}{{-1}} \\
{-10.451} & 0.363 & \style{background-color:#FFF200;padding:5px}{1} \\
5.129 & 5.129 & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
\begin{array} {ccc}
(M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK)^{-1} \\
\left[ \begin{array} {rrr}
{-27.097} & 0.725 & {-0.363} \\
26.417 & 31.546 & {-15.773} \\
\style{background-color:#FFF200;padding:5px}{{-291.028}} & \style{background-color:#FFF200;padding:5px}{{-86.624}} & \style{background-color:#FFF200;padding:5px}{{-175.177}} \\
\end{array} \right] \\
\hline
{-436.978}
\end{array}
</math>
Note where the yellow-highlights went: inversing transposed them from the rightmost column to the bottom row. It's no longer super clear what these values have to do with the held-interval anymore, however, and that's okay. In the next step, notice that when we multiply together <math>(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK</math> and <math>(M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK)^{-1}</math> that the yellow-highlighted entries will pair up for every individual dot products, and thus that the final matrix product will have a "little bit of yellow" mixed in to every entry. In other words, every entry of <math>G</math> may potentially participate in achieving the effect that this interval is held unchanged.
So, actually multiplying those up now, we find <math>G</math> =
<math>
\begin{array} {c}
(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK(M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK)^{-1} \\
\left[ \begin{array} {c}
0.990 & {-0.0265} & {0.0132} \\
{-0.00199} & 0.595 & {-0.797} \\
{-0.00399} & 0.189 & 0.405 \\
0.00798 & {-0.379} & 0.189 \\
\end{array} \right] \\
\end{array}
</math>
===Convert generator embedding to generator tuning map===
And from here we can find <math>𝒈 = 𝒋G</math>:
<math>
\begin{array} {ccc}
𝒋 \\
\left[ \begin{array} {rrr}
1200.000 & 1901.955  & 2786.314 & 3368.826 \\
\end{array} \right]
\end{array}
\begin{array} {c}
G \\
\left[ \begin{array} {c}
0.990 & {-0.0265} & {0.0132} \\
{-0.00199} & 0.595 & {-0.797} \\
{-0.00399} & 0.189 & 0.405 \\
0.00798 & {-0.379} & 0.189 \\
\end{array} \right]
\end{array}
=
\begin{array} {ccc}
𝒈 \\
\left[ \begin{array} {rrr}
1200.000 & 350.909 & 266.725 \\
\end{array} \right]
\end{array}
</math>
Confirming: yes, {{rbra|1200.000 350.909 266.725}}{{rket|0 1 2}} = <math>(1200.000 × 0) + (350.909 × 1) + (266.725 × 2) = 0 + 350.909 + 533.450 = 884.359</math>. So the constraint to hold that interval unchanged has been satisfied.
===System of equations style===
It may be instructive again to consider the system of equations style, solving directly for <math>𝒈</math>. Rewinding to before we took our matrix inverse, introducing <math>𝒋</math> to both sides, and multiplying the entries of <math>𝒈</math> through, we find:
<math>
\begin{array} {ccc}
𝒈M(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK \\
\left[ \begin{array} {rrr}
15.773g_1 & {-0.363g_1} & \style{background-color:#FFF200;padding:5px}{0g_1} \\
{-21.095g_2} & {-10.621g_2} & \style{background-color:#FFF200;padding:5px}{1g_2} \\
{-15.773g_3} & 5.854g_3 & \style{background-color:#FFF200;padding:5px}{2g_3} \\
\end{array} \right]
\end{array}
=
\begin{array} {ccc}
𝒋(\mathrm{T|\style{background-color:#FFF200;padding:2px}{H}})CK \\
\left[ \begin{array} {rrr}
7318.250 & {-2600.619} & \style{background-color:#FFF200;padding:5px}{884.359} \\
\end{array} \right]
\end{array}
</math>
Which gets viewed as a system of equations:
<math>
\begin{array} {r}
15.773g_1 & + & {-21.095g_2} & + & {-15.773g_3} & = & 7318.250 \\
{-0.363}g_1 & + & {-10.621g_2} & + & 5.854g_3 & = & {-2600.619} \\
\style{background-color:#FFF200;padding:5px}{0g_1} & + & \style{background-color:#FFF200;padding:5px}{1g_2} & + & \style{background-color:#FFF200;padding:5px}{2g_3} & = & \style{background-color:#FFF200;padding:5px}{884.359} \\
\end{array}
</math>
The third equation — which in the earlier "bigger example" was used to enforce that a fourth target-interval received coinciding damage to the other three target-intervals tapped by the constraint matrix — here has been replaced with an equation that enforces that {{rket|0 1 2}}, the generator-count vector that <math>\frac53</math> maps to in this temperament, is equal to the just tuning of that same interval. And so, when we solve this system of equations, we now get a completely different set of generator tunings.
<math>
g_1 = 1200.000 \\
g_2 =  350.909 \\
g_3 = 266.725 \\
</math>
Which agrees with what we found by solving directly for <math>G</math>.
===Sanity-check===
But is this a minimax tuning candidate still? That is, do we find that in the damage list for this tuning, that the three target-intervals whose damages were requested to coincide, are still coinciding? Indeed we do:
<math>
\begin{array} {c}
\textbf{d} \\
\left[ \begin{array} {r}
0.007 & 0.742 & 0.742 & 0.742 & 0.788 & 0.495 & 0.353 & 1.650 & 0.057 & 1.694 \\
\end{array} \right]
\end{array}
</math>
We can see that the 2<sup>nd</sup>, 3<sup>rd</sup>, and 4<sup>th</sup> target-intervals, the ones with non-zero entries in their columns of <math>K</math>, all coincide with 0.742 damage, so this is a proper candidate for minimax tuning here. It's some point where three damage graphs are intersecting while within the held-interval plane. Rinse and repeat.
==Tie-breaking==


(WIP)
(WIP)
==For all-interval tuning schemes==
When computing an all-interval tuning where the dual norm power is <math>∞</math>, we use a variation on the method we used for ordinary tunings when the optimization power was <math>∞</math>.
In this case, our optimization power is also still <math>∞</math>. That is to say, that in this case we're doing the same computation we would have been doing if we had a finite target set, but now we're doing it as if the primes alone were our target set.
Let's get the minimax-S tuning of meantone. With three proxy target-intervals and two generators, we end up with four constraint matrices:
<math>
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
,
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & {-1} \\
\end{array} \right]
,
\left[ \begin{array} {rrr}
+1 & +1 \\
{-1} & 0 \\
0 & +1 \\
\end{array} \right]
,
\left[ \begin{array} {rrr}
+1 & +1 \\
{-1} & 0 \\
0 & {-1} \\
\end{array} \right]
</math>
These correspond to tunings with the following pairs (one for each generator) of unchanged-intervals:
# <math>(\frac21)^1 × (\frac31)^1 = \frac61</math> and <math>(\frac21)^1 × (\frac51)^1 = \frac{10}{1}</math>
# <math>(\frac21)^1 × (\frac31)^1 = \frac61</math> and <math>(\frac21)^1 × (\frac51)^{-1} = \frac{2}{5}</math>
# <math>(\frac21)^1 × (\frac31)^{-1} = \frac23</math> and <math>(\frac21)^1 × (\frac51)^1 = \frac{10}{1}</math>
# <math>(\frac21)^1 × (\frac31)^{-1} = \frac23</math> and <math>(\frac21)^1 × (\frac51)^{-1} = \frac{2}{5}</math>
Which in turn become the following tunings:
# {{map|1202.682 695.021}}
# {{map|1201.699 697.564}}
# {{map|1195.387 699.256}}
# {{map|0.000 0.000}} (Yup, not kidding. This tuning is probably not going to win…)
And these in turn give the following prime absolute error lists (for each list, all three primes have coinciding absolute scaled errors, because minimax tunings lead to <math>r + 1</math> of them coinciding):
# {{map|2.682 2.682 2.682}}
# {{map|1.699 1.699 1.699}}
# {{map|4.613 4.613 4.613}}
# {{map|1200.000 1200.000 1200.000}}
And so our second tuning wins, and that's our minimax-S tuning of meantone.
==With alternative complexities==
The following examples all pick up from a shared setup here: [[Dave Keenan & Douglas Blumeyer's guide to RTT: alternative complexities#Computing all-interval tuning schemes with alternative complexities]].
So for all complexities used here — at least the first several simpler examples — our constraint matrices will be:
<math>
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
, \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & -1 \\
\end{array} \right]
, \\
\left[ \begin{array} {rrr}
+1 & +1 \\
-1 & 0 \\
0 & +1 \\
\end{array} \right]
, \\
\left[ \begin{array} {rrr}
+1 & +1 \\
-1 & 0 \\
0 & -1 \\
\end{array} \right]
</math>
===Minimax-S===
This example specifically picks up from the setup laid out here: [[Dave Keenan & Douglas Blumeyer's guide to RTT: alternative complexities#Log-product2]], by plugging <math>L^{-1}</math> into our pseudoinverse method for <math>S_{\text{p}}</math>.
<math>
% \slant{} command approximates italics to allow slanted bold characters, including digits, in MathJax.
\def\slant#1{\style{display:inline-block;margin:-.05em;transform:skew(-14deg)translateX(.03em)}{#1}}
</math>
Now we need to find the tunings corresponding to our series of constraint matrices <math>K</math>. Those constraint matrices apply to both sides of the approximation <math>
GM\mathrm{T}_{\text{p}}S_{\text{p}} \approx \mathrm{T}_{\text{p}}S_{\text{p}}</math>, or simplified, <math>
GMS_{\text{p}} \approx S_{\text{p}}</math>. So first we find <math>MS_{\text{p}} = ML^{-1} = </math> {{rket|{{bra|<math>\frac{1}{\log_2(2)}</math> <math>\frac{2}{\log_2(3)}</math> <math>\frac{3}{\log_2(5)}</math> }} {{bra|<math>\frac{0}{\log_2(2)}</math> <math>\frac{-3}{\log_2(3)}</math> <math>\frac{-5}{\log_2(5)}</math> }} }}. And then we find <math>S_{\text{p}} = L^{-1} = \text{diag}(\left[ \begin{array} {r} \frac{1}{\log_2(2)} & \frac{1}{\log_2(3)} & \frac{1}{\log_2(5)} \end{array} \right])</math>.
So here's our first constraint matrix:
<math>
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
</math>
Applying the constraint to get an equality:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
\begin{array} {c}
ML^{-1} \\
\left[ \begin{array} {rrr}
\frac{1}{\log_2(2)} & \frac{2}{\log_2(3)} & \frac{3}{\log_2(5)} \\
\frac{0}{\log_2(2)} & \frac{-3}{\log_2(3)} & \frac{-5}{\log_2(5)} \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
L^{-1} \\
\left[ \begin{array} {rrr}
\frac{1}{\log_2(2)} & 0 & 0 \\
0 & \frac{1}{\log_2(3)} & 0 \\
0 & 0 & \frac{1}{\log_2(5)} \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
</math>
Multiply:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
\begin{array} {c}
ML^{-1}K \\
\left[ \begin{array} {rrr}
1+\frac{2}{\log_2(3)} & 1+\frac{3}{\log_2(5)} \\
\frac{-3}{\log_2(3)} & \frac{5}{\log_2(5)} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
L^{-1}K \\
\left[ \begin{array} {rrr}
\frac{1}{\log_2(2)} & \frac{1}{\log_2(2)} \\
\frac{1}{\log_2(3)} & 0 \\
0 & \frac{1}{\log_2(5)}\\
\end{array} \right]
\end{array}
</math>
Solve for <math>G</math>:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
L^{-1}K \\
\left[ \begin{array} {rrr}
\frac{1}{\log_2(2)} & \frac{1}{\log_2(2)} \\
\frac{1}{\log_2(3)} & 0 \\
0 & \frac{1}{\log_2(5)}\\
\end{array} \right]
\end{array}
\begin{array} {c}
(ML^{-1}K)^{-1} \\
\left[ \begin{array} {rrr}
\frac{-5}{\log_2(5)} & {-1}-\frac{3}{\log_2(5)} \\
\frac{3}{\log_2(3)} & 1+\frac{2}{\log_2(3)} \\
\end{array} \right] \\
\hline
(\frac{3}{\log_2(3)} - \frac{5}{\log_2(5)} - \frac{1}{\log_2(3)\log_2(5)})
\end{array}
=
\begin{array} {c}
\\
\left[ \begin{array} {rrr}
0.490 & 0.0567 \\
2.552 & 2.717 \\
-1.531 & -1.830 \\
\end{array} \right]
\end{array}
</math>
From that we can find <math>𝒈 = 𝒋G</math> to get <math>g_1 = 1174.903</math> and <math>g_2 = 136.024</math>.
Sure, that looks like a horrible tuning; it only minimizes the maximum damage across all intervals to about 25 ¢(S)! But don't worry yet. This is all part of the process. We've only checked our first of four constraint matrices. Certainly one of the other three will lead to a better candidate tuning. We won't work through these examples in detail; one illustrative example should be enough.
Indeed we find that the second one to be <math>𝒈 = </math> {{rbra|1196.906 162.318}} dealing only 3 ¢(S) maximum damage. And the third <math>K</math> leads to {{rbra|1203.540 166.505}} which also deals just over 3 ¢(S) maximum damage. The fourth <math>K</math> is a dud, sending the tuning to {{rbra|0 0}}, dealing a whopping 1200 ¢(S) maximum damage.
And so the minimax-S tuning of this temperament is {{rbra|1196.906 162.318}}. We could compute this in the RTT Library in Wolfram Language with the following line of code:
<nowiki>
In:  optimizeGeneratorTuningMap["[⟨1 2 3] ⟨0 -3 -5]]", "minimax-S"]
Out: {1196.906 162.318] </nowiki>
===Minimax-sofpr-S===
This example specifically picks up from the setup laid out here: [[Dave Keenan & Douglas Blumeyer's guide to RTT: alternative complexities#Sum-of-prime-factors-with-repetition2]]. Plugging <math>\text{diag}(𝒑)^{-1}</math> in for <math>S_{\text{p}}</math>.
Now we need to find the tunings corresponding to our series of constraint matrices <math>K</math>. Those constraint matrices apply to both sides of the approximation <math> GM\mathrm{T}_{\text{p}}S_{\text{p}} \approx \mathrm{T}_{\text{p}}S_{\text{p}}</math>, or simplified, <math> GMS_{\text{p}} \approx S_{\text{p}}</math>. So first we find <math>MS_{\text{p}} = M\text{diag}(𝒑)^{-1} = </math> {{rket|{{bra|<math>\frac{1}{2}</math> <math>\frac{2}{3}</math> <math>\frac{3}{5}</math> }} {{bra|<math>\frac{0}{2}</math> <math>\frac{-3}{3}</math> <math>\frac{-5}{5}</math> }} }}. And then we find <math>S_{\text{p}} = \text{diag}(𝒑)^{-1} = \text{diag}(\left[ \begin{array} {r} \frac12 & \frac13 & \frac15 \end{array} \right])</math>.
So here's our first constraint matrix:
<math>
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
</math>
Applying the constraint to get an equality:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
\begin{array} {c}
M\text{diag}(𝒑)^{-1} \\
\left[ \begin{array} {rrr}
\frac12 & \frac23 & \frac35 \\
\frac02 & \frac{-3}{3} & \frac{-5}{5} \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{diag}(𝒑)^{-1} \\
\left[ \begin{array} {rrr}
\frac12 & 0 & 0 \\
0 & \frac13 & 0 \\
0 & 0 & \frac15 \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
</math>
Multiply:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
\begin{array} {c}
M\text{diag}(𝒑)^{-1}K \\
\left[ \begin{array} {rrr}
\frac76 & \frac{11}{10} \\
{-1} & {-1} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{diag}(𝒑)^{-1}K \\
\left[ \begin{array} {rrr}
\frac12 & \frac12 \\
\frac13 & 0 \\
0 & \frac15 \\
\end{array} \right]
\end{array}
</math>
Solve for <math>G</math>:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{diag}(𝒑)^{-1}K \\
\left[ \begin{array} {rrr}
\frac12 & \frac12 \\
\frac13 & 0 \\
0 & \frac15 \\
\end{array} \right]
\end{array}
\begin{array} {c}
(M\text{diag}(𝒑)^{-1}K)^{-1} \\
\left[ \begin{array} {rrr}
15 & \frac{33}{2} \\
{-15} & {-\frac{35}{2}} \\
\end{array} \right] \\
\end{array}
=
\begin{array} {c}
\\
\left[ \begin{array} {rrr}
0 & {-\frac{1}{2}} \\
5 & \frac{11}{2} \\
-3 & {-\frac{7}{2}} \\
\end{array} \right]
\end{array}
</math>
Note the tempered octave is exactly <math>3^{5}5^{-3} = \frac{243}{125}</math>! That sounds cool, but it's actually an entire quartertone narrow. We find <math>g_1 = 1150.834</math> and <math>g_2 = 108.655</math>. Again, that looks like a horrible tuning; this first constraint matrix is beginning to seem so hot for tuning porcupine temperament, irrespective of our choice of complexity.
But again that the second candidate tuning to be much nicer, with <math>𝒈 = </math> {{rbra|1196.927 162.430}} dealing only about 1.5 ¢(S) maximum damage. And the third <math>K</math> leads to {{rbra|1203.512 166.600}} which also deals about 1.8 ¢(S) maximum damage. The fourth <math>K</math> is a dud, giving {{rbra|1150.834 157.821}}, dealing a whopping 25 ¢(S) maximum damage.
And so the minimax-sopfr-S tuning of this temperament is {{rbra|1196.927 162.430}}. We could compute this in the RTT Library in Wolfram Language with the following line of code:
<nowiki>
In:  optimizeGeneratorTuningMap["[⟨1 2 3] ⟨0 -3 -5]]", "minimax-sopfr-S"]
Out: {1196.927 162.430] </nowiki>
===Minimax-copfr-S===
This example specifically picks up from the setup laid out here: [[Dave Keenan & Douglas Blumeyer's guide to RTT: alternative complexities#Count-of-prime-factors-with-repetition2]]. Plugging <math>I</math> into our pseudoinverse method for <math>S_{\text{p}}</math>.
Now we need to find the tunings corresponding to our series of constraint matrices <math>K</math>. Those constraint matrices apply to both sides of the approximation <math> GM\mathrm{T}_{\text{p}}S_{\text{p}} \approx \mathrm{T}_{\text{p}}S_{\text{p}}</math>, or simplified, <math> GMS_{\text{p}} \approx S_{\text{p}}</math>. So first we find <math>MS_{\text{p}} = M = </math> {{rket|{{map|1 2 3}} {{map|0 -3 -5}} }}. And then we find <math>S_{\text{p}} = I</math>.
So here's our first constraint matrix:
<math>
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
</math>
Applying the constraint to get an equality:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
\begin{array} {c}
M \\
\left[ \begin{array} {rrr}
1 & 2 & 3 \\
0 & {-3} & {-5} \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
I \\
\left[ \begin{array} {rrr}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
+1 & +1 \\
+1 & 0 \\
0 & +1 \\
\end{array} \right]
\end{array}
</math>
Multiply:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
\begin{array} {c}
MK \\
\left[ \begin{array} {rrr}
3 & 4 \\
{-3} & {-5} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
IK \\
\left[ \begin{array} {rrr}
1 & 1 \\
1 & 0 \\
0 & 1 \\
\end{array} \right]
\end{array}
</math>
Solve for <math>G</math>:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rrr}
g_{11} & g_{12} \\
g_{21} & g_{22} \\
g_{31} & g_{32} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
K \\
\left[ \begin{array} {rrr}
1 & 1 \\
1 & 0 \\
0 & 1 \\
\end{array} \right]
\end{array}
\begin{array} {c}
(MK)^{-1} \\
\left[ \begin{array} {rrr}
\frac53 & \frac43 \\
{-1} & {-1} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\\
\dfrac13
\left[ \begin{array} {rrr}
2 & 1 \\
5 & 4 \\
{-3} & {-3} \\
\end{array} \right]
\end{array}
</math>
So that's a tempered octave equal to <math>2^{\frac23}3^{\frac53}5^{-\frac33} = \sqrt[3]{\frac{972}{125}}</math>. Interesting, perhaps. But we find <math>g_1 = 1183.611</math> and <math>g_2 = 149.626</math>. You know the drill by now. This one's a horrible tuning. It does 16 ¢(S) damage.
The second constraint gives <math>𝒈 = </math> {{rbra|1194.537 160.552}} dealing only 5 ¢(S) maximum damage. And the third <math>K</math> leads to {{rbra|1207.024 168.356}} which also deals just over 7 ¢(S) maximum damage. The fourth <math>K</math> is a dud, sending the tuning to {{rbra|1249.166 182.404}}, dealing nearly 50 ¢(S) maximum damage.
And so the minimax-copfr-S tuning of this temperament is {{rbra|1194.537 160.552}}. We could compute this in the RTT Library in Wolfram Language with the following line of code:
<nowiki>
In:  optimizeGeneratorTuningMap["[⟨1 2 3] ⟨0 -3 -5]]", "minimax-copfr-S"]
Out: {1194.537 160.552] </nowiki>
In the case of minimax-copfr-S with nullity-1 (only one comma) like this, we actually have a shortcut. First, take the size of the comma in cents, and divide it by its total count of primes. The porcupine comma is <math>\frac{250}{243}</math>, or in vector form {{vector|1 -5 3}}, and so it has |1| + |-5| + |3| = 9 total primes. And being 49.166 ¢ in size, that gives us <math>\frac{49.166}{9} = 5.463</math>. What's this number for? That's the amount of cents to retune each prime by! If the count of a prime in the comma is ''positive'', we tune ''narrow'' by that much, and if ''negative'', we tune ''wide''. So the map for the minimax-copfr-S tuning of porcupine is <math>𝒕</math> = {{map|1200 1901.955 2786.314}} + {{map|-5.463 5.463 -5.463}} = {{map|1194.537 1907.418 2780.851}}. If you're not convinced this matches the <math>𝒈</math> we found the long way, feel free to check via <math>𝒕 = 𝒈M</math>.
===Minimax-lils-S===
This example specifically picks up from the setup laid out here: [[Dave Keenan & Douglas Blumeyer's guide to RTT: alternative complexities#Log-integer-limit-squared2]].
Now we need to find the tunings corresponding to our series of constraint matrices <math>K</math>. Those constraint matrices apply to both sides of the approximation <math> GM\mathrm{T}_{\text{p}}S_{\text{p}} \approx \mathrm{T}_{\text{p}}S_{\text{p}}</math>, or simplified, <math> GMS_{\text{p}} \approx S_{\text{p}}</math>, or equivalent thereof. So first we find <math>M\mathrm{T}_{\text{p}}S_{\text{p}}</math>. According to Mike's augmentation pattern<ref>https://yahootuninggroupsultimatebackup.github.io/tuning-math/topicId_21029.html</ref>, we get:
<math>
\left[ \begin{array} {rrr|r}
\frac{1}{\log_2(2)} & \frac{2}{\log_2(3)} & \frac{3}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
0 & \frac{-3}{\log_2(3)} & \frac{-5}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{-1} \\
\end{array} \right]
</math>
(Compare with the result for minimax-S, the same but without the augmentations.)
And then we find <math>S_{\text{p}}</math> or equivalent thereof. It's an augmentation of <math>L^{-1}</math>:
<math>
\left[ \begin{array} {rrr|r}
\frac{1}{\log_2(2)} & 0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & \frac{1}{\log_2(3)} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & 0 & \frac{1}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} \\
\end{array} \right]
</math>
This is an extrapolation from Mike's augmentation pattern. It's not actually directly any sort of inverse of the complexity pretransformer. In some sense, that effect has already been built into the augmentation of <math>M\mathrm{T}_{\text{p}}S_{\text{p}}</math>. (Again, it's the same as minimax-S, but with the augmentation.)
On account of the augmentation, our constraint matrices are a bit different here. Actually, we have twice as many candidate tunings to check this time (if you compare this list with the one given in the opening part of this supersection, the pattern relating them is fairly clear). The extra dimension is treated just like it would be otherwise. Here are all of our <math>K</math>'s:
<math>
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
+1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & +1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{+1} \\
\end{array} \right]
, \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
+1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & +1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{-1} \\
\end{array} \right]
, \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
+1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & -1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{+1} \\
\end{array} \right]
, \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
+1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & -1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{-1} \\
\end{array} \right]
, \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
-1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & +1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{+1} \\
\end{array} \right]
, \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
-1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & +1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{-1} \\
\end{array} \right]
, \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
-1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & -1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{+1} \\
\end{array} \right]
, \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
-1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & -1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{-1} \\
\end{array} \right]
, \\
</math>
So let's just work through one tuning with the first <math>K</math>. Note that we've also augmented <math>G</math>. This augmentation is necessary for the computation but will be thrown away once we have our result.
Applying the constraint to get an equality:
<math>
\scriptsize
\begin{array} {c}
G \\
\left[ \begin{array} {rr|r}
g_{1,1} & g_{1,2} & \style{background-color:#FFF200;padding:5px}{g_{1,\text{aug}}} \\
g_{2,1} & g_{2,2} & \style{background-color:#FFF200;padding:5px}{g_{2,\text{aug}}} \\
g_{3,1} & g_{3,2} & \style{background-color:#FFF200;padding:5px}{g_{3,\text{aug}}} \\
\hline
\style{background-color:#FFF200;padding:5px}{g_{\text{aug},1}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},2}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},\text{aug}}} \\
\end{array} \right]
\end{array}
\begin{array} {c}
\text{equiv. of} \; MS_{\text{p}} \\
\left[ \begin{array} {rrr|r}
\frac{1}{\log_2(2)} & \frac{2}{\log_2(3)} & \frac{3}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
0 & \frac{-3}{\log_2(3)} & \frac{-5}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{-1}
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
+1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & +1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{+1} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{equiv. of} \; S_{\text{p}} \\
\left[ \begin{array} {rrr|r}
\frac{1}{\log_2(2)} & 0 & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & \frac{1}{\log_2(3)} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & 0 & \frac{1}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
+1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & +1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{+1} \\
\end{array} \right]
\end{array}
</math>
Multiply:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rr|r}
g_{1,1} & g_{1,2} & \style{background-color:#FFF200;padding:5px}{g_{1,\text{aug}}} \\
g_{2,1} & g_{2,2} & \style{background-color:#FFF200;padding:5px}{g_{2,\text{aug}}} \\
g_{3,1} & g_{3,2} & \style{background-color:#FFF200;padding:5px}{g_{3,\text{aug}}} \\
\hline
\style{background-color:#FFF200;padding:5px}{g_{\text{aug},1}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},2}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},\text{aug}}} \\
\end{array} \right]
\end{array}
\begin{array} {c}
\text{equiv. of} \; MS_{\text{p}}K \\
\left[ \begin{array} {rr|r}
2.262 & 2.292 & \style{background-color:#FFF200;padding:5px}{1} \\
{-1.892} & {-2.153} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{2} & \style{background-color:#FFF200;padding:5px}{2} & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{equiv. of} \; S_{\text{p}}K \\
\left[ \begin{array} {rr|r}
\frac{1}{\log_2(2)} & \frac{1}{\log_2(2)} & \style{background-color:#FFF200;padding:5px}{1} \\
\frac{1}{\log_2(3)} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & \frac{1}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} \\
\end{array} \right]
\end{array}
</math>
(Again, compare this with the minimax-S case. Same but augmented.) And now solve for <math>G</math>:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rr|r}
g_{1,1} & g_{1,2} & \style{background-color:#FFF200;padding:5px}{g_{1,\text{aug}}} \\
g_{2,1} & g_{2,2} & \style{background-color:#FFF200;padding:5px}{g_{2,\text{aug}}} \\
g_{3,1} & g_{3,2} & \style{background-color:#FFF200;padding:5px}{g_{3,\text{aug}}} \\
\hline
\style{background-color:#FFF200;padding:5px}{g_{\text{aug},1}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},2}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},\text{aug}}} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{equiv. of} \; S_{\text{p}}K \\
\left[ \begin{array} {rr|r}
\frac{1}{\log_2(2)} & \frac{1}{\log_2(2)} & \style{background-color:#FFF200;padding:5px}{1} \\
\frac{1}{\log_2(3)} & 0 & \style{background-color:#FFF200;padding:5px}{0} \\
0 & \frac{1}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} \\
\end{array} \right]
\end{array}
\begin{array} {c}
(\text{equiv. of} \; MS_{\text{p}}K)^{-1} \\
\left[ \begin{array} {rrr}
0 & 3.837 & 4.131 \\
0 & -3.837 & -3.632 \\
1 & 0.116 & -1.021 \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\\
\left[ \begin{array} {rr|r}
1 & 0.116 & \style{background-color:#FFF200;padding:5px}{-0.521} \\
0 & 2.421 & \style{background-color:#FFF200;padding:5px}{2.607} \\
0 & -1.652 & \style{background-color:#FFF200;padding:5px}{-1.564} \\
\hline
\style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{0.116} & \style{background-color:#FFF200;padding:5px}{-1.021} \\
\end{array} \right]
\end{array}
</math>
From that we can find <math>𝒈 = 𝒋G</math>. But we need an augmented <math>𝒋</math> to do this. This will work:
<math>
\left[ \begin{array} {rrr|r}
1200 & 1200 & 1200 & \style{background-color:#FFF200;padding:5px}{0} \\
\end{array} \right]
</math>
So that gives us <math>g_1 = 1200.000</math>, <math>g_2 = 138.930</math>, and <math>g_{\text{aug}} = -25.633</math>. The last term is junk. As stated previously, it's only a side-effect of the computation process and isn't part of the useful result. Instead we only care about <math>g_1</math> and <math>g_2</math>, giving us the tuning {{rbra|1200.000 138.930}}.
For this example we won't bother detailing all 8 candidate tunings. Too many. But we will at least note that not every tuning works out with an unchanged octave like this. And that this is not one of the better tunings; this one does about 26 ¢(S) damage, while half of the tunings are around only 3 ¢(S).
The best tuning we find from this set is {{rbra|1193.828 161.900}}, and so that's our minimax-lils-S tuning of porcupine. We could compute this in the RTT Library in Wolfram Language with the following line of code:
<nowiki>
In:  optimizeGeneratorTuningMap["[⟨1 2 3] ⟨0 -3 -5]]", "minimax-lils-S"]
Out: {1193.828 161.900] </nowiki>
===Minimax-lols-S===
This example specifically picks up from the setup laid out here: [[Dave Keenan & Douglas Blumeyer's guide to RTT: alternative complexities#Log-odd-limit-squared2]].
So for minimax-lols-S (AKA held-octave minimax-lils-S) we basically keep the same <math>MS_{\text{p}}</math> as before. But now (as discussed [[Generator_embedding_optimization#With held-intervals3|here]]) we have to further augment it with the mapped held-interval, {{vector|1 0 0}} (i.e. what the octave maps to in this temperament, including its augmented row, so that we can match it with its just size in the constrained linear system of equations to enforce it being held unchanged):
<math>
\begin{array}{c}
\text{equiv. of} \; MS_{\text{p}} \\
\left[ \begin{array} {rrr|r|r}
\frac{1}{\log_2(2)} & \frac{2}{\log_2(3)} & \frac{3}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1} \\
0 & \frac{-3}{\log_2(3)} & \frac{-5}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{-1} & \style{background-color:#00AEEF;padding:5px}{0} \\
\end{array} \right]
\end{array}
</math>
And as for our equivalent of <math>S_{\text{p}}</math>, that's just going to be <math>L^{-1}</math> augmented ''first'' with the placeholder for the size dimension for the lil, and ''secondly'' with a placeholder for the just tuning of the held-interval which will appear in the augmented <math>𝒋</math> later, which will be matched up with its mapped form to ensure it is held unchanged.
<math>
\left[ \begin{array} {rrr|r|r}
\frac{1}{\log_2(2)} & 0 & 0 & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
0 & \frac{1}{\log_2(3)} & 0 & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
0 & 0 & \frac{1}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#00AEEF;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1} \\
\end{array} \right]
</math>
Our list of <math>K</math>'s here is the same as the list for minimax-lils-S, but now they've all got one of their rows dedicated to holding the octave unchanged. For example the first one was:
<math>
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#FFF200;padding:5px}{+1} \\
+1 &  0 & \style{background-color:#FFF200;padding:5px}{0}  \\
0 & +1 & \style{background-color:#FFF200;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{+1} \\
\end{array} \right]
</math>
But now it's:
<math>
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#8DC73E;padding:5px}{0} \\
+1 &  0 & \style{background-color:#8DC73E;padding:5px}{0}  \\
0 & +1 & \style{background-color:#8DC73E;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#8DC73E;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1}
\end{array} \right]
</math>
(To explain the green highlighting: those cells are pertinent to both augmentations. The yellow part of the green indicates that the lil-augmentation put a new column there at all. The blue indicates that now that column has been replaced with a column for holding an interval unchanged. The held-octave issue did not actually ''add'' a new column here, only a new row.)
So let's just work through one tuning with the first <math>K</math>. Note that <math>𝒈</math> is augmented as it was for the minimax-lils-S computation. Applying the constraint to get an equality:
<math>
\scriptsize
\begin{array} {c}
G \\
\left[ \begin{array} {rr|r}
g_{1,1} & g_{1,2} & \style{background-color:#FFF200;padding:5px}{g_{1,\text{aug}}} \\
g_{2,1} & g_{2,2} & \style{background-color:#FFF200;padding:5px}{g_{2,\text{aug}}} \\
g_{3,1} & g_{3,2} & \style{background-color:#FFF200;padding:5px}{g_{3,\text{aug}}} \\
\hline
\style{background-color:#FFF200;padding:5px}{g_{\text{aug},1}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},2}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},\text{aug}}} \\
\hline
\style{background-color:#00AEEF;padding:5px}{g_{\text{held},1}} & \style{background-color:#00AEEF;padding:5px}{g_{\text{held},2}} & \style{background-color:#8DC73E;padding:5px}{g_{\text{held},\text{aug}}} \\
\end{array} \right]
\end{array}
\begin{array}{c}
\text{equiv. of} \; MS_{\text{p}} \\
\left[ \begin{array} {rrr|r|r}
\frac{1}{\log_2(2)} & \frac{2}{\log_2(3)} & \frac{3}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1} \\
0 & \frac{-3}{\log_2(3)} & \frac{-5}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#FFF200;padding:5px}{-1} & \style{background-color:#00AEEF;padding:5px}{0} \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#8DC73E;padding:5px}{0} \\
+1 &  0 & \style{background-color:#8DC73E;padding:5px}{0}  \\
0 & +1 & \style{background-color:#8DC73E;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#8DC73E;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1}
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{equiv. of} \; S_{\text{p}} \\
\left[ \begin{array} {rrr|r|r}
\frac{1}{\log_2(2)} & 0 & 0 & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
0 & \frac{1}{\log_2(3)} & 0 & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
0 & 0 & \frac{1}{\log_2(5)} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{1} & \style{background-color:#00AEEF;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1} \\
\end{array} \right]
\end{array}
\begin{array} {c}
K \\
\left[ \begin{array} {rr|r}
+1 & +1 & \style{background-color:#8DC73E;padding:5px}{0} \\
+1 &  0 & \style{background-color:#8DC73E;padding:5px}{0}  \\
0 & +1 & \style{background-color:#8DC73E;padding:5px}{0}  \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#8DC73E;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1}
\end{array} \right]
\end{array}
</math>
Multiply:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rr|r}
g_{1,1} & g_{1,2} & \style{background-color:#FFF200;padding:5px}{g_{1,\text{aug}}} \\
g_{2,1} & g_{2,2} & \style{background-color:#FFF200;padding:5px}{g_{2,\text{aug}}} \\
g_{3,1} & g_{3,2} & \style{background-color:#FFF200;padding:5px}{g_{3,\text{aug}}} \\
\hline
\style{background-color:#FFF200;padding:5px}{g_{\text{aug},1}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},2}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},\text{aug}}} \\
\hline
\style{background-color:#00AEEF;padding:5px}{g_{\text{held},1}} & \style{background-color:#00AEEF;padding:5px}{g_{\text{held},2}} & \style{background-color:#8DC73E;padding:5px}{g_{\text{held},\text{aug}}} \\
\end{array} \right]
\end{array}
\begin{array} {c}
\text{equiv. of} \; MS_{\text{p}}K \\
\left[ \begin{array} {rr|r}
2.262 & 2.292 & \style{background-color:#FFF200;padding:5px}{1} \\
{-1.892} & {-2.153} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#8DC73E;padding:5px}{2} & \style{background-color:#8DC73E;padding:5px}{2} & \style{background-color:#8DC73E;padding:5px}{0} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{equiv. of} \; S_{\text{p}}K \\
\left[ \begin{array} {rr|r}
\frac{1}{\log_2(2)} & \frac{1}{\log_2(2)} & \style{background-color:#8DC73E;padding:5px}{0} \\
\frac{1}{\log_2(3)} & 0 & \style{background-color:#8DC73E;padding:5px}{0} \\
0 & \frac{1}{\log_2(5)} & \style{background-color:#8DC73E;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#8DC73E;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1} \\
\end{array} \right]
\end{array}
</math>
Solve for <math>G</math>:
<math>
\begin{array} {c}
G \\
\left[ \begin{array} {rr|r}
g_{1,1} & g_{1,2} & \style{background-color:#FFF200;padding:5px}{g_{1,\text{aug}}} \\
g_{2,1} & g_{2,2} & \style{background-color:#FFF200;padding:5px}{g_{2,\text{aug}}} \\
g_{3,1} & g_{3,2} & \style{background-color:#FFF200;padding:5px}{g_{3,\text{aug}}} \\
\hline
\style{background-color:#FFF200;padding:5px}{g_{\text{aug},1}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},2}} & \style{background-color:#FFF200;padding:5px}{g_{\text{aug},\text{aug}}} \\
\hline
\style{background-color:#00AEEF;padding:5px}{g_{\text{held},1}} & \style{background-color:#00AEEF;padding:5px}{g_{\text{held},2}} & \style{background-color:#8DC73E;padding:5px}{g_{\text{held},\text{aug}}} \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\text{equiv. of} \; S_{\text{p}}K \\
\left[ \begin{array} {rr|r}
\frac{1}{\log_2(2)} & \frac{1}{\log_2(2)} & \style{background-color:#8DC73E;padding:5px}{0} \\
\frac{1}{\log_2(3)} & 0 & \style{background-color:#8DC73E;padding:5px}{0} \\
0 & \frac{1}{\log_2(5)} & \style{background-color:#8DC73E;padding:5px}{0} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#8DC73E;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1} \\
\end{array} \right]
\end{array}
\begin{array} {c}
(\text{equiv. of} \; MS_{\text{p}}K)^{-1} \\
\left[ \begin{array} {rrr}
0 & 3.838 & 4.132 \\
0 & -3.838 & -3.632 \\
1 & 0.116 & -1.021 \\
\end{array} \right]
\end{array}
=
\begin{array} {c}
\\
\left[ \begin{array} {rr|r}
0 & 0 & \style{background-color:#FFF200;padding:5px}{0.500} \\
0 & 2.421 & \style{background-color:#FFF200;padding:5px}{2.607} \\
0 & -1.653 & \style{background-color:#FFF200;padding:5px}{-1.564} \\
\hline
\style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#FFF200;padding:5px}{0} \\
\hline
\style{background-color:#00AEEF;padding:5px}{1} & \style{background-color:#00AEEF;padding:5px}{0.116} & \style{background-color:#8DC73E;padding:5px}{-1.021} \\
\end{array} \right]
\end{array}
</math>
From that we can find <math>𝒈 = 𝒋G</math>. But we need to have augmented <math>𝒋</math> accordingly. It needs to be augmented both for the lils and for the held-octave. Specifically, for the held-octave, we need to add its just tuning in cents. So that's 1200. It works out to:
<math>
\left[ \begin{array} {rrr|r|r}
1200 & 1200 & 1200 & \style{background-color:#FFF200;padding:5px}{0} & \style{background-color:#00AEEF;padding:5px}{1200} \\
\end{array} \right]
</math>
So we find <math>g_1 = 1200</math>, <math>g_2 = 138.930</math>, and <math>g_{\text{aug}} = -25.633</math>. As stated previously, the result for <math>g_{\text{aug}}</math> is just a side-effect of the computation process and isn't part of the useful result. Instead we only care about <math>g_1</math> and <math>g_2</math>, giving us the tuning {{rbra|1200.000 138.930}}. (Yes, that's the same tuning as we found for minimax-lils-S; it happens that the octave was already pure for that one, and otherwise nothing about the tuning scheme changed.)
For this example we won't bother detailing all 8 candidate tunings. Too many. But we will at least note that not every tuning works out with a held octave like this. And that this is not one of the better tunings; this one does about 26 ¢(S) damage, while half of the tunings are around only 3 ¢(S).
The best augmented tuning we find from this set is [1200 162.737 -3.102], and so that's our held-octave minimax-lols-S tuning of porcupine. Well, when you throw away that <math>g_{\text{aug}}</math> final entry anyway, to get {{rbra|1200 162.737}}.
We could compute this in the RTT Library in Wolfram Language with the following line of code:
<nowiki>
In:  optimizeGeneratorTuningMap["[⟨1 2 3] ⟨0 -3 -5]]", "held-octave minimax-lols-S"]
Out: {1200 162.737] </nowiki>
=Footnotes=
[[Category:Regular temperament theory]]
[[Category:Tuning]]