0% found this document useful (0 votes)
226 views2 pages

Programme For Adam-Bashforth Method

This program uses the Adam-Bashforth method to solve differential equations numerically. It takes in initial values for x0, y0, step size h, and end point x. It collects function values y at previous x points. It then calculates the weighted sum of previous function evaluations to estimate the next y value, printing out the predicted and corrected values at the end point. The program is authored by Mr. Gobindo with roll number 129.

Uploaded by

Mrinmoy Pramanik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
226 views2 pages

Programme For Adam-Bashforth Method

This program uses the Adam-Bashforth method to solve differential equations numerically. It takes in initial values for x0, y0, step size h, and end point x. It collects function values y at previous x points. It then calculates the weighted sum of previous function evaluations to estimate the next y value, printing out the predicted and corrected values at the end point. The program is authored by Mr. Gobindo with roll number 129.

Uploaded by

Mrinmoy Pramanik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

/*Programme for Adam-Bashforth Method*/

/*NAME: MR GOBINDO ROLL NUMBER 129*/

#include<stdio.h>

#include <math.h>

#include<conio.h>

#define F(x,y) 1 + (y)*(y)

main()

double y0,x0,y1,y[10],n,h,f,sum=0;

int j;

printf("\nEnter the value of x0: ");

scanf("%lf",&x0);

printf("\nEnter the value of y0: ");

scanf("%lf",&y0);

printf("\nEnter the value of h: ");

scanf("%lf",&h);

printf("\nEnter the value of X for finding Y(x): ");

scanf("%lf",&n);

for(x0,j=0; x0<n; x0=x0+h,j++)

printf("\nEnter the value of Y(%.2lf): ",x0);

scanf("%lf",&y[j]);

f=F(x0,y[3]);

sum = sum + 55 * f;

f = F(x0,y[2]);

sum = sum - 59 * f;

f = F(x0,y[1]);
sum = sum + 37 * f;

f = F(x0,y[0]);

sum = sum - 9 * f;

y1 = y[3] + (h/24) * (sum);

printf("\n\n Yp(%.2lf) = %.3lf ",n,y1);

sum = 0;

f = F(x0,y1);

sum = sum + 9 * f;

f=F(x0,y[3]);

sum = sum + 19 * f;

f = F(x0,y[2]);

sum = sum - 5 * f;

f = F(x0,y[1]);

sum = sum + f;

y1 = y[3] + (h/24) * (sum);

printf("\n\n Yc(%.2lf) = %.3lf ",n,y1);

getch();

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy