Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB --- RUNGE KUTTA 2 please help with this problem, I need MATLAB (run ready

ID: 3184454 • Letter: M

Question

MATLAB --- RUNGE KUTTA 2

please help with this problem, I need MATLAB (run ready) code for the following, using RUNGE KUTTA 2 method type algorithm.



thank you in advance

/atlm.view.usg.edu/d2l/le/content/1397907/viewContent/21559622/Niew Robert Perkins* My Home Numerical Analysis Se... FitzHugh-Nagumo Model FitzHugh (1961) and Nagumo, Arimoto, Yoshizawa (1962) derived 2-dimensional model for an excitable neuron: dv dt dw l dtt Membrane potential = v- 3 K activation variable : at = typical values: a -0.7, b -0.8. = 13 M0 -.w slow, fast 14i

Explanation / Answer

clc;
clear all;
a=0.7;
b=0.8;
tou=13;
f=@(t,v,w)v-(v.^3/3)-w+1;
g=@(t,v,w)(1/tou)*(v+a-w*b);
h=0.2;% step length


a1=0;%lower limt
b1=1;%upper limit
N=(b1-a1)/h; %number of points
t=a1:h:b1;
v(1)=0; %intial condtion
w(1)=0; %inital condition
%RK2 Method for system
for i=1:N
m1=h*f(t(i),v(i),w(i));
k1=h*g(t(i),v(i),w(i));
m2=h*f(t(i+1),v(i)+m1,w(i)+k1);
k2=h*g(t(i+1),v(i)+m1,w(i)+k1);
v(i+1)=v(i)+(m1+m2)/2;
w(i+1)=w(i)+(k1+k2)/2;
end

v'
w'

ans =

0
0.2187
0.4790
0.7773
1.0934
1.3896


ans =

0
0.0122
0.0280
0.0478
0.0723
0.1012

Note: you have not given I value in first ode and initial conditios also u have not given, but i took and solve this . if you want u can change