Definition2.4.2
An isocline is a line or curve upon which the slope is constant.
A simple, graphical method for approximating solution curves exists for first--order differential equations. This method of approximating solutions uses a special plot called a slope field or a direction field plot. Specifically, if we can write a differential equation in the form: \begin{equation} \boxed{\dfrac{dy}{dx} = f(x,y)} \label{eqn-gen-first-order}\tag{2.4.1} \end{equation} then we can approximate solutions via the slope field plot. So how does one construct such a plot?
The answer lies in noticing that the right hand side of equation (2.4.1) is a function of points in the \(xy\) plane which result in the left hand side which is exactly the instantaneous slope of \(y(x)\text{,}\) the solution function we seek! If we know the slope of a function at every point on the \(x\)–axis, then we can graphically reconstruct the solution function \(y(x)\text{.}\)
Creating a slope field plot is normally done via software on a computer. The basic algorithm that a computer employs to do this is essentially the following:
Divide the \(xy\) plane evenly into a grid of squares.
For each point \((x_i, y_i)\) in the grid do the following:
compute the slope, \(dy/dx = f(x_i, y_i)\text{.}\)
Draw a small bar centered on the point \((x_i, y_i)\) with slope computed above. (Each bar should be of equal length and short enough so that they do not overlap.)
Figure 2.4.1 demonstrates the output of the above algorithm for the differential equation, \(y' = \tfrac{y}{x^2+1}\text{.}\)
As you can imagine the algorithm given above is rather tedious to perform by hand. Luckily, there are several software tools which can do the work for us. This section demonstrates Sage code for generating slope field plots.
The first Sage cell below demonstrates how to create a slopefield for the equation: \begin{equation} \frac{dy}{dx} = 3x^2, \label{men-21}\tag{2.4.2} \end{equation} which has solution \(y = x^3\text{.}\) The slopefield helps you to visualize solution curves.
The idea of a slope field plot becomes much clearer if we plot solution curves along with the slope bars. Of course, usually we will use slope field plots to visualize solutions when we can't solve the differential equation, but first we will demonstrate how to create a slopefield plot with several solution curves when we know the exact general solution.
For example, recall the population model with its accompanying general solution, \begin{equation} \frac{dP}{dt} = kP \qquad P(t) = P_0 e^{kt}. \label{men-22}\tag{2.4.3} \end{equation} It is important to note that no software can plot general solutions, because in order to plot points, the computer must be able to generate coordinate pairs. This can only be done if we specify values for the constants \(P_0\) and \(k\text{.}\)
Sometimes one solution curve plotted against the slope field will suffice. In this case, the desolve_rk4 command will generate both the slope field plot and one approximate solution curve. The code below graphically approximates the linear equation \begin{equation} \frac{dy}{dx} = -y + \cos x \label{men-23}\tag{2.4.4} \end{equation} The approximate solution curve is generated via the 4th order Runge–Kutta algorithm. We will see how this numerical approximation technique works in section 3.2. The code below also demonstrates how to continue a command onto the next line by appending the “\” character to the end of the line.
Finally, we will most often want to combine a slope field plot with multiple numerically approximated solution curves. The following code demonstrates this for the differential equation, \begin{equation} \frac{dy}{dx} = \cos(xy), \label{men-24}\tag{2.4.5} \end{equation} which has no solution expressible in terms of elementary functions. The following code generates the slope field plot and then combines that with the ouput from calling desolve_rk4 repeatedly.
The simple algorithm given above is fine for a computer program, but is very hard for a human to use in practice. However there is a simpler algorithm which can be done by hand with pencil and graph paper. The main idea is to find the isoclines in the slopefield, and plot regularly spaced, identical slope bars over the entire length of the isocline.
An isocline is a line or curve upon which the slope is constant.
Suppose we wish to create a slope--field plot for the differential equation \begin{equation*} \frac{dy}{dx} = x-y = f(x,y). \end{equation*} The method involves two steps. First, we create a table. Each row in the table corresponds to one isocline. Second, for each row in the table we graph the corresponding isocline and decorate it with regularly spaced bars, all of which have equal slope. The slope corresponds to the value in the first column of the table.
Table contains the data for seven isoclines, one for each integer slope value from \(-3, \ldots, 3\text{.}\) We must graph each equation of a line from the third column, and decorate it with regularly spaced bars where the slope comes from the first column.
Slope | Isocline | |||||
\(m\) | \(=\) | \(f(x,y)\) | \(\quad \Longrightarrow \quad\) | \(y\) | \(=\) | \(h(x)\) |
\(-3\) | \(=\) | \(x-y\) | \(\quad \Longrightarrow \quad\) | \(y\) | \(=\) | \(x+3\) |
\(-2\) | \(=\) | \(x-y\) | \(\quad \Longrightarrow \quad\) | \(y\) | \(=\) | \(x+2\) |
\(-1\) | \(=\) | \(x-y\) | \(\quad \Longrightarrow \quad\) | \(y\) | \(=\) | \(x+1\) |
\(0\) | \(=\) | \(x-y\) | \(\quad \Longrightarrow \quad\) | \(y\) | \(=\) | \(x+0\) |
\(1\) | \(=\) | \(x-y\) | \(\quad \Longrightarrow \quad\) | \(y\) | \(=\) | \(x-1\) |
\(3\) | \(=\) | \(x-y\) | \(\quad \Longrightarrow \quad\) | \(y\) | \(=\) | \(x-3\) |
Use the isocline method to create a slope field plot by hand for the following first order differential equation. \begin{equation*} \frac{dy}{dx} = x+y \end{equation*}
Use the isocline method to create a slope field plot by hand for the following first order differential equation. \begin{equation*} \frac{dy}{dx} = y-x+1 \end{equation*}
Use Sage to create a slope field for the nonlinear equation: \begin{equation*} \frac{dy}{dx} = \cos(xy) \end{equation*} with boundaries \(-3 \lt x \lt 3\) and \(-3 \lt y \lt 3\text{.}\)
Use Sage to create a slope field for the nonlinear equation: \begin{equation*} \frac{dy}{dx} = \ln(1+y^2) \end{equation*} with boundaries \(-3 \lt x \lt 3\) and \(-3 \lt y \lt 3\text{.}\)
Use Sage to create a slope field plot for the nonlinear equation: \begin{equation*} \frac{dy}{dx} = y^2\cos(x) \end{equation*} with boundaries \(-\pi \lt x \lt \pi\) and \(-1 \lt y \lt 1\text{.}\)
SolutionThere was a typo in this problem! The \(y\) bounds have been changed: \begin{equation*} \text{from } -3 \lt y \lt 3 \quad \text{to} \quad -30 \lt y \lt 30. \end{equation*}
Find the general solution to the given linear equation. Use Sage to create a slope field plot for the equation: \begin{equation*} \frac{dy}{dx} = y + \cos(x) \end{equation*} with boundaries \(-3 \lt x \lt 3\) and \(-30 \lt y \lt 30\text{.}\) On the same plot axes, plot particular solutions which correspond with the initial conditions \(y(0)=1\) and \(y(0)=-1\text{.}\)