Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

Runge Kutta Method Formula and C Program

Runge Kutta Method

A Runge Kutta Method of numerically integrating ordinary differential equations by using a trial step at the midpoint of an interval to cancel out lower-order error terms. The second-order formula is

Each of these slope estimates can be described verbally.

  • k1 is the slope at the beginning of the time step.
  • If we use the slope k1 to step halfway through the time step, then k2 is an estimate of the slope at the midpoint. This is the same as the slope, k2, from the second-order midpoint method. This slope proved to be more accurate than k1 for making new approximations for y(t).
  • If we use the slope k2 to step halfway through the time step, then k3 is another estimate of the slope at the midpoint.
  • Finally, we use the slope, k3, to step all the way across the time step (to t₀+h), and k4 is an estimate of the slope at the endpoint.



Runge Kutta Method


C Code For 4th Order Runge Kutta Method


#include<stdio.h>
#include<math.h>
#include<conio.h>
#define f(x,y) 1-2*(x)*(x)*(y)

int main(){
 float x,xp,x0,y0,y,h,m1,m2,m3,m4;
 printf("\n runge-Kutta Forth order\n");
 printf("\nEnter initial values of x and y\n");
 scanf("%f%f",&x0,&y0);
 printf("\nEnter x at which function to be evaluated\n");
 scanf("%f",&xp);
 printf("\nEnter the step size \n");
 scanf("%f",&h);
 y=y0;
 x=x0;
 for(x=x0;x<xp;x=x+h){
  m1=f(x,y);
  printf("\nm1=%f",m1);
  m2=f(x+h/2,y+(h*m1)/2);
  printf("\nm2=%f",m2);
  m3=f(x+h/2,y+(h*m2)/2);
  printf("\nm3=%f",m3);
  m4=f(x+h,y+h*m3);
  printf("\nm4=%f",m4);
  y=y+h/6*(m1+2*m2+2*m3+m4);
  printf("\ny=%f",y);
 }
 
 printf("Function value at x=%f is %f\n",xp,y);
 getch();
 return 0; 
 
}

Comments

Popular posts from this blog

Array in C Programming | C Programming

C program to Find Cartesian Product of Two Sets | C programming

What is System? | SAD