import sympy as sym
import matplotlib.pyplot as plt
'x y')
sym.var(= sym.plot_implicit(x**2 + 7/2*y**2-1, show = False, line_color = 'b')
plot1 = sym.plot_implicit(x**2 + 7/2*y**2-4, show = False, line_color = 'r')
plot2 = sym.plot_implicit(x**2 + 7/2*y**2-9, show = False, line_color = 'g')
plot3 0])
plot1.append(plot2[0])
plot1.append(plot3[ plot1.show()
3.3: Phase Plane Equations
The Phase Plane Equation
Consider a system of two differential equations:
\[\begin{aligned} \frac{dx}{dt} &=f(x,y) \\ \frac{dy}{dt} &=g(x,y) \end{aligned}\]
Recall from the chain rule we have \[ \frac{dy}{dx} \frac{dx}{dt} = \frac{dy}{dt},\] which gives the phase plane equation \[\color{dodgerblue}{\boxed{\large \frac{dy}{dx} = \frac{ \frac{dy}{dt}}{\frac{dx}{dt}} = \frac{g(x,y)}{f(x,y)}}}.\]
Question 1:
Write and solve the corresponding phase plane equation for the system
\[\begin{aligned} \frac{dx}{dt} &=7y \\ \frac{dy}{dt} &=-2x \end{aligned}\]
Solution to Question 1:
Question 2:
Make a sketch of several solutions in the phase plane, include arrows to indicate how solutions behave with respect to time.
Solution to Question 2:
Equilibrium Solutions
A point \((x_0,y_0)\) is called an equilibrium (or critical point) of the system
\[\begin{aligned} \frac{dx}{dt} &=f(x,y) \\ \frac{dy}{dt} &=g(x,y) \end{aligned}\]
if both \(f(x_0,y_0)=0\) and \(g(x_0,y_0)=0\).
The corresponding solution \((x(t),y(t)) = (x_0,y_0)\) is called an equilibrium solution.
Question 3:
Find the equilibrium to the system
\[\begin{array}{l} \dfrac{dx}{dt} =2x-y+8 \\ \dfrac{dy}{dt} =3x+6 \end{array}.\]
Solution to Question 3:
Question 4:
Find the equilibrium to the system
\[\begin{array}{l} \dfrac{dx}{dt} =y^2-xy \\ \dfrac{dy}{dt} =2xy-4 \end{array}.\]
Solution to Question 4:
Question 5:
Find the equilibrium. Then find and solve the phase plane equation.
\[\begin{array}{l} \dfrac{dx}{dt} =6x \\ \dfrac{dy}{dt} =3y \end{array}\]
Solution to Question 5:
Question 6:
Find the equilibrium. Then find and solve the phase plane equation.
\[\begin{array}{l} \dfrac{dx}{dt} =4-4y \\ \dfrac{dy}{dt} =-4x \end{array}\]
Solution to Question 6:
Question 7:
Find the equilibrium. Then find and solve the phase plane equation.
\[\begin{array}{l} \dfrac{dx}{dt} =2y^2-y \\ \dfrac{dy}{dt} =x^2y \end{array}\]
Solution to Question 7:
Appendix: Plotting with phase_portrait
As with slope fields, we typically rely on technology to plot phase plane portraits. The ode_tools
module (same file as earlier) includes a function called phase_portrait
that will be a nice tool for visualizing solutions to autonomous systems of differential equations.
Loading ode_tools
from GitHub
- Run the code cell below to load the most up to date modules stored in GitHub.
- You will only need to run this code cell one time during an active session.
!pip install git+https://github.com/CU-Denver-MathStats-OER/ODEs
from IPython.display import clear_output
clear_output()
Importing the phase_portrait
Plotting Function
After you followed the instructions above and imported the ode_tools
module from GitHub, you are now ready to import the phase_portrait
function.
from utils.ode_tools import phase_portrait # Only need to import one time.
Defining the System of Differential Equations
We use \(x\) and \(y\) as the generic symbols for the two dependent variables.
\[\begin{align} \frac{dx}{dt} &= f_1(x, y)\\ \frac{dy}{dt} &= f_2(x, y) \end{align}\]
Below, we enter the system we analyzed in Question 1.
\[\begin{aligned} \frac{dx}{dt} &=7y \\ \frac{dy}{dt} &=-2x \end{aligned}\]
import numpy as np
# Set viewing window
= np.linspace(-5.0, 5.0, 20) # y1 is horizontal axis
x = np.linspace(-5.0, 5.0, 20) # y2 is vertical axis
y
def f(Y, t):
= Y
x, y return [7*y , -2*x] # enter f_1(y1, y2) and f_2(y1,y2)
Plotting with phase_portrait
# Plots a phase portrait
phase_portrait(x, y, f)
Creative Commons License Information
Exploring Differential Equations by Adam Spiegler is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at https://github.com/CU-Denver-MathStats-OER/ODEs and original content created by Rasmussen, C., Keene, K. A., Dunmyre, J., & Fortune, N. (2018). Inquiry oriented differential equations: Course materials. Available at https://iode.sdsu.edu.