Excel spreadsheet can be used to solve an initial value problem using Euler’s Method.
Consider for example the initial value problem
Create four column headings, in Excel spreadsheet as shown
Label a cell “timestep” somewhere above the table headings and enter the timestep size that has to be used in the cell next to it, as shown
Now, enter the values of the initial condition in the first two columns as shown
Complete the column for x-values, using the fact that each x-value is the previous x-value plus the timestep. To calculate the x-values enter the formula ‘=B5+D$2’ in the cell B6. This result into the value 0.1 then drag the cell B6 down the column until the desired ending value.
Use the right-hand side of the differential equation to compute the value of the first cell in the dy/dx column. Enter the formula ‘=B5+C5’ in the cell D5.
Now, since
So, enter the formula ‘=C5+D5*D$2’ in the cell E5.
Now, enter the next y-value which the first entry in the ‘new y’ column. So, enter the value ‘=E5’ in the cell C6.
Then highlight the first cells in the last two columns, and drag them down one row to complete second column of the table as shown
Finally, complete the table by highlighting the second entries in the last three columns, and dragging them down as far as the x-column goes as shown.