Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
782 views
Runge Kutta's C Program
dy/dx = -y, y(0) = 1 A Runge-Kutta Method for solving Differential Equations dy/dt = -y(t), y(0)=1, 0<=x<=5, start h=0.1
Uploaded by
Shrishail Kamble
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download now
Download
Save Runge Kutta's C Program For Later
Download
Save
Save Runge Kutta's C Program For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
782 views
Runge Kutta's C Program
dy/dx = -y, y(0) = 1 A Runge-Kutta Method for solving Differential Equations dy/dt = -y(t), y(0)=1, 0<=x<=5, start h=0.1
Uploaded by
Shrishail Kamble
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download now
Download
Save Runge Kutta's C Program For Later
Carousel Previous
Carousel Next
Save
Save Runge Kutta's C Program For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 2
Search
Fullscreen
dy/dx = -y, y(0) = 1
/* A Runge-Kutta Method for solving Differential Equations*/
/* dy/dt = -y(t), y(0)=1, 0<=x<=5, start h=0.1*/
#include <stdio.h>
#define dist 0.1 /* stepsize */
#define xf 5 /* max for x */
FILE *output; /* internal filename */
double rkutta( double x, double y, double h); /*Runge Kutta Function */
double F(double x, double y); /*Function derivative*/
main()
{
double x, y, h;
int n;
output=fopen("xydata.dat", "w"); /* External filename */
h=0.1;
y=1; /* Initial condition */
fprintf(output, "0\t%f\n", y);
for (n=0;dist*n<=xf;n++) /* The time loop */
{
x=n*dist;
y-=rkutta(x, y, dist);
fprintf (output, "%f\t%f\n", x, y);
}
fclose(output);
} /* End of main function*/
double rkutta(double x, double y, double h) /*Called on RK function*/
{
double yn, k1, k2, k3, k4;
double H = h/2.0;
k1 = (h*F(x, y));
k2 = (h*F(x+H, y+(k1/2)));
k3 = (h*F(x+H, y+(k2/2)));
k4 = (h*F(x+h, y+k3));
return(y+=(y+(k1+2*k2+2*k3+k4)*1/6));
}
double F(double x, double y) /*Called on derivative*/
{
return (y);
}
You might also like
Woodcock Johson IV Training Manual PDF
PDF
100% (2)
Woodcock Johson IV Training Manual PDF
48 pages
The First Days of School - Nodrm
PDF
93% (44)
The First Days of School - Nodrm
339 pages
Beginner's Step-By-Step Coding Course Learn Computer Programming The Easy Way, UK Edition
PDF
98% (46)
Beginner's Step-By-Step Coding Course Learn Computer Programming The Easy Way, UK Edition
360 pages
Introduction To Geometry
PDF
90% (21)
Introduction To Geometry
580 pages
The Motivational Interviewing Workbook - Exercises To Decide What You Want and How To Get There
PDF
100% (10)
The Motivational Interviewing Workbook - Exercises To Decide What You Want and How To Get There
224 pages
Digital SAT Math Practice Questions - Sample - 2024
PDF
60% (10)
Digital SAT Math Practice Questions - Sample - 2024
32 pages
Essential Prealgebra Skills Practice Workbook (Chris McMullen) (Z-Library)
PDF
100% (4)
Essential Prealgebra Skills Practice Workbook (Chris McMullen) (Z-Library)
341 pages
Workout Log
PDF
63% (19)
Workout Log
8 pages
Envision Math Common Core Workbook
PDF
50% (4)
Envision Math Common Core Workbook
270 pages
Golf Strategies - Dave Pelz's Short Game Bible PDF
PDF
92% (24)
Golf Strategies - Dave Pelz's Short Game Bible PDF
444 pages
Catherine V Holmes - How To Draw Cool Stuff, A Drawing Guide For Teachers and Students
PDF
97% (35)
Catherine V Holmes - How To Draw Cool Stuff, A Drawing Guide For Teachers and Students
260 pages
Saxon Algebra 2 Small
PDF
100% (6)
Saxon Algebra 2 Small
601 pages
BCBA Exam Questions
PDF
100% (5)
BCBA Exam Questions
30 pages
Parts Work 4th Edition
PDF
100% (30)
Parts Work 4th Edition
166 pages
Math 87 Mathematics 8 - 7 Textbook An Incremental Development Stephen Hake John Saxon
PDF
100% (10)
Math 87 Mathematics 8 - 7 Textbook An Incremental Development Stephen Hake John Saxon
696 pages
Astrology Cheatsheet
PDF
98% (44)
Astrology Cheatsheet
15 pages
Self-System Therapy For Depression Client Workbook
PDF
100% (9)
Self-System Therapy For Depression Client Workbook
113 pages
FarkleRules E PDF
PDF
50% (2)
FarkleRules E PDF
1 page
Worksheets
PDF
100% (1)
Worksheets
2 pages
IEP Goal Bank Freebie
PDF
100% (7)
IEP Goal Bank Freebie
94 pages
Algebra 8-1studyguide
PDF
71% (7)
Algebra 8-1studyguide
110 pages
The Colossal Book of Mathematics PDF
PDF
100% (11)
The Colossal Book of Mathematics PDF
744 pages
MA202.lab9
PDF
No ratings yet
MA202.lab9
7 pages
Bisection 1
PDF
No ratings yet
Bisection 1
3 pages
lab06
PDF
No ratings yet
lab06
3 pages
Using Namespace Float Void Float: #Include
PDF
No ratings yet
Using Namespace Float Void Float: #Include
2 pages
FFT Openmp
PDF
No ratings yet
FFT Openmp
11 pages
Lecture 6 Function
PDF
No ratings yet
Lecture 6 Function
6 pages
bcsl-58 lab
PDF
No ratings yet
bcsl-58 lab
30 pages
Huffman Coding in C
PDF
100% (1)
Huffman Coding in C
9 pages
#Define JMAX 50 #Define Xacc 1e-12: Main
PDF
No ratings yet
#Define JMAX 50 #Define Xacc 1e-12: Main
2 pages
Euler, Euler Mejorado y Runge Kukata
PDF
No ratings yet
Euler, Euler Mejorado y Runge Kukata
3 pages
PROGRAM 16
PDF
No ratings yet
PROGRAM 16
4 pages
nnnn (1)
PDF
No ratings yet
nnnn (1)
4 pages
Lab Program 9
PDF
No ratings yet
Lab Program 9
6 pages
Name: Karan Rana Roll No. 42 Bca 4 SEM Sec - A Program 4.
PDF
No ratings yet
Name: Karan Rana Roll No. 42 Bca 4 SEM Sec - A Program 4.
23 pages
In Class Codes 21 10 2024
PDF
No ratings yet
In Class Codes 21 10 2024
3 pages
ABC
PDF
No ratings yet
ABC
28 pages
Esquema_Metodos_Numericos_Maxima
PDF
No ratings yet
Esquema_Metodos_Numericos_Maxima
2 pages
Computer Graphics Lab Manual For CSE Sixth Semester
PDF
No ratings yet
Computer Graphics Lab Manual For CSE Sixth Semester
15 pages
Chemistry
PDF
No ratings yet
Chemistry
10 pages
LabProgram4.java (1)
PDF
No ratings yet
LabProgram4.java (1)
3 pages
Earth Motion Part 1 (Form Class)
PDF
No ratings yet
Earth Motion Part 1 (Form Class)
3 pages
Listing Program: FUNGSI (Tan X)
PDF
No ratings yet
Listing Program: FUNGSI (Tan X)
3 pages
Type 1
PDF
No ratings yet
Type 1
1 page
merge_pages_6718982873f28
PDF
No ratings yet
merge_pages_6718982873f28
8 pages
EXPERIMENT10
PDF
No ratings yet
EXPERIMENT10
3 pages
New Text Document (5)
PDF
No ratings yet
New Text Document (5)
3 pages
B22CN080_EM-III_Assignment-2
PDF
No ratings yet
B22CN080_EM-III_Assignment-2
12 pages
Numerical Code-1
PDF
No ratings yet
Numerical Code-1
27 pages
Scilab Codes Sem III
PDF
No ratings yet
Scilab Codes Sem III
15 pages
Isma Ainul Amanah
PDF
No ratings yet
Isma Ainul Amanah
8 pages
Plantaasdkjaskljdaskljdlas
PDF
No ratings yet
Plantaasdkjaskljdaskljdlas
2 pages
Cs Assignment 10 By: Bhavesh Mendhekar 1501 ME 15
PDF
No ratings yet
Cs Assignment 10 By: Bhavesh Mendhekar 1501 ME 15
7 pages
Лабораторијска вјежба 3
PDF
No ratings yet
Лабораторијска вјежба 3
4 pages
Thermal Nls Pin Jose
PDF
No ratings yet
Thermal Nls Pin Jose
10 pages
Lab Manual CG
PDF
No ratings yet
Lab Manual CG
24 pages
Bi Section Method
PDF
No ratings yet
Bi Section Method
10 pages
Run C
PDF
No ratings yet
Run C
18 pages
Numerical NNNN
PDF
No ratings yet
Numerical NNNN
23 pages
NM Lab Sheet
PDF
No ratings yet
NM Lab Sheet
64 pages
Float Float Float Float Return Float Float Float Float Return Float Float Float Float Return
PDF
No ratings yet
Float Float Float Float Return Float Float Float Float Return Float Float Float Float Return
1 page
combinepdf (2) (4)
PDF
No ratings yet
combinepdf (2) (4)
82 pages
#Include #Include #Include Int Round (Float) Void Main
PDF
No ratings yet
#Include #Include #Include Int Round (Float) Void Main
2 pages
Bresenham Line Drawing Algorithm
PDF
No ratings yet
Bresenham Line Drawing Algorithm
9 pages
Task #01: Code:-: Function
PDF
No ratings yet
Task #01: Code:-: Function
6 pages
Cmlab
PDF
No ratings yet
Cmlab
17 pages
McEnroe Thesis Appendix A
PDF
No ratings yet
McEnroe Thesis Appendix A
22 pages
Program To Draw A Teddy Bear: Output
PDF
No ratings yet
Program To Draw A Teddy Bear: Output
31 pages
Name:-Tapajyoti Ghosh Roll NO:-: GCECTB-R19-2037 Sub:-Programming Assignment On - Three Loops
PDF
No ratings yet
Name:-Tapajyoti Ghosh Roll NO:-: GCECTB-R19-2037 Sub:-Programming Assignment On - Three Loops
6 pages
Title: Program For Bisection Method Algorithm
PDF
No ratings yet
Title: Program For Bisection Method Algorithm
6 pages
NMCP
PDF
No ratings yet
NMCP
2 pages
UNIT III To V DS Pgms
PDF
No ratings yet
UNIT III To V DS Pgms
25 pages
Normal Contact Stress Code With Quad 4 Node Element
PDF
No ratings yet
Normal Contact Stress Code With Quad 4 Node Element
30 pages
10 Programs
PDF
No ratings yet
10 Programs
21 pages
Depth First Search in C++
PDF
No ratings yet
Depth First Search in C++
6 pages
NewtonRaphson method
PDF
No ratings yet
NewtonRaphson method
1 page
C++ Quick Reference
PDF
No ratings yet
C++ Quick Reference
6 pages
Https Web - Ma.utexas - Edu CNA Cheney-Kincaid Ccode CHP02 Xsinx.c
PDF
No ratings yet
Https Web - Ma.utexas - Edu CNA Cheney-Kincaid Ccode CHP02 Xsinx.c
2 pages
Aditya(Cbnst)
PDF
No ratings yet
Aditya(Cbnst)
18 pages
C Programming Assignment PDF
PDF
0% (1)
C Programming Assignment PDF
12 pages
150+ C Pattern Programs
From Everand
150+ C Pattern Programs
Hernando Abella
No ratings yet
FX 300-Ms Scientific Calculator Tutorial
PDF
No ratings yet
FX 300-Ms Scientific Calculator Tutorial
9 pages
Cramer's Rule - C Program
PDF
100% (2)
Cramer's Rule - C Program
3 pages
Sorting Algorithm in C-Bubble Sort and Selection Sort
PDF
No ratings yet
Sorting Algorithm in C-Bubble Sort and Selection Sort
30 pages
Gauss Seidel Method-C Program
PDF
0% (3)
Gauss Seidel Method-C Program
2 pages
Pre-Algebra and Algebra
PDF
100% (23)
Pre-Algebra and Algebra
66 pages
Algebra 2
PDF
95% (19)
Algebra 2
200 pages
Mathematics Fundamentals
PDF
89% (9)
Mathematics Fundamentals
198 pages
Word Problems With Answers by McMullen
PDF
100% (2)
Word Problems With Answers by McMullen
137 pages
Statistics and Psychology
PDF
100% (14)
Statistics and Psychology
385 pages
Tarasov Calculus
PDF
100% (1)
Tarasov Calculus
179 pages
Common Core 5th Grade Math Questions
PDF
100% (2)
Common Core 5th Grade Math Questions
45 pages
Composing Music For Video Games
PDF
100% (1)
Composing Music For Video Games
25 pages