0% found this document useful (0 votes)
100 views8 pages

Ordinary Differential Equations in Matlab: Day-2: Evening

This document discusses numerical solutions to ordinary differential equations (ODEs) using MATLAB. It introduces first-order ODEs and their solutions. It describes MATLAB functions for solving initial value problems for ODEs, including solvers for stiff and non-stiff systems. It presents the Lotka-Volterra predator-prey equations as an example. It also discusses visualizing ODEs as vector fields and homework on representing the pendulum equation in state-space form.

Uploaded by

KirubaKaran S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views8 pages

Ordinary Differential Equations in Matlab: Day-2: Evening

This document discusses numerical solutions to ordinary differential equations (ODEs) using MATLAB. It introduces first-order ODEs and their solutions. It describes MATLAB functions for solving initial value problems for ODEs, including solvers for stiff and non-stiff systems. It presents the Lotka-Volterra predator-prey equations as an example. It also discusses visualizing ODEs as vector fields and homework on representing the pendulum equation in state-space form.

Uploaded by

KirubaKaran S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Ordinary Differential Equations

Ordinary Differential Equations in


MATLAB

Day-2: Evening

Dr. Prasiddh Trivedi


Ordinary Differential Equations

First-order ODE

The simplest
dy(t)
= ay(t), y(0) = y0
dt

Solution
y(t) = y0 eat

Study of ODEs
Existence and uniqueness.
Continuous dependence on initial conditions.
Equilibria.
Stability.

2/8 Ordinary Differential Equations: Numerical Solutions Dr. Prasiddh Trivedi


Ordinary Differential Equations

MATLAB functions for solving IVP ODEs

Solvers
1. Non-stiff
ode23
ode45
ode113
2. Stiff
ode15s
ode23s, ode23t, ode23tb
3. Implicit
ode15i e.g. tẏ 2 + y = y 3

Options
odeset / odeget

3/8 Ordinary Differential Equations: Numerical Solutions Dr. Prasiddh Trivedi


Ordinary Differential Equations

The simplest
dy(t)
= ay(t), y(0) = y0
dt

Solution
y(t) = y0 eat

4/8 Ordinary Differential Equations: Numerical Solutions Dr. Prasiddh Trivedi


Ordinary Differential Equations

Lotka-Volterra (Predator-Prey) Equation

Predator : p
Prey(Harvested) : h

intrinsic growth rate of prey : alpha


population carrying capacity of environment : K
intrinsic decay rate of predator : β

Predator and Prey(harvested) do not interact


ḣ = αh(1 − h/K)
ṗ = −βp

5/8 Ordinary Differential Equations: Numerical Solutions Dr. Prasiddh Trivedi


Ordinary Differential Equations

Lotka-Volterra (Predator-Prey) Equation

Predator : p
Prey(Harvested) : h

intrinsic growth rate of prey : α


population carrying capacity of environment : K
intrinsic decay rate of predator : β

Predator feeds on Prey(harvested) do not interact


ḣ = αh(1 − h/K) − γhp
ṗ = −βp + δhp

6/8 Ordinary Differential Equations: Numerical Solutions Dr. Prasiddh Trivedi


Ordinary Differential Equations

Visualizing the vector field

Differential equations as vector field


Let’s define a 2-dimensional vectorwhose
 coordinates
  are h and p, respectively.
x1 h
x= =
x2 p

ODE in state-space
 
αx1 (1 − x1 /K) − γx1 x2
ẋ =
−βx2 + δx1 x2

7/8 Ordinary Differential Equations: Numerical Solutions Dr. Prasiddh Trivedi


Ordinary Differential Equations

Homework

Pendulum
d2 θ g
+ sin θ = 0
dt l

1. Represent the equation in state-space form.


2. Plot the solution various initial conditions.
3. Make phase portrait.
4. Plot the vector field.

8/8 Ordinary Differential Equations: Numerical Solutions Dr. Prasiddh Trivedi

You might also like