Lecture1 - overview of ODEs#
Overview of ordinary differential equations (ODEs)#
linear -> superposition
nonlinear -> cannot solve
constant coefficients are nice.
First order linear ODEs#
general form: $$\frac{dy}{dt} = ay + q(t) \text{ or } \frac{dy}{dt} = a(t)y + q(t)$$
rate of change: $$\frac{dy}{dt}$$
Examples of first order ODE.#
solve and assume y(0)=1.
$$\frac{dy}{dt}=y \rightarrow y(t)=e^{t}$$
$$\frac{dy}{dt}=-y \rightarrow y(t)=e^{-t}$$
$$\frac{dy}{dt}=2ty \rightarrow y(t)=e^{t^{2}}$$
$$\frac{dy}{dt}=y^{2} \rightarrow y(t)=\frac{1}{1-t}$$
Second order linear ODEs#
second order derivative indicates acceleration or curvature: $$\frac{d^{2}y}{dt^{2}}$$
Hooke’s Las: $$\frac{d^{2}y}{dt^{2}} = -ky$$
fundamental equation of mechanics $$my’’+by’+ky=f(t),$$ where by’ implies dampling.
System of n equations#
first order system, A is a n by n matrix: $$\frac{d\vec{y}}{dt}=A\vec{y}$$
second order system, S is a matrix: $$\frac{d^{2}\vec{y}}{dt^{2}}=-S\vec{y}$$
Numerical solutions#
MATLAB ode45
neural network to solve ODEs
ChatGPT to solve ODEs (BE CAREFULL!)
Partial differential euqations (PDEs)#
heat equation: $$\frac{\partial u}{\partial t}=\frac{\partial^{2} u}{\partial x^{2}}$$
wave equation: $$\frac{\partial^{2} u}{\partial t^{2}}=\frac{\partial^{2} u}{\partial x^{2}}$$
Laplace equation: $$\frac{\partial^{2} u}{\partial x^{2}}+\frac{\partial^{2} u}{\partial y^{2}}=0$$
The calculus you need#
derivitives of functions: $$x^{n}, \sin{x}, \cos{x}, e^{x}, \ln{x}$$
rules for derivatives:
sum rule
product rule
quotient rule
chain rule: $$\frac{dy}{dt}=\frac{dy}{dx}\frac{dx}{dt}$$
fundamental theorem of calculus:
$$ \int_{a}^{b} \frac{dy}{dx},dx = y(b) - y(a) $$
$$ \frac{d}{dx}\int_{a}^{x} f(s),ds = f(x) $$
An example, use all rules#
Show that below function y(t) solves $$\frac{dy}{dt}=y+q{t},$$ where q(t) is an external source term.
Tangent line to a graph#
Taylor expansion series:
Discretized differentiation#
$$\frac{dy}{dx} \approx \frac{\Delta y}{\Delta x}$$
approximate y: $$\Delta y \approx \frac{dy}{dx}\Delta x \rightarrow y(x_{o}+\Delta x) \approx y(x_{o})+\Delta x\frac{dy}{dx}(x_{o}), \text{ assuming we know } \frac{dy}{dx}$$
Newton’s method (finding roots):
central difference
Solve our first ODE#
We don’t know how to solve, but we can guess the exponential-type solution:
if a>0, then the solution grows exponentially
if a<0, then the solution decays exponentially
Geometry veiw of ODEs#
analytic vs geometry:
Superposition#
additivity
homogeneity (porportionality a is a scaler)
use additivity and homogeneity, we can derive:
which is also called linear combination
Linear ODEs?#
are they linear ODEs?
show below ODE does not satisify superposition.
Existence and uniqueness#
For the linear first-order ODE, we are not touching the existence, as it is hard to prove consdering the scale of this class. On the other hand, the uniqueness is rather straightforward. Consider
Assume two solutions are different
Subtract the two equation, we can get
Let
This is a contradiction! So the two solutions have to be the same for all t.
Homogeneous ODE and solution#
Consider
Assume solution is in exponential form
Plug it into the ODE
Use initial condition, we can get
Solution structure#
Consider the ODE with initial condition
where q(t) is the source term.
We can separate solution into two parts:
homogeneous solution or null solution with no source term, which comes from y(0):
particular solution, which comes from q(t):
general solution or complete solution