Why the Time Grid Matters
A numerical method for an initial-value problem advances from one time to the next. Before carrying out those updates, we need to decide which times will be used. A uniform time grid divides an interval into steps of equal length. Its construction is simple, but a mismatch between the interval and the step size can prevent the grid from landing on the desired final time.
This tutorial focuses on the grid itself: how to describe it, calculate its number of steps, and choose a step size that reaches the endpoint exactly. The Forward Euler Update Rule uses successive grid times; here we establish how those times are organized, without performing the updates to the solution values.
Definition of a Uniform Time Grid
Let \(t_0\) be an initial time, let \(T\) be a later final time, and let \(h>0\) be a fixed step size. A uniform grid with \(N\) steps consists of the times \(t_0,t_1,\ldots,t_N\), where every consecutive pair differs by \(h\).
The index \(n\) identifies a grid point, beginning with \(n=0\). The first point is \(t_0\), the next is \(t_1=t_0+h\), and each later point is obtained by adding another \(h\). The value \(h\) measures the distance in time between adjacent points; it is not the number of points.
For the grid to reach \(T\), the interval length must equal the total length of all \(N\) steps. Thus the basic relationship is
This equation connects four quantities: the initial time, the final time, the step size, and the number of steps. If three are specified, the fourth is determined, provided the values are compatible.
Calculating the Number of Steps
If the interval endpoints and step size are given, solve the relationship \(T-t_0=Nh\) for \(N\). The quotient must be a positive integer for a uniform grid of that step size to end exactly at \(T\).
The integer condition is essential. A noninteger quotient does not describe a whole number of equal steps from \(t_0\) to \(T\). It is not appropriate to round that quotient and still claim that all steps have the chosen length and the grid ends at \(T\).
Worked Example: Counting Steps on a Compatible Grid
Construct the grid from \(t_0=2\) minutes to \(T=8\) minutes using a step size \(h=1.5\) minutes. First calculate the interval length:
Then calculate the number of steps:
The quotient is a positive integer, so the grid reaches the final time exactly. Use \(t_n=t_0+nh\) for \(n=0,1,2,3,4\):
There are \(4\) steps and \(5\) grid points. Check the endpoint using the total step length: \(t_0+Nh=2+4(1.5)=2+6=8=T\). Also, every consecutive difference is \(1.5\) minutes.
Choosing a Step Size from a Step Count
Sometimes the desired number of steps is chosen first. For example, a calculation may call for a fixed number \(N\) of equal subdivisions. Once \(t_0\), \(T\), and \(N\) are known, the step size is the interval length divided equally among those steps:
Here \(N\) must be a positive integer. This choice guarantees that \(N\) steps cover the interval because \(Nh=T-t_0\). If the endpoints have units of time and \(N\) is a count, \(h\) has the same time units as the endpoints.
Worked Example: Finding the Step Size for a Fixed Number of Steps
Divide the interval from \(t_0=0\) seconds to \(T=10\) seconds into \(N=8\) equal steps. The interval length is
Divide this length by the number of steps:
The grid points follow from \(t_n=0+n(1.25)\) for \(n=0,1,\ldots,8\):
There are eight intervals between these nine points. Check the endpoint: \(t_8=0+8(1.25)=10\) seconds. Check the spacing, for example \(t_3-t_2=3.75-2.50=1.25\) seconds; the formula \(t_n=t_0+nh\) gives that same difference for each consecutive pair.
Why the Grid Formula Works
The formula \(t_n=t_0+nh\) follows directly from the equal-spacing requirement. Each step adds \(h\). Starting from \(t_0\), after one step we have \(t_1=t_0+h\); after a second step, \(t_2=t_0+2h\). The same reasoning continues for any index.
This derivation also explains why the point count is \(N+1\), not \(N\). There is one starting point, and each of the \(N\) steps adds one new point. Equivalently, the index list \(0,1,\ldots,N\) has \(N+1\) indices.
Checking Compatibility Before Listing the Grid
When the step size is specified, do not begin by generating approximate grid times and hoping the last one is close enough. First test the exact compatibility condition by calculating \((T-t_0)/h\). If this value is an integer, the requested uniform grid exists as stated. If it is not an integer, the selected step size does not divide the interval into a whole number of equal steps.
Worked Example: Detecting an Incompatible Step Size
Suppose \(t_0=1\) hour, \(T=6\) hours, and \(h=0.8\) hour. The interval length is
The proposed number of steps would be
Since \(6.25\) is not an integer, there is no uniform grid with step size \(0.8\) hour that starts at \(1\) hour and ends at \(6\) hours. To make a uniform grid with eight steps, for instance, the compatible step size would instead be
Check this alternative: \(1+8(0.625)=1+5=6\) hours. The original choice \(0.8\) hour is incompatible with the stated endpoints; the recalculated choice \(0.625\) hour is compatible with eight steps.
Keep Time Units Consistent
The interval length and step size must use the same time units before their quotient is calculated. Otherwise, the numerical quotient may not represent a number of steps. Convert one quantity first, then perform the division. The resulting step size should also be reported in the units used for the interval.
Worked Example: Converting Units Before Counting Steps
From \(t_0=30\) minutes to \(T=2\) hours, use a step size of \(h=15\) minutes. Convert the final time to minutes: \(2\text{ hours}=2(60)=120\text{ minutes}\). The interval length is therefore
Now both the interval and step size are in minutes, so
The grid times are \(t_n=30+15n\) minutes for \(n=0,\ldots,6\):
There are six steps and seven points. The final point is \(30+6(15)=120\) minutes, which is \(2\) hours, as required. Each listed time is 15 minutes after the preceding one.
Common Mistake: Rounding the Step Count
A frequent error is to calculate a noninteger step count and round it, while still treating the original step size as exact. Rounding changes the total distance covered. The endpoint check exposes the problem.
Rounding may be appropriate when reporting certain measured quantities, but it cannot repair the exact equality \(T-t_0=Nh\). In grid construction, the endpoint and uniform spacing are structural requirements, not approximate targets.
A Practical Construction Checklist
Before using a time grid in a numerical calculation, verify the quantities and the endpoint relationship. This short sequence helps prevent indexing and unit errors:
Record the initial time \(t_0\) and final time \(T\), with \(T>t_0\).
Express the interval length \(T-t_0\) and the step size in the same time units.
Use \(N=(T-t_0)/h\) when \(h\) is given, or \(h=(T-t_0)/N\) when the positive integer \(N\) is given.
Verify \(t_0+Nh=T\), and remember that the grid contains \(N+1\) points.
Why These Calculations Matter
A grid is the time structure on which a numerical solution is built. In Euler's method, each step uses information at one grid time to advance to the next. If the grid has the wrong number of steps, incorrect spacing, inconsistent units, or a last point that misses the target time, the subsequent computation is not being performed on the intended interval.
It is useful to keep three distinct quantities separate:
| Quantity | Meaning |
|---|---|
| \(h\) | The time difference between consecutive grid points |
| \(N\) | The number of equal steps from \(t_0\) to \(T\) |
| \(N+1\) | The number of grid points, including both endpoints |
The reliable check is always the endpoint identity \(t_0+Nh=T\), together with the requirement that \(N\) is an integer and \(h>0\). Those conditions ensure that the grid starts where intended, uses equal positive steps, and ends exactly at the specified final time.
Check Your Understanding
Use the endpoint relationship and distinguish carefully between steps and points.
- For \(t_0=3\), \(T=15\), and \(h=2\), how many steps and grid points are there?
- A uniform grid runs from \(t_0=4\) to \(T=16\) in six steps. What is \(h\)?
- For \(t_0=0\), \(T=5\), and \(h=1.2\), does the grid reach the endpoint exactly? Explain using the quotient.
- If a grid has 11 points, how many steps does it have?
- A time interval runs from 20 minutes to 2 hours with \(h=20\) minutes. How many steps are required? Show the unit conversion.