Docsity

Math 269A Assignment 3: Runge-Kutta Method and Fitzhugh-Nagumo System, Assignments of Mathematical Methods for Numerical Analysis and Optimization

Toggle sidebar
bg1
Math 269A: Assignment 3
Assigned Monday Oct 22, due Monday Oct 29
Theory
[1] The classic 4th order Runge-Kutta method is
11
211
312
413
1123
2
2
(22
6
n
n
n
n
nn
Yy
h
Yy f
h
Yy f
Yy hf
h
yy f f ff
โˆ’
โˆ’
โˆ’
โˆ’
โˆ’
=
=+
=+
=+
=+ +++
4
)
11
23 1/2 1
4
(, )
2
kkk
n
nn
n
ffTY
Tt
h
TTt t
Tt
โˆ’
โˆ’โˆ’
=
=
=
==+
=
Rewrite this in the form 111
(, ,
nn nn
)
y
yhtyh
โˆ’โˆ’โˆ’
=+ฮจ ; i.e., find an expression for the
function ฮจ.
Computation
[2](a) Implement the RK4 method to solve the problem
2
32
2( 1)
(0) 1
dy t t
dt y
y
1
+
+
=โˆ’
=โˆ’
from HW1. Plot the numerical and exact solutions on the interval [0,2] for a reasonable
choice of time steps.
(b) Compare to the exact solution found in HW1 and use the result to estimate the rate of
convergence for RK4 on this problem. Specifically, find the error between the exact
solution and numerical solution at t = 2.0 using a reasonable set of timesteps dt.
pf2

Partial preview of the text

Download Math 269A Assignment 3: Runge-Kutta Method and Fitzhugh-Nagumo System and more Assignments Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Math 269A: Assignment 3

Assigned Monday Oct 22, due Monday Oct 29

Theory

[1] The classic 4th^ order Runge-Kutta method is

1 1 2 1 1

3 1 2 4 1 3 1 1 2 3

n n

n n n n

Y y Y y hf

Y y hf Y y hf y y h f f f f

โˆ’ โˆ’

โˆ’ โˆ’ โˆ’

1 1 2 3 1/2 1 4

k k k n n n n

f f T Y T t T T t t h T t

โˆ’ โˆ’ โˆ’

Rewrite this in the form yn = y (^) n โˆ’ 1 + h ฮจ ( t (^) n โˆ’ 1 , yn (^) โˆ’ 1 , h ); i.e., find an expression for the function ฮจ.

Computation

2 Implement the RK4 method to solve the problem

3 2 2 2( 1) (0) 1

dy t t dt y y

= +^ +^1

from HW1. Plot the numerical and exact solutions on the interval [0,2] for a reasonable choice of time steps.

(b) Compare to the exact solution found in HW1 and use the result to estimate the rate of convergence for RK4 on this problem. Specifically, find the error between the exact solution and numerical solution at t = 2.0 using a reasonable set of timesteps dt.

(c) Apply your program to use RK4 to solve the Fitzhugh-Nagumo system

( )( 1)

( ) (0) 0. (0) 0. 0.01, 0.2, 2.5, 0.

du (^) u u u v dt dv (^) u v dt u v

over the time interval 0