# Classifying differential equations

- toc:false
- branch: master
- badges: true
- comments: false
- categories: [mathematics, numerical recipes]
- hide: true

# 💃 Classifying differential equations 💃



Questions:
- What is a <mark>differential equation</mark>?
- What is the difference between an ordinary (<mark>ODE</mark>) and partial (<mark>PDE</mark>) differential equation? 
- How do I classify the different types of differential equations?

Objectives:
- Identify the dependent and independent variables in a differential equation
- Distinguish between and ODE and PDE
- Identify the <mark>order</mark> of a differential equation
- Distinguish between <mark>linear</mark> and <mark>non-linear</mark> equations
- Distinguish between <mark>heterogeneous</mark> and <mark>homogeneous</mark> equations
- Identify a <mark>separable</mark> equation

### A differential equation is an equation that relates one or more functions and their derivatives

- The functions usually represent physical quantities (e.g. position $x$)
- The derivative represents a rate of change (e.g. speed $v$)
- The differential equation represents the relationship between the two:

\begin{equation}
v = \frac{dx}{dt}
\end{equation}

### An independent variable is... a quantity that varies independently...

- An <mark>independent variable</mark> does not depend on other variables
- A <mark> dependent variable</mark> depends on the independent variable

\begin{equation}
v = \frac{dx}{dt}
\end{equation}

- $t$ is the <mark>independent</mark> variable
- $x$ is the <mark>dependent</mark> variable
- Writing $x = x(t)$ makes this relationship clear.
 

### Differential equations can be classified in a variety of ways

There are several ways to describe and classify differential equations. There are standard solution methods for each type, so it is useful to understand the classifications. 



<small>Once you can cook a single piece of spaghetti, you can cook all pieces of spaghetti!</small>

### An ODE contains differentials with respect to only one variable

For example, the following equations are ODEs:

\begin{equation}
\frac{d x}{d t} = at
\frac{d^3 x}{d t^3} + \frac{x}{t} = b
\end{equation}

As in each case the differentials are with respect to the single variable $t$.



### Partial differential equations (PDE) contain differentials with respect to several independent variables. 

An example of a PDE is:

\begin{equation}
\frac{\partial x}{\partial t} = \frac{\partial x}{\partial y} 
\end{equation}

As there is one differential with respect to $t$ and one differential with respect to $y$. 

Note also the difference in notation - <mark>for ODEs we use $d$ whilst for PDEs we  use $\partial$</mark>.

> Note: the equations in this notebook are formatted using [LaTeX](https://www.latex-project.org/). 


### The order of a differential equation is the highest order of any differential contained in it. 

For example:

$\frac{d x}{d t} = at$ is <mark>first order</mark>. 

$\frac{d^3 x}{d t^3} + \frac{x}{t} = b$ is <mark>third order</mark>.

> Important: $\frac{d^3 x}{d t^3}$ does not equal $\left(\frac{d x}{d t}\right)^3$!

###  Linear equations do not contain higher powers of either the dependent variable or its differentials

For example:

$\frac{d^3 x}{d t^3} = at$ and $\frac{\partial x}{\partial t} = \frac{\partial x}{\partial y} $ are <mark>linear</mark>.

$(\frac{d x}{d t})^3 = at$ and $\frac{d^3 x}{d t^3} = x^2$ are <mark>non-linear</mark>.

Non-linear equations can be particularly nasty to solve analytically, and so are often tackled numerically.




### Homogeneous equations do not contain any non-differential terms

For example:

$\frac{\partial x}{\partial t} = \frac{\partial x}{\partial y}$ is a <mark>homogeneous equation</mark>.

$\frac{\partial x}{\partial t} - \frac{\partial x}{\partial y}=a$ is a <mark>heterogeneous equation</mark> (unless $a=0$!).



### Separable equations can be written as a product of two functions of different variables

A separable differential equation takes the form 

\begin{equation}
f(x)\frac{d x}{d t} = g(t)
\end{equation}

Separable equations are some of the easiest to solve as we can split the equation into two independent parts with fewer variables, and solve each in turn - we will see an example of this in the next lesson.

---

Do [the quick-test](https://nu-cem.github.io/CompPhys/2021/08/02/ODE-Types-Qs.html).

Back to [Modelling with Ordinary Differential Equations](https://nu-cem.github.io/CompPhys/2021/08/02/ODEs.html).

---


Keypoints:

- An independent variable is a quantity that varies independently
- Differential equations can be classified in a variety of ways
- An ODE contains differentials with respect to only one variable
- The order is the highest order of any differential contained in it
- Linear equations do not contain higher powers of either the dependent variable or its differentials
- Homogeneous equations do not contain any non-differential terms


```python

```

5331386fa23847a36f9f01d0c865c41fe81c03ee
ipynb
Jupyter Notebook
slides/2021-08-02-ODE-Types.ipynb
charlo66609/CompPhys
a28ad04f44e314adf238d4ea9dc8d73af4bce2ce
CC-BY-4.0
slides/2021-08-02-ODE-Types.ipynb
charlo66609/CompPhys
a28ad04f44e314adf238d4ea9dc8d73af4bce2ce
CC-BY-4.0
2021-10-06T08:11:43.000Z
2021-11-24T13:46:08.000Z
slides/2021-08-02-ODE-Types.ipynb
charlo66609/CompPhys
a28ad04f44e314adf238d4ea9dc8d73af4bce2ce
CC-BY-4.0
2021-11-03T10:11:28.000Z
2021-11-03T10:11:28.000Z
Qwen/Qwen-72B
1. YES
2. YES