TABULA/TabulaGettingStarted

From J Wiki
Jump to navigation Jump to search

TABULA - Getting Started

Install and run TABULA

Warning.png This page is OBSOLETE. A revision is forthcoming.
The best existing "getting started" instructions are here.

Using the j602 Package Manager (menu: Run > Package Manager...) install the addons:

math/uu, math/cal, math/tabula.

Enter:

   load 'math/tabula'

A new window appears:

Tabula01.jpg

Alter the value of item 1

Click on item 1. Its value appears in the input field.

Type-in (or overtype with) a new value and press Enter.

Item 1 changes its value, and so do all items which depend on it (viz. 2, 3, 4).

Changed values get flagged with the symbol @

To undo the change: click Tool04.jpg. To redo the change, Shift-click Tool04.jpg.

Shift-click Tool04.jpg means: hold down the Shift key and click the icon Tool04.jpg.

Another way to alter the value of item 1

Select item 1.

...means: click on item 1 to select it.

  • Click Tool21.jpg to zero its value.
  • Shift-click Tool21.jpg to set its value to 1.
  • Click Tool22.jpg to increase its value by 1. (Shift-click to decrease.)
  • Click Tool23.jpg to increase its value by 1%. (Shift-click to decrease.)

OBSERVATION: a tool icon with red in it means holding down Shift will modify the behavior (usually in the obvious way).

Alter the value of item 2

Yes, unlike in Excel you can alter the value of a calculated item too!

Suitable changes get backfitted to the feeder items, and other dependent items change too.

It's a good idea to start with a fresh copy of the SAMPLE ttable. To reload it, Shift-click Tool01.jpg.

Click on item 2. Its value (0.841) appears in the input field.

Now replace it with the value: 1.

eg Shift-click Tool21.jpg.

You now see:

plot test
  ┌ ┌  1 @      1.571 rad  angle
┌ │ └> 2 @      1.000 /    sine
├ └>   3 @   3.357E-5 /    cosine
└>     4 @      1.000 /    sin+cos

The flag: @ shows that all items have changed. To compare changes, alternately click and shift-click Tool04.jpg.

You see that item 1 changes to some value that yields the sine required (=1). The new value is then used to compute the cosine (item 3) and item 4 is recalculated from 2 and 3.

You also see that item 3 has changed to a very low value, but not quite 0. This happens here because the backfitting algorithm is only approximate.

Not every value you insert for item 2 will be accepted. Thus entering the value: 99 will trigger the error message:

item: 2 resists value: 99

As you'll recall, the sine of an angle cannot exceed 1.

Also the backfit algorithm may fail... but we're making it better and better.

HINT: if a calculated item will not accept a given value you offer to it, try changing its existing value by a small amount, eg by use of Tool23.jpg. You may be able to persuade it to accept the desired value by approaching it in small(ish) steps.

Create a new calculated line

Item 4 is the sum of items 2 and 3. Let's create a new line like it.

Select lines 2 and 3 only.

In Windows: click on line 1 to deselect it. Then click on lines 2 and 3.

On the Macintosh, click 2 (which deselects all other lines) then hold ⌘ down and click 3.

To deselect all other lines, click on line 0 (the title). In Windows you must click on line 0 again to deselect it before it lets you select another line.

Having selected 2 and 3, click Tool05.jpg.

A new line (5) appears. You now see:

plot test
    ┌ ┌  1        1.000 rad  angle
┌ ┌ │ └> 2        0.841 /    sine
├ ├ └>   3        0.540 /    cosine
│ └>     4        1.382 /    sin+cos
└>       5 @      1.382 /    {2}+{3}

Select item 4 (it is redundant). Click Tool03.jpg to delete it.

Adding a new non-calculated item from the Consts library

Click the tab consts. You see a display like this:

Tabula02.jpg

You may see more lines than you want to read through.

Suppose you want the mass of the Moon. Type: moon into the selection string and press Enter.

The display shrinks to just those lines with "moon" in them.

Check the box if you want a case-sensitive selection, eg to search for A (meaning amperes) not a or A in general.

You can search for any text, whether number, units or description.

Once you see the line you want, select it and click "Append".

The chosen line will appear as an item at the bottom of the ttable. Click Tool13.jpg to move it up to where you want it.

The Constants library: consts

The Consts library is held in a file: uuc.ijs. To add to this file: click Tool28.jpg. The file itself contains brief instructions.

To see your changes, restart TABULA. For a warm-start, click Tool16.jpg.

The Consts library serves both to store physical constants and to define scientific units. In order to combine both roles, every constant is given its own unique units. Thus: "mean distance; earth-moon" (defined as 3.84e8 m) is assigned "pseudo-" units [ea.moon]. When you "Append" it you will see:

plot test
  ┌ ┌  1        1.000 rad      angle
┌ │ └> 2        0.841 /        sine
├ └>   3        0.540 /        cosine
└>     4        1.382 /        sin+cos
       5        1.000 ea.moon  mean distance; earth-moon!

The new item shows the distance as "one earth-moon units", not [m] as the consts display shows.

You have a choice of ways to change the new units to familiar ones (eg to show: 3.84e8 m):

  • menu: Edit > Convert to SI Units
  • hotkey: Ctrl+Shift+S
  • input field: enter: [m] (or: [km], [mi] etc.)
  • units dropdown: select the desired units from the list of known compatible units.

The Functions library: functs

Tabula03.jpg

This tab lets you select from a library of calculations. It behaves like the Constants display: consts.

When you click "Append", a new calculated item is added to the ttable, PLUS all the feeder items it needs.

You can then alter the feeders' names and values, or (more commonly) you will merge Tool25.jpg each feeder with an existing item. Items for merging must be compatible, ie each convertible into the other.

The Information display: info

Tabula04.jpg

This serves to display various sorts of Help text: Tool29.jpg Tool30.jpg

It also lets you add a note to be saved with the ttable (called ttinfo). The note will display here when you click Tool31.jpg.

WARNING: if you leave the Info display, say by clicking tab Ttable, you will lose what you've typed unless you first click "Update".


Contributed by Ian Clark