TABULA/samples/backfit

From J Wiki
Jump to navigation Jump to search

Backfitting: what does it mean?

When you work with a conventional spreadsheet like Excel™ or Apple® Pages™, if you overtype a formula cell with a number, the cell's formula is discarded, to be replaced by the number you typed.

When you work with TABULA, if you overtype a calculated item with a number, its formula is preserved. Instead the values of contributing items (the ancestors or leaves) are adjusted to compute the number you typed-in. This process is called backfitting, and the overtyped value is said to be backfitted across the ancestors.

The code to implement this process is called the functional inversion subsystem (or just inversion). It is part of the CAL engine.

To achieve backfitting, TABULA tries to alter all the ancestors in an even-handed way. This is rarely what you want. Thus, if a given t-table computes the velocity at ground level of a released object from the height of fall and the acceleration due to gravity, when you overtype the final velocity you expect to see a change in the height of fall, but not a change in the earth's gravity itself!

The remedy is to hold the items you don't want to change.

Holding an item

TABULA lets you hold an item you don't want to be altered by backfitting. (This does not prevent you altering the value yourself by directly overtyping it.)

The hold tool has a toggle action, i.e. a second click will unhold the held item.

Whenever you create a line by choosing a scientific constant from the Constants tab, it is created already-held.

To tell if a line is held or not, look at the right hand end of the label. If the label ends in  =  then it is held. (You can also edit the label and type the trailing = by hand: it makes no difference.)

The feature just described is a permanent hold, in the sense that the line remains held until it is explicitly unheld, and this "held" status is preserved by saving and reloading the t-table.

Putting a transient hold on an item

There is a second kind of hold called a transient hold. To hold/unhold the selected item this way, shift+click the tool hold.

A transient hold is not saved with the t-table, and is cancelled at the end of every backfit.

Use it when performing trial backfits to temporarily prevent a given item from changing its value.