Tutorial 1: The Basics


In this tutorial, we learn the basics of entering an ODE, specifying initial conditions, and plotting solution curves.



When ODE Toolkit first starts, it displays the window shown below. The text input box, where ODE's are entered, is along the left-hand side of the screen. It is circled in green in the image below. Under it, we see the Enter ODE button, circled in red, which must be clicked when we are finished entering data in the text input box. Below this and circled in yellow is a text box labeled Solve Span. The value in this box tells ODE Toolkit how far to solve in time when the user clicks either the Solve Forward or Solve Backward button in the toolbar, which is located in the top right portion of the screen and circled in purple. Below the toolbar is the graph, circled in light blue, where solution curves are plotted.

Note: You may click on the above image to see a larger version of it.

Begin by entering the following equation into the text input box:

 x' = 2*t 
This defines a system of ODE's with one state variable, x, defined in terms of the independent variable t. Note that ODE Toolkit always treats t as the independent variable in an ODE, and, thus, t need not (and cannot) be defined elsewhere in the text input box. You might also notice the explicit use of the multiplication symbol. ODE Toolkit does not support implicit multiplication, so this is always necessary. For example, the input x'=2t would be invalid. Also note that it is entered in normal form (i.e. x' = f(t, x)). We could not, for example, have entered the equation as x'-2*t=0. Click on the Enter ODE button when you are finished entering the text.

Notice that the screen has now changed to reflect the image below:

Note: You may click on the above image to see a larger version of it.

The area under the the Enter ODE button now contains boxes, circled in green, in which we can enter the initial conditions of the system. Note that by default, all of the initial conditions are set to 0. Also note that now there are three tabs under the graph, circled in red and labeled x-t, Multi-Graph, and Data. The only one we are interested in now is x-t, which shows a plot of the state variable x vs. the independent variable t. The other tabs will be explored in a later tutorial.

Now we are ready to start plotting solutions. Click the button labeled Solve Forward in the toolbar. This tells the program to compute a solution curve forward in time, starting at the time entered in the box labeled t: and ending at this time plus the value entered in the Solve Span box. In this case, the initial time is 0 and the solve span is 10, so the program computes a solution curve from t = 0 to t = 10. Notice how the graph automatically scales as solution curves are plotted so that all of the curves can be seen at once. Now click the Solve Back button in the toolbar. This tells the program to solve backward from the initial time by the amount specified in Solve Span. In this case, it solves from t = 0 to t = -10.

To extend the curve in the forward direction, click the Solve Forward button again. This solves forward in time from the right end of the solution curve by the amount given in the Solve Span text box. In this case, it solves from t = 10 to t = 20. The window should now look something like this:

Note: You may click on the above image to see a larger version of it.

Notice the label x102 above the graph's vertical axis. This indicates the scale of the axis, so in this case, the mark 2.0 on the vertical the axis really means 200.

Now that we have computed one solution curve, let's try changing the initial conditions and plotting some more. Initial conditions can be set in two ways: either by left-clicking on the graph at the desired point while using the Pick Initial Conditions tool or by typing values directly into the text boxes below Enter ODE and above Solve Span. Let's try the former method first. Right-click anywhere on the graph and the following menu should appear:

To choose initial conditions with the mouse, select the Pick Initial Conditions option. Now left-click, for example, on the point (t=0, x=50) on the graph. Remember that because of the current vertical scale, the x = 50 mark is labeled 0.5. Notice that the values in the text boxes labeled t: and x: change to reflect this point. Now click Solve Forward on the toolbar. A new solution curve will appear, starting at the point that we clicked on the graph.

The other way to specify initial conditions is by typing them directly into the initial condition text boxes. Let's try computing a solution curve backward in time with the initial conditions x = 20, t = 5 by typing 20 into the text box labeled x: and 5 into the box labeled t:. To make things interesting, we'll also change the solve span to 20 by typing 20 into the text box labeled Solve Span. Now click on the Solve Back button. Note that the new solution curve starts at t = 5 and ends at t = -15 because the solve span was set to 20. The window should now look something like this:

Note: You may click on the above image to see a larger version of it.

Well, that's it for this tutorial! I hope you've learned a lot and will take some time to explore the program a little more. When you are ready, check out some of the other tutorials. Happy ODE'ing!