Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: simplest with best research
Description: These notes were made after a lot of research by me. I made these notes very simple and understandable. Please share these asap.

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


NUMERICAL ANALYSIS AND
STATISTICAL TECHNIQUES LAB
ETMA -252

SUBMITTED TO
URFI SIR

SUBMITTED BY
VISHAL SINGH
MAE- IV SEMESTER
00320903613

INDEX
S
...

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Name of the Experiment

Page
No
...


3

To write a program in C language for finding Sum and
Average of ‘n’ integer numbers
...


7

To write a program in C language for finding sum of
series of function Sin(x) up to 5th term
...


Date

10

To write a program in C language for finding value of
function at given value of argument on the basis of given
data by using Newton’s Divided Difference method
...


16

To write a program in C language for calculating value of
integration within given limits and number of intervals by
Trapezoidal Rule
...


22

To write a program in C language for solving
simultaneous equation in ‘n’ variables by using Gauss
Elimination Method
...


29

To write a program in C language for solving given
differential equation by Runge-Kutta Method
...
01y) and find the amount
of radioactive material left given initial amount and final
time by Modified Euler Method
...


35

38

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |i

Experiment 1
Aim
To write a program in C language for finding the largest number out of three integers
...
h>
#include ...


Theory
Variables
Variables are memory location in computer's memory to store data
...
Variable names are just the symbolic
representation of a memory location
...
, count etc
...
Integer (int) values are
whole numbers (like 10 or -10)
...
(Like 1
...
123)
...
If you declare a character
variable you must always put the character between single quotes (like so ‘A’)
...


Constants
Constants are the terms that can't be changed during the execution of a program
...
5,
"Programming is easy
...


In C, constants can be classified as:


Integer constants
Integer constants are the numeric constants (constant associated with number) without any
fractional part or exponential part
...


V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |3



Floating-point constants
Floating point constants are the numeric constants that has either fractional form or exponent
form
...
0, 0
...
22E-5



Character constants
Character constants are the constant which use single quotation around characters
...




String constants
String constants are the constants which are enclosed in a pair of double -quote marks
...

//prints string with newline

Enumeration constants
Keyword enum is used to declare enumeration types
...


V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |4

Experiment 3

Aim
To write a program in C language for finding Sum and Average of ‘n’ integer numbers
...
h>
#include ...
00;
printf("\n Enter the number of data \n");
scanf("%d",&n);
printf("\n enter the data\n");
for(i=1;i<=n;i++)
{
scanf("%f",&x);
sum=sum+x;
}
avg=sum/n;
printf("\n Sum of %d numbers = %f",n,sum);
printf("\n Average of %d numbers = %f",n,avg);
getch();
return 0;
}

Output

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |6

Experiment 4

Aim
To write a program in C language for finding the Roots of given Quadratic Equation

Flowchart

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |7

Program
#include ...
h>
#include ...
5))/2*a;
x2=(-b-pow(d,0
...
5))/2*a;
printf("\n Roots are \n x1=%f-%fi",x1,x2);

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |8

printf("\n x2=%f+%fi",x1,x2);
}
}
getch();
return 0;
}

Output

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |9

Experiment 5

Aim
To write a program in C language for finding sum of series of function Sin(x) up to 5th term
...
h>
#include ...
h>
int main()
{
int fact(int);
int i;
float x,s;
s=0
...


Flowchart

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |13

Program
#include ...
h>
int main()
{
int n,i,j;
float x[100],fx[100],xp,fxd[100],fxdj,t,fact,fxp;
printf("\n Enter the number of known points\n");
scanf("%d",&n);
printf("\n Enter the points with their value\n");
for(i=0;i{
printf("\n Enter the %dst term \n",i+1);
scanf("%f%f",&x[i],&fx[i]);
}
printf("\n Enter the point at which value of function is required\n");
scanf("%f",&xp);
for(i=0;i{
fxd[i]=fx[i];;
}
fxp=fx[0];
fact=1
...


Flowchart

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |16

Program
#include ...
h>
int main()
{
int n,i,j;
float x[100],fx[100],xp,N,D,fxp;
printf("\n How many data inputs are to be entered\n");
scanf("%d",&n);
printf("\n Enter the value of\n \tx[i]\tfx[i]");
for(i=0;i{
printf("\n %d \t",i+1);
scanf("%f%f",&x[i],&fx[i]);
}
fxp=0
...
0;
for(j=0;j{
if(i==j)
continue;
N=N*(xp-x[j]);
D=D*(x[i]-x[j]);
}
fxp=fxp+(N/D)*fx[i];
}
printf("\n The value of function at x=%0
...
4f",xp,fxp);
getch();
return 0;
}

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |17

Output

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |18

Experiment 8
Aim
To write a program in C language for calculating value of integration within given limits and number of intervals
by Trapezoidal Rule
...
h>
#include ...
h>
int main()
{
int n,i;
float x[100],fx[100],a,b,h,S;
printf("\n Enter the initial & final limit\n");
scanf("%f%f",&a,&b);
printf("\n Enter the number of intervals \n");
scanf("%d",&n);
h=(b-a)/n;
for(i=0;i<=n;i++)
{
x[i]=a+i*h;
fx[i]=sin(x[i]);
printf("\n x=%f\t fx=%f",x[i],fx[i]);
}
S=fx[0]+fx[n];
for(i=0;i{
S=S+(2
...
5*h*S;
printf("\n The value of integration=%f",S);
getch();
}

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |20

Output

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |21

Experiment 9

Aim
To write a program in C language for calculating the value of integration within given limits and number of
intervals by Simpson’s 1/3rd and 3/8th Rule
...
h>
#include ...
0*fx[i];
}
for(i=2;i{
s=s+2
...
0/3
...
0/8
...


Flowchart

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |25

Program
#include ...
h>
int main()
{
int i,j,k,n;
float a[21][21],b[20],c,x[20],S;
printf("Enter the number of unknowns [n<=20]\n");
scanf("%d",&n);
printf("Enter the coefficient matrix A \n");
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
scanf("%f",&a[i][j]);
}
printf("\n");
}
printf("Enter the matrix B \n");
for(i=1;i<=n;i++)
{
scanf("%f",&b[i]);
printf("\n");
}
for(i=1;i{
for(j=i+1;j<=n;j++)
{
c=a[j][i];
b[j]=b[j]-(b[i]*(c/a[i][i]));
for(k=1;k<=n;k++)
{
a[j][k]=a[j][k]-(a[i][k]*(c/a[i][i]));
}
}

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |26

}
for(i=1;i<=n;i++)
{
a[i][n+1]=b[i];
}
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
printf("%f\t",a[i][j]);
}
printf(" | %f\n",a[i][n+1]);
}
for(i=0;i<=n;i++)
{
x[i]=0
...


Flowchart

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |29

Program
#include ...
h>
int main()
{
int i,j,k,n;
float a[21][21],b[20],x[20],temp,Sum;
printf("Enter the number of unknowns [n<=20]\n");
scanf("%d",&n);
printf("Enter the coefficient matrix A \n");
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
scanf("%f",&a[i][j]);
}
printf("\n");
}
printf("Enter the matrix B \n");
for(i=1;i<=n;i++)
{
scanf("%f",&a[i][n+1]);
printf("\n");
}
printf("Enter the Initial Approximation \n");
for(i=1;i<=n;i++)
{
printf("x[%d] = ",i);
scanf("%f",&x[i]);
printf("\n");
}
for(k=1;k<=5;k++)
{
printf("\n %d Iteration : ",k);
for(i=1;i<=n;i++)

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |30

{
Sum=0;
for(j=1;j<=n;j++)
{
if(i!=j)
{
temp=x[j]*a[i][j];
Sum=Sum+temp;
}
}
x[i]=a[i][n+1]-Sum;
x[i]=x[i]/a[i][i];
printf("x[%d] = %0
...


Flowchart

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |32

Program
#include ...
h>
int main()
{
int n=0;
float k1,k2,k3,k4,x,y,S,h;
float f(float x,float y);
printf("Enter the initial approximation of x and y \n");
scanf("%f %f",&x,&y);
printf("\n");
h=0
...
01y) and find the amount of
radioactive material left given initial amount and final time by Modified Euler Method
...
h>
#include ...
2f \t Radioactive substance=%f \n",x,y);
n++;
}while(nprintf("\n The final amount of radioactive material after time %0
...
01*y);
}

Output

V i s h a l S i n g h ( 0 0 3 2 0 9 0 3 6 1 3 ) |37

Experiment 14

Aim
To write a program in C language for solving a linear or transcendental equation by Newton-Raphson Method
...
h>
#include ...
h>
int main()
{
int i;
float x1,x2,f1,f2;
printf("Enter the intitial approxiamtion\n");
scanf("%f",&x1);
x2=x1;
for(i=0;;i++)
{
x1=x2;
f1=pow(x1,2)-9;
f2=(2*x1);
x2=x1-(f1/f2);
if(abs(x2-x1)<0
Title: simplest with best research
Description: These notes were made after a lot of research by me. I made these notes very simple and understandable. Please share these asap.