# Multi-speed and Single-speed

New to the Cycling Calculator are the Multi-speed and Single-speed options. The forms page loads with Multi-speed as the default. Previous versions of the Cycling Calculator always processed the supplied data as multi-speed.

## Multi-speed mode

In Multi-speed mode, the chainring is seen as a single unit of one or more chainrings; double crank, triple crank, etc. And the freewheel is seen as a multi-speed cluster; 1,2,3,4,5,6,7 or more cogs, etc. In Multi-speed mode, each chainring value is calculated against every freewheel value. Essentially the data is processed in a double loop:
```	foreach chainring {
foreach freewheel {
calculate
}
}
```

As seen in the screen shot below, Multi-speed mode has been chosen, and four chainring values have been selected; 53, 42, 36 and 48. We also see that four freewheel values have been selected; 21, 19, 26 and 24.

This will be interpreted as a quadruple crank and a four cog freewheel; 4 multiplied by 4, a 16 speed setup. The 53 tooth chainring will be calculated against each of the four freewheels (as shown with the green lines), then the 48 tooth chainring gets its shot at each freewheel, as do the 42 and 36 tooth chainrings. In Multi-speed mode, all "0" (zero) values are deleted, processing only takes place on non-zero values.

## Single-speed mode

In single-speed mode, each chainring and freewheel entry are seen as a single unit. As shown in this next screen shot, each circled chainring and freewheel represents a single fixed speed setup.

In column one we have selected a 53 tooth chainring and a 21 tooth cog. That 53x21 combination is unique and is in no way associated with the values selected in column two, column three, four, five, etc.

In single-speed mode the data is processed as a single loop:

```	foreach chainring and freewheel column {
calculate
}
```

In Single-speed mode, "0" (zero) values are deleted. In column 6 (circled) the chainring is set to zero and the freewheel is set to 24. In column 8 (circled) the chainring is set to 48 and the freewheel is set to zero.

Because the program now sees the submitted data as individual vertically aligned columns, those vertical columns that contain a zero value will be deleted. So in this case, the 0x24 entry in column 6 and the 48x0 entry in column 8 will be deleted because one of the paired values contains a zero.

jbarrm at panix.com