## C Program For Picards Method in Numerical Analysis

Let us understand the concept of Picards Method in numerical analysis and learn how to implement Picard’s method in C programming language.

#### What is Picard’s Method?

The Picard’s method is an iterative method and is primarily used for approximating solutions to differential equations.

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 n^{th} approximation is obtained from one or more previous approximations.

**Must Read: C Program For Newton-Raphson Method**

The Picard’s iterative series is very easy to implement and the solutions obtained through this numerical analysis are generally power series.

#### Picard’s Iteration Method Formula

#### Picard’s Iteration Example

Initial Value: 20

End Value: 40

Allowed Error: 0.5

X = 20.000

**Y(1)** = 202518.2917

**Y(2)** = 42001177.1458

**Y(3)** = 1569554.333

**Must Read: C Program For Bisection Method**

**Note:** This C program for Picard’s method is compiled using CodeLite IDE with GNU GCC compiler on Microsoft Windows 10 operating system. However, this Picard’s method C program is compatible with all other operating systems.

#### C Program To Implement Picards Method using For Loop

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | #include<math.h> #include<stdio.h> #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, end_value, allowed_error, temp; double y1[30], y2[30], y3[30]; int count; printf("\nStart Value:\t"); scanf("%lf", &start_value); printf("\nEnd Value:\t"); scanf("%lf", &end_value); printf("\nAllowed Error:\t"); scanf("%lf", &allowed_error); 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) { 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; } |

**Must Read: C Program For Regula Falsi Method**

#### Output

Let’s discuss more on Picard’s Method in C programming in the comment section below if you have any compilation errors or any doubts about the same. For more information on Picard’s Iterative Method, check **MathForum**.

Thank you so much for c code for Picards numerical method. I couldnt find it in much places.