10.runge Kutta Method Of Order 2.txt

  • Uploaded by: Sayan Chowdhury
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 10.runge Kutta Method Of Order 2.txt as PDF for free.

More details

  • Words: 83
  • Pages: 1
#include <stdio.h> #include <math.h> #define f(x,y) ((2-pow(y,2))/(5*x)) int main() { double x0,y0,xn,y1,x,y,h,k1,k2,k3,k4,k; int i=0; printf("\nEnter the initial value of x: "); scanf("%lf",&x0); printf("\nEnter the initial value of y: "); scanf("%lf",&y0); printf("\nEnter the final value of x: "); scanf("%lf",&xn); printf("\nEnter the value of step length: "); scanf("%lf",&h); printf("\n NI x y k1 k2 k y1"); printf("\n=========================================================="); x=x0; y=y0; for(x=x0;x<xn;x=x+h) { k1=h*f(x,y); k2=h*f((x+h),(y+k1)); k=(k1+k2)/2; y1=y+k; y=y1; i++; printf("\n %2d %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf %0.6lf",i,x,y,k1,k2,k,y1); } printf("\n=========================================================="); printf("\nHence the value of y(%0.4lf) = %0.6lf",xn,y1); }

Related Documents


More Documents from ""

Sony Ic Recorder.docx
April 2020 0
Tripura
August 2019 61
Tender For Security 13
August 2019 56
111 Egg Recipes.pdf
June 2020 3
Mw_tripura.pdf
August 2019 74