Posts

Showing posts from March 3, 2019

C Program for Laplace Algorithm | C Programming

Image
Laplace Algorithm Laplace’s approximation is one of the most fundamental asymptotic techniques for the estimation of integrals containing a large parameter or variable. For integrals of the form

C Program To Find The Value Using Poison Algorithm | C Programming

C Programming | C Program to find the value using poison algorithm #include<stdio.h> #include<conio.h> #include<math.h> #define g(x,y) 2*(x)*(x)*(y)*(y) int main(){ int n,i,j,k; float sum,error,E[10],a[10][10],b[10],new_x[10],old_x[10],tl,tr,tu,tb,h,buffer; printf("\nPoision's' \n"); printf("Enter the dimension of plate\n"); scanf("%d",&n); printf("\nEnter the dimension of grid\n"); scanf("%f",&h); printf("\nEnter the temperatures at left, right, bottom and top of the plate \n"); scanf("%f%f%f%f",&tl,&tr,&tb,&tu); //construction of coefficient matrix for(i=0;i<=n;i++) a[i][i]=-4; for(i=0;i<=n;i++) a[i][n-i]=0; for(i=0;i<=n;i++) for(j=0;j<=n;j++){ if(i!=j && j!=(n-i)) a[i][j]=1; } //Construction of RHS vector k=0; for(i=1;i<n;i++) for(j=1;j<n;j++) b[k++]=h*h*g(i,j); k=0; for(i=1;i<n;i++){ for(j=1;j&l