Section 3.7.1 - Numerical Grid Setup

The function f(x) = a x b is specified by the values of a and b . The grid is specified by x_min, x_max, and N_grid from which dx is calculated. We now proceed to build the table specifying the values for these quantities.

Step 1. Prepare the labels for the table specifying the function parameters and grid quantities. This table should be a bit out of the way to leave space to later build the function table.

Step 2. We need to specify "names" for the cells containing the values of these parameters. This will greatly simplify building the function table. The easiest way to proceed is to use the "Insert" - "Name" - "Create" option from the menu bar for each table.

- Select the table with cells to label (label and value cells)

- Click on the "Insert" - "Name" - "Create" option

- Excel presents a dialog box suggesting names to use (labels from either top or left of value cell); select the appropriate option

You can check that the labeling of the cells went right by placing the cursor in the value cell and seeing that the name is effectively appearing in the "name box" or "cursor location" field.

Step 3. Enter the values for a , b, x_min, and x_max

Step 4. Insert the formula for dx ( by typing "=" followed by the formula )

Step 5. Build the f(x) versus x table

- Set the headers

- Set the first value of x be x_min ( by typing "=" followed by x_min )

- Set the second value (second row) equal to the previous value (click on the cell above it) + dx

- Fill down the column to the desired length

+ Select the second row

+ Move the mouse to the lower RHS of the cell ( the cursor becomes a + )

+ Drag down to the desired length ( length of table is number of grid points ); this repeats the content of the original cell down the chosen cells. Excel automatically changes the relative references to the appropriate cells. In this case, the "cell above" will remain the "cell above" throughout the column. The references to named cells are not modified by the fill-in process. This is why it was necessary to give names to the Function Definition and Grid Definition tables above.

Step 6. The number of numerical grid points is the number of rows in the table. This need to be implemented in the Grid Definition table.

- Select the N_grid value cell (to the right of the label N_grid)

- Type in =

- Select from the menu bar "insert" - "function" and then the "ROWS()" function from the "Lookup & Reference" category of the "Paste Function" dialog panel

- This function returns the number of rows in a selection of cell. Select the cells to count by dragging the mouse over the x column of the table

At this point Excel will calculate dx, and the table should show x in the range x={x_min,x_max}. Check that this is so, and make sure that the grid is properly setup by changing x_min and/or x_max and making sure that the changes propagate to the function table.


  back

Any questions or suggestions should be directed to
Michel Vallières at vallieres@physics.drexel.edu