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 nth approximation is obtained from one or more previous approximations.
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
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; } |
Output

If you have any doubts about the implementation of Picards’s method in C programming, let us know about it in the comment section. Find more about it on MathForum.
Thank you so much for c code for Picards numerical method. I couldnt find it in much places.
But here we input the function as well as its integral by hand is there any way to make the program general so that it can calculate it by itself