Recent Post

3/recentposts

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Sunday, January 21, 2018

GAUSS JODON INVERSE IN C PROGRAMMING


#include<stdio.h>
#include<stdlib.h>
void main()
{
    int i,j,k,n;
    float a[15][15],d,r;
    printf("Enter order of matrix :");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
        {
            printf("Enter a[%d][%d] : ",i,j);
            scanf("%f",&a[i][j]);
        }
    }
    for(i=1;i<=n;i++)
    {
        for(j=n+1;j<=2*n;j++)
        {
            if(j==n+i)
            {
                a[i][j]=1;
            }
            else
            {
                a[i][j]=0;
            }
        }
    }
    for(j=1;j<=n;j++)
    {
        if(a[j][j]==0)
        {
            printf("Error");
            exit(0);
        }
        for(i=1;i<=n;i++)
        {
            if(i!=j)
            {
                r=(a[i][j])/(a[j][j]);
                for(k=1;k<=2*n;k++)
                {
                    a[i][k]=a[i][k]-r*a[j][k];
                }
            }
        }
    }
    for(i=1;i<=n;i++)
    {
        d=a[i][i];
        for(j=1;j<=2*n;j++)
        {
            a[i][j]=a[i][j]/d;
        }
    }
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=2*n;j++)
        {
            printf("  %f",a[i][j]);
        }
        printf("\n");
    }
}

Share:

GAUSS JORDON MEHTOD IN C PROGRAMMING

//gauss jordon
#include<stdio.h>
void main()
{
    int i,j,k,n;
    float a[15][15],x[10],r;
    printf("Enter order of matrix :");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n+1;j++)
        {
            printf("Enter a[%d][%d] : ",i,j);
            scanf("%f",&a[i][j]);
        }
    }
    for(j=1;j<=n;j++)
    {
        for(i=1;i<=n;i++)
        {
            if(i!=j)
            {
                r=(a[i][j])/(a[j][j]);
                for(k=1;k<=n+1;k++)
                {
                    a[i][k]=a[i][k]-r*a[j][k];
                }
            }
        }
    }
    for(i=1;i<=n;i++)
    {
        x[i]=(a[i][n+1])/(a[i][i]);
        printf("x%d = %f\t",i,x[i]);
    }
}

Share:

GAUSS ELIMINATION METHOD IN C PROGRAMMING

//gauss elimination
#include<stdio.h>
void main()
{
    int i,j,k,n;
    float r,a[20][20],x[20],sum;
    printf("Enter matrix size : ");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n+1;j++)
        {
            printf("Enter a%d%d : ",i,j);
            scanf("%f",&a[i][j]);
        }
    }
    for(j=1;j<=n-1;j++)
    {
        for(i=j+1;i<=n;i++)
        {
            r=a[i][j]/a[j][j];
            for(k=1;k<=n+1;k++)
            {
                a[i][k]=a[i][k]-r*a[j][k];
            }
        }
    }
    x[n]=a[n][n+1]/a[n][n];
    for(i=n-1;i>=1;i--)
    {
        sum=0;
        for(j=i+1;j<=n;j++)
        {
            sum=sum+a[i][j]*x[j];
        }
        x[i]=(a[i][n+1]-sum)/a[i][i];
    }
    for(i=1;i<=n;i++)
    {
        printf("x%d = %.4f\t",i,x[i]);
    }
}

Share:

SECOND DEGREE CURVE FITTING IN C PROGRAMMING

//second degree curve-fitting
#include<stdio.h>
void main()
{
    int n,i,j,k;
    float a[10][10],x[10],y[10],r;
    float sumx=0,sumx2=0,sumx3=0,sumx4=0,sumxy=0,sumx2y=0,sumy=0;
    printf("Enter no. of data : ");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        printf("Enter x%d,y%d : ",i,i);
        scanf("%f%f",&x[i],&y[i]);
    }
    for(i=1;i<=n;i++)
    {
        sumx+=x[i];
        sumx2+=x[i]*x[i];
        sumx3+=x[i]*x[i]*x[i];
        sumx4+=x[i]*x[i]*x[i]*x[i];
        sumxy+=x[i]*y[i];
        sumx2y+=x[i]*x[i]*y[i];
        sumy+=y[i];
    }
    a[1][1]=a[2][2]=a[3][3]=sumx2;
    a[1][2]=a[2][3]=sumx;
    a[2][4]=sumxy;
    a[3][4]=sumx2y;
    a[3][1]=sumx4;
    a[2][1]=a[3][2]=sumx3;
    a[1][4]=sumy;
    a[1][3]=n;
    for(j=1;j<=3;j++)
    {
        for(i=1;i<=3;i++)
        {
            if(i!=j)
            {
                r=a[i][j]/a[j][j];

            for(k=1;k<=4;k++)
            {
                a[i][k]=a[i][k]-r*a[j][k];
            }
            }
        }
    }
    for(i=1;i<=3;i++)
    {
        x[i]=a[i][4]/a[i][i];
    }
    printf("a = %f\t b = %f\tc = %f",x[1],x[2],x[3]);
}

Share:

SECANT MEHTOD IN C PROGRAMMING

//secant
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
float f(float x)
{
    return(pow(x,3)-2*x-5);
}

void main()
{
    float x,a,b;
    printf("Enter two initial guesses a & b : ");
    scanf("%f%f",&a,&b);
    do
    {
        if(f(a)==f(b))
        {
            printf("Denominator is zero");
            exit(0);
        }
        x=(a*f(b)-b*f(a))/(f(b)-f(a));
        a=b;
        b=x;

    }while(fabs(f(x))>0.00005);
    printf("Solution = %f, f(x)= %f",x,f(x));
}

Share:

RUNGE-KUTTA 4 (RK-4) METHOD IN C PROGRAMMING

//rk4method
#include<stdio.h>
#include<math.h>
float f(float x, float y)
{
    return (x+y);
}
void main()
{
    float x0,y0,h,x,m,m1,m2,m3,m4;
    printf("Enter x0, y0, h , x : ");
    scanf("%f%f%f%f",&x0,&y0,&h,&x);
    while(x0<x)
    {
        m1=f(x0,y0);
        m2=f(x0+h/2,y0+m1*h/2);
        m3=f(x0+h/2,y0+m3*h/2);
        m4=f(x0+h,y0+m3*h);
        m=(m1+2*m2+2*m3+m4)/6;
        y0+=h*m;
     
        x0+=h;
        printf("x = %2.4f \t\t y = %2.4f\n",x0,y0);
    }

}

Share:

NEWTON-RAPHSON METHOD IN C PROGRAMMING

//newton-raphson
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
float f(float x)
{
    return(pow(x,4)-x-10);
}
float df(float x)
{
    return(4*x*x-1);
}
void main()
{
    float x,x1;
    int c=0,i;
    printf("Enter initial guess and iteration : ");
    scanf("%f%d",&x,&i);
    do
    {
        if(df(x)==0)
        {
           printf("derivative zero");
           exit(0);
        }
        x1=x-(f(x)/df(x));
        x=x1;
        c++;
        if(c==i)
        {
            printf("Root not convergence");
            exit(0);
        }

    }while(fabs(f(x))>0.00005);
    printf("Root = %f,f(x) = %f",x1,f(x1));
}

Share:

LINEAR CURVE FITTING IN C PROGRAMMING

#include<stdio.h>
void main()
{
    float a,b,sumx,sumy,sumxy,sumx2,x[50],y[50];
    int i,n;
    sumx=0;
    sumy=0;
    sumxy=0;
    sumx2=0;
    printf("Enter no. of data : ");
    scanf("%d",&n);
    for (i=0;i<n;i++)
    {
        printf("Enter x(%d) and y(%d) : ",i+1,i+1);
        scanf("%f%f",&x[i],&y[i]);
    }
    for (i=0;i<n;i++)
    {
        sumx+=x[i];
        sumy+=y[i];
        sumxy+=x[i]*y[i];
        sumx2=x[i]*x[i];
    }
    a=(sumy*sumx2-sumxy*sumx)/(n*sumx2-sumx*sumy);
    b=(sumy*sumx-n*sumxy)/(n*sumx2-sumx*sumy);
    printf("a =%f\nb=%f",a,b);
}

Share:

EXPONENTIAL CURVE FITTING IN C PROGRAMMING

#include<stdio.h>
#include<math.h>
void main()
{
    float a,b,sumx,sumy,sumxy,sumx2,x[50],y[50];
    int i,n;
    sumx=0;
    sumy=0;
    sumxy=0;
    sumx2=0;
    printf("Enter no. of data : ");
    scanf("%d",&n);
    for (i=0;i<n;i++)
    {
        printf("Enter x(%d) and y(%d) : ",i+1,i+1);
        scanf("%f%f",&x[i],&y[i]);
         y[i]=log(y[i]);
    }

    for (i=0;i<n;i++)
    {
        sumx+=x[i];
        sumy+=y[i];
        sumxy+=x[i]*y[i];
        sumx2=x[i]*x[i];
    }
    a=(sumy*sumx2-sumxy*sumx)/(n*sumx2-sumx*sumy);
    b=(-sumy*sumx+ n*sumxy)/(n*sumx2-sumx*sumy);
    a=exp(a);
    printf("a =%f\nb=%f",a,b);
}

Share:

EULER'S METHOD IN C PROGRAMMING

//euler's method
#include<stdio.h>
#include<math.h>
float f(float x, float y)
{
    return (x+y);
}
void main()
{
    float x0,y0,h,x,m,m1,m2,m3,m4;
    printf("Enter x0, y0, h , x : ");
    scanf("%f%f%f%f",&x0,&y0,&h,&x);
    while(x0<x)
    {
       
       y0+=h*f(x0,y0);
        x0+=h;
        printf("x = %2.4f \t\t y = %2.4f\n",x0,y0);
    }

}

Share:

BISECTION METHOD IN C PROGRAMMING

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
float function(float x)
{
    return (exp(x)+x);
}
void main()
{
    float a,b,c;
    printf("Enter a and b : ");
    scanf("%f%f",&a,&b);
    if(function(a)*function(b)>0)
    {
        printf("Enter appropriate interval\n");
        exit(0);
    }
    else
    {
        do
        {
            c=(a+b)/2;
            if(function(a)*function(c)<0)
            {
                b=c;
            }
            else
            {
                a=c;
            }
        }while(fabs(function(c))>0.0005);
            printf("solution = %f \t\tf(x)= %f",c,function(c));
    }

}

Share:

GEOLOGY - STEREONET PLOTTING

STEREONET PLOTTING
FOR PLANE
(N380E,420SE รจ strike, dip amount dip direction )
(128o,42oรจ dip direction, dip amount)
(120o, 400SE รจ strike, dip amount dip direction); 120o = S60oE
FOR LINE
(071o,24oรจ trend, plunge)
How to plot a plane when strike, dip amount and dip direction is given?
(e.g. N38oE,42oSE)   
1.  trace the primitive circle of stereonet

2.  mark North and South pole

3.  plot strike i.e. N38oE on the primitive circle.

4.  rotate the tracing paper until the mark of the plotted strike comes to north pole
     (if strike is given the rotate the tracing paper to north pole(0o) or south pole(180o)                                 whichever is   nearer.)

5.  after rotating the tracing paper to north pole ( as north pole is nearer to N38oE not south pole )            see on which side dip direction is (i.e. SE in this case). In this case SE is on the left side so count      42o from 90o(equator), each line represent 2o so count 21 lines.

6. without disturbing the tracing paper draw great circle through the point plotted (i.e. .                             N38oE,42oSE), north pole and south pole. This is the required plane.

When 90o is added to N38oE, we get 128o and the plane becomes 1200,420. Here 128o is dip direction and 42o is dip amount.
1. plot/mark 1280 along the primitive circle.
2. Rotate the tracing paper until the mark comes to 900 or 270o whichever is nearer.
3. Count 42o from the mark (the mark being on 900 or 270o) and plot a point (say A)
4. Draw a great circle passing through north pole, south pole and mark A. This is required plane.
Similar process for lineation only difference is that instead of drawing great circle only point is plotted as line in 3D is a point in 2D.

PLOTTING FRICTION ANGLE
friction angle (say 32o) circle is a locus of all the lines having plunge 32o.

while plotting friction angle (say 32o), 16 lines are counted from the primitive circle i.e. perimenter of the stereonet from 90 o and 270o and circle is drawn passing from two points with center at the center of stereonet.
Share:

Research report writing on Effect of smoking on Academic Performance

Effect of smoking on Academic Performance

                                                            


Abstract

This research was done to study the effect of smoking on academic performance of students of ABCD College. It also aimed at finding how school environment, family background, curiosity of student, Friends, etc. influence students for smoking.  It was observed that students performed worse, they couldn’t concentrate on study and even some had memory loss. The significance of  this research is that it could serve to provide knowledge about cause and effect of smoking and assist in lowering smoking.


Introduction

Nowadays many students are addicted to smoking and some even smoke daily. They suffer from health hazards and even their daily activities are altered. So this research was conducted to know the effect of smoking on the academic performance of students, causes of smoking and suggest some measures to lower smoking and to improve the condition of smokers. For this, some students from ABCD college were selected and they were asked like why do they smoke?, how often they smoke?, how has it affected their lifestyle and academic performance?, have they been visiting hospital? and based on the reply to these questions conclusion were drawn.


Materials and methods


The research was survey based so questionnaire asking personal profile, reason for smoking etc. was prepared and Fagerstrom test was conducted for nicotine dependence.

Research was conducted on 1000 students of ABCD College taking permission from authorities. Students were given the questions and were assured that their data would be confidential and used for research only encouraging them to give correct information.


Result


Out of 1000 students, 610(61%) were male and 390(39%) were female of which 140 male (23%) and 7 female (10.25%) were smokers. Total smokers were 147 students (14.7%) of which 50 (34%) were daily smokers and 40 smokers (27.21%) were trying to give up smoking due to various reasons like health problem, awareness programme, social problems etc.


Tables


Table 1. Status of smokers


Male
Female
Total
Smokers
140
7
147
Non-Smokers
470
383
853
Total
610
390
1000



Discussion

Data was collected through questionnaire and analyzed. Students were selected randomly for research from a college of a city. 14.7% were found to be smoker of which 14% were male and 0.7% female. The percentage of smoker is comparatively less which may have been because of education. Most of the smokers had poor academic performance. They couldn’t concentrate on study. Many smokers visited health clinics, health counselor so they couldn’t attend class regularly and couldn’t submit home assignment on time and moreover, they couldn’t actively participate in class. Some were even observed to have rude behavior maintaining unhealthy environment in school. The reason for smoking were curiosity of student, pressure from friends, family members having smokers, advertisement etc. In this research 40 smokers(27.21%) were trying to give up smoking due to various reason like social problem, health problem, awareness programme etc. To lower smoking, parents and teachers should give proper guidance to the smokers, they should be made aware and they should not be given much burden as many smoke to relief from psychological tension than physical. Smokers should be sent to rehabilitation centre. The results obtained being satisfactory and the students being encouraged to give correct information as they were assured that their information would be confidential, there is no requirement of further research.


Acknowledgement


I would like to acknowledge my deep sense of gratitude to the Nepal Health Association (NHA) for assisting to conduct the research successfully.

I would like to  thank to the ABCD College members for permitting to conduct the research in their college.

I would also thank to the Research team members without whom research would not have been possible.



References


            http://www.ncbi.nlm.nih.gov
            http://www.unh.edu










Share:

Recent

Unordered List

Definition List

Pages

Theme Support