202rangekutta

Version 1.0.0 (1.17 KB) by raam
range kutta
3 Downloads
Updated 15 Nov 2022

View License

f=input("Enter a two variable function(y,t):");
t0=input("Enter initial value:");
y0=input("Enter initial function value:");
t1=input("Enter value at which function is to be calculated:");
h=input("Enter step size:");
n=(t1-t0)/h;
for i=1:n
k1=h*f(t0,y0);
k2=h*f(t0+h/2,y0+k1/2);
k3=h*f(t0+h/2,y0+k2/2);
k4=h*f(t0+h,y0+k3);
y1=y0+(k1+2*k2+2*k3+k4)/6;
t0=t0+h;
y0=y1;
end
disp(y1);

Cite As

raam (2026). 202rangekutta (https://se.mathworks.com/matlabcentral/fileexchange/120643-202rangekutta), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.0