PICARD'S METHOD:Explanation,algorithm and flowchart
- Get link
- X
- Other Apps
PICARD'S Method
The Picard’s method is an iterative method and is primarily used for approximating solutions to differential equations.
This method of solving a differential equation approximately is one of successive approximation; that is, it is an iterative method in which the numerical results become more and more accurate, the more times it is used.
The Picard’s iterative method gives a sequence of approximations Y1(x), Y2(x), …Yk(x) to the solution of differential equations such that the nth approximation is obtained from one or more previous approximations.
The Picard’s iterative series is relatively easy to implement and the solutions obtained through this numerical analysis are generally power series.
ALGORITHM:
- Step 1: An approximate value of y (taken, at first, to be a constant) is substituted into the right hand side of the differential equation:
dy/dx= f(x, y). - Step 2: The equation is then integrated with respect to x giving y in terms of x as a second approximation, into which given numerical values are substituted and the result rounded off to an assigned number of decimal places or significant figures.
- Step 3: The iterative process is continued until two consecutive numerical solutions are the same when rounded off to the required number of decimal places.
PROGRAM
#include <math.h>
#include <stdio.h>
// required macros defined below:
#define Y1(x) (1 + (x) + pow(x, 2) / 2)
#define Y2(x) (1 + (x) + pow(x, 2) / 2 + pow(x, 3) / 3 + pow(x, 4) / 8)
#define Y3(x) (1 + (x) + pow(x, 2) / 2 + pow(x, 3) / 3 + pow(x, 4) / 8 + pow(x, 5) / 15 + pow(x, 6) / 48)
int
main()
{
double
start_value = 0, end_value = 3,
allowed_error = 0.4, temp;
double
y1[30], y2[30], y3[30];
int
count;
for
(temp = start_value, count = 0;
temp <= end_value;
temp = temp + allowed_error, count++) {
y1[count] = Y1(temp);
y2[count] = Y2(temp);
y3[count] = Y3(temp);
}
printf
(
"\nX\n"
);
for
(temp = start_value;
temp <= end_value;
temp = temp + allowed_error) {
// considering all values
// upto 4 decimal places.
printf
(
"%.4lf "
, temp);
}
printf
(
"\n\nY(1)\n"
);
for
(temp = start_value, count = 0;
temp <= end_value;
temp = temp + allowed_error, count++) {
printf
(
"%.4lf "
, y1[count]);
}
printf
(
"\n\nY(2)\n"
);
for
(temp = start_value, count = 0;
temp <= end_value;
temp = temp + allowed_error, count++) {
printf
(
"%.4lf "
, y2[count]);
}
printf
(
"\n\nY(3)\n"
);
for
(temp = start_value, count = 0;
temp <= end_value;
temp = temp + allowed_error, count++) {
printf
(
"%.4lf "
, y3[count]);
}
return
0;
}
Comments