# TNPL JoongJin-Cho Runge-kutta’s method of order 4.

## Presentation on theme: "TNPL JoongJin-Cho Runge-kutta’s method of order 4."— Presentation transcript:

TNPL JoongJin-Cho Runge-kutta’s method of order 4

TNPL JoongJin-Cho This routine solve the initial value problem at equidistant points Here the function f(x,t) is continuous the at equidistant points Here the function f(x,t) is continuous theinterval Algorithm

TNPL JoongJin-Cho Algorithm

TNPL JoongJin-Cho Runge-Kutta ’ s method of order 4 to solve a first-order differential equation Algorithm

TNPL JoongJin-Cho public static void main(String args[]){ int i; double t,ti,h,x,xi, N=5; double f; //Differential equation dx/dt=f(x,t)=x+t double t0,x0,f1,f2,f3,f4; x=xi; t=ti; f=x+t; for(i=0;i { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/11/3248293/slides/slide_5.jpg", "name": "TNPL JoongJin-Cho public static void main(String args[]){ int i; double t,ti,h,x,xi, N=5; double f; //Differential equation dx/dt=f(x,t)=x+t double t0,x0,f1,f2,f3,f4; x=xi; t=ti; f=x+t; for(i=0;i

TNPL JoongJin-Cho import java.io.*; public class RungeKutta2{ static BufferedReader bf = new BufferedReader (new InputStreamReader(System.in)); //4th order Runge-Kutta method, need derivative f public static void main(String args[])throws IOException { int i; double t,ti,h,x,xi,N=5; double f; double t0,x0,f1,f2,f3,f4; String str; System.out.print("Input initial value ti = >"); str=bf.readLine(); ti=Double.parseDouble(str); System.out.print("Input initial value xi = >"); str=bf.readLine(); xi=Double.parseDouble(str); System.out.print("step size h = >"); str=bf.readLine(); h=Double.parseDouble(str);

TNPL JoongJin-Cho x=xi; t=ti; f=x+t; for(i=0;i { "@context": "http://schema.org", "@type": "ImageObject", "contentUrl": "http://images.slideplayer.com/11/3248293/slides/slide_7.jpg", "name": "TNPL JoongJin-Cho x=xi; t=ti; f=x+t; for(i=0;i