Wednesday, September 22, 2010

Horror vacui

Or, now for something completely different

This is a post about bending your knitting to your will using the power of mathematics.

So. If you're like me, you like to knit rectangular shawls in one piece from end to end, with scalloped edging all around that's knitted more or less simultaneously with the body of the shawl. This means starting with a provisional cast-on and a strip of edging, turning the corner somehow, picking up stitches from the straight edge of the strip and from the cast-on, and knitting perpendicular to the original direction for the length of the piece. The live stitches are dealt with by knitting on edging at the end, growing out of the edging from one long side and ending by grafting it to the remaining edging stitches. (This construction method might sound familiar—it's the one that Galina Khmeleva describes in Gossamer Webs.)

The problem with this method is that there's not a whole lot of room for fudging if the total edging row count and the total row count of whatever central pattern you've chosen don't have a common denominator. It's obvious (and unattractive!) to have corners that don't match because you were on a different edging row when you turned the second pair than when you turned the first. And it's not necessarily going to be clear how or if things will match up at the end, when you're just starting the project. When you're knitting on an edging after the centre is finished, you can count rows and ease in the corners by knitting the last edging stitch together with two live shawl stitches, say, or by working some returning rows without attaching them.

My preference is to calculate how everything will fit together before beginning the project. I don't like to have much space between the edge of the edging and the beginning of whatever pattern is in the centre—this is a personal preference (i.e. a personal problem) and you can add "frame" stitches to your calculations without much trouble if you wish.

When I was knitting a stole a while ago that I managed to give away before documenting, I wanted to use a border pattern that had a 17-row repeat, and a central pattern with a 12-row repeat. There was a 16-row buffer section between the border and centre on each side, and there should be one extra plain row at each end of the stole. The edging I wanted to use had a 20-row repeat, and I wanted it to fit perfectly with no easing at the corners.

You can make an equation out of those requirements.

17x + 12y + 16 + 16 + 2 = 20z
17x + 12y + 34 = 20z

There's more than one solution here, actually an infinite number, but most will not be realistic for knitting—they might require you to knit thousands of rows, for example, and while I think that a hundred-foot-long stole would be totally cool it's really not for me and my 1200m skein of yarn right now.

If you're a math person: come up with an integer solution! If you're not a math person: go to Wolfram Alpha and plug in your equation, and copy down the integer solution it gives you.

x = 2(2a + 1)
y = a + 5b + 1
z = 4a + 3b + 4

Now each variable is neatly isolated—number of repeats in the border, number of repeats of the centre, and number of edging repeats along the length of the stole—and you can start plugging in integers for a and b until you come up with a reasonable-sounding answer. Seriously just pick your favourite integers.

When a = 6 and b = 4,

x = 50
y = 27
z = 40

Since x is both of the border sections put together, that number of repeats will eventually be divided in half: 25 17-row repeats on each side of the centre, which has 27 12-row repeats, and there are 40 edging scallops along the length. That's a total of 800 rows. If the gauge is around 32 rows = 4" after blocking, not an implausible gauge, that's a stole 100" long.

No, thanks.

When a = 5 and b = 1:

x = 22
y = 11
z = 27

That's a lot more realistic; 540 total rows at my gauge is 67.5". There will be edging on the short ends of the stole, too, which will add about four inches to that number—two inches at each end—for a grand total of just a hair under six feet. Now you can knit in peace, knowing that the pattern will fit perfectly and that you are not in for any nasty surprises.

Obviously you need to calculate for width, too, but that's much less fussy. My pattern repeats were all a multiple of 16 sts + 1 wide. With a stitch gauge of 24 sts = 4", and a desire for a stole 24" wide including the edging… 24" - 4" for edging width = 20", or somewhere in the neighbourhood of 120 stitches. 7 repeats would require 113 stitches, close enough to 120.

It is easy to fudge the number of stitches picked up from a strip of edging, and in fact I prefer to. 9 edging repeats yielded a straight edge from which I could pick up 90 stitches, and increase to 113 on the following row. (That's one of the +2 that figured into the row calculations; the other is decreasing those extra stitches away before knitting on the final edging.)

I'm codifying this here now because I am working on a thing! More later, when it's more than a crumpled strip of edging.


m1k1 said...

I look forward to seeing more details of The Thing, once all the equations have aligned etc.
I like equations. Sometimes I just go and sit in the woolly-thoughts rav group and revel in the maths ambience and smile.

B. said...

Soon! Soon. Hopefully. The Thing is going to use a skein of green Tribble I couldn't resist ordering when I was also getting some Phoenix for swatches.

I do that, too—that ambience is very satisfying! I love plotting carefully before the knitting even starts and don't get people who prefer to wing it.