Professional Documents
Culture Documents
1. Trapezoidal rule
Start
Define: f(x)
Set: h=(b-a)/n
i=1
Sum=0
Calculate:
Sum=Sum+f(a+i*h)
No
Is i>=n
Yes
Calculate:
Sum=h/2*{(f(a)+f(b)+2*Sum}
Output: Sum
Stop
2. Simpsons 1/3rd rule
Start
Define: f(x)
Set: h=(b-a)/n
i=1
Sum=0
Calculate:
Sum=Sum+f(a+i*h)
No
Is i>=n
Yes
Calculate:
Sum=h/2*{(f(a)+f(b)+2*Sum}
Output: Sum
Stop
3. Simpsons 3/8th rule
Start
Define: f(x)
Input: a and b
Set: h=(b-a)/3
Sum=0
Calculate:
Sum=Sum+3h/8*[f(a)+f(b)+3{f(a+h)+f(a+2h)}]
Output: Sum
Stop
4. Eulers Method
Start
Define: f(x,y)
Set h=(b-a)/n
i=0
Calculate:
yi+1=yi+hf(xi,yi)
xi+1=xi+h No
i=i+1
Is i>n
Yes
Output xi,yi
Stop
5. Runge Kurtta 4th order Method
Start
Define: f(x,y)
Set h=(b-a)/n
i=0
Calculate:
k1=hf(xi,yi)
k2=hf(xi+h/2,yi+k1/2)
k3=hf(xi+h/2,yi+k2/2) No
k4=hf(xi+h,yi+k3)
yi+1=yi+(k1+2(k2+k3)+k4)/6
xi+1=xi+h
i=i+1
Is i>n
Yes
Output xi,yi
Stop
6. Gauss Elimination Method
Start
calculate
x[n]=a[n][n+1]/a[n][n];
for i=n-1 to 1
x[k]=a[k][n+1]
for j=k+1 to n
x[k]=x[k]-a[k][j]*x[j]
x[k]=x[k]/a[k][k]
end loop j
end loop k
for i=1 to n
output x[i]
Stop
7. Legrange Interpolation
Start
Output xi,yi
Stop
8. Least square Method for y=a+bx
Start
Calculate
b= (nXY-XY)/( nx2-(X)2)
a= (Y-bX)/n
Stop
9. Gauss Seidal Iteration Method
Start
for(j=1 to n
if(i!=j)
sum=sum+a[i][j]*x[j]
end loop for j
temp=(a[i][n+1]-sum)/a[i][i]
x[i]=temp;
end loop for i
for i=1 to n
output x[i]
Start Stop
10. Newton forward Formula
Output y at x=xx
Stop
11. Newton backward Formula
Start
Output y at x=xx
Stop
Start
12. Horners Rule
Calculate pn=an
for i =n-1 to 0
pn-1 = pn*x+an-1
end loop for i
Output f0=p0
Stop
13. Bisecton Method
Start
Define: f(x)
Stop Start
Output root x2
Stop
15. Secant Method
Start
Define: f(x)
Output root x3
Stop
16. Fixed Point Iteration Method
Start
i=0
Continue while fabs(f(xi))>=0.0001
xi+1=g(xi)
i=i+1
x3=x2-f(x2)(x2-x1)/(f(x2)-f(x1))