Saturday, January 5, 2008
Sunday, December 2, 2007
Sift Happnes
Shift Happens
From: jbrenman, 8 months ago
This is a stylization of a slideshow originally created by Karl Fisch, examining globalization and America’s future in the 21st century. It is designed to stand alone, without having to be presented in person. Enjoy!
SlideShare Link
Wednesday, November 28, 2007
IIT Bombay....
Its comin closer.. ma days left here are few..
clock is running fast.. and me.. goin into past..
Lookin back..sweet memories.. memories of lifetime...
A journey, wish shall never end...
A life which is to end
only when i am no more
a life which transfered me
in fighter to the core
a season of love and friendship
for eternity which will last
in my future to follow
i will long to relive this past
memories of this part of journey
i'll carry all life along
memories of those precious moments
which made my life a beautiful song
my eyes go teary
emotions fill my heart
as my days left here are few
no it's time to bid adieu
Program in C for False position method...
Important notes:
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
/*programm for false-position
method by HEMANT ABHARE.*/
#include[stdio.h]
#include[math.h]
#define epsilon 1e-6
/*this is a programm to find out root
of the equation x^10-15=0 by false-position
method*/
main()
{
double g1,g2,g,v,v1,v2,dx;
int found,converged,i;
found=0;
printf("enter the first guess\n");
scanf("%lf",&g1);
v1=g1*g1*g1*g1*g1*g1*g1*g1*g1*g1-15;
printf(" value 1 is %lf\n",v1);
while (found==0)
{
printf(" enter the second guess\n");
scanf("%lf",&g2);
v2=g2*g2*g2*g2*g2*g2*g2*g2*g2*g2-15;
printf(" value 2 is %lf\n",v2);
if (v1*v2>0)
{found=0;}
else
found=1;
}
printf("right guess\n");
i=1;
while (converged==0)
{
printf("\n iteration=%d\n",i);
g=g1-((v1*(g1-g2))/(v1-v2));
printf(" new gues is %lf\n",g);
v=g*g*g*g*g*g*g*g*g*g-15;
printf("new value is%lf\n",v);
if (v*v1>0)
{
g1=g;
printf(" the next guess is %lf\n",g);
dx=(g1-g2)/g1;
}
else
{
g2=g;
printf(" the next guess is %lf\n",g);
dx=(g1-g2)/g1;
}
if (fabs(dx)'less than'epsilon)
{converged=1;}
i=i+1;
}
}
Tuesday, November 27, 2007
Program in C for Modified Newton Raphson Method...
Here is code for Modified Newton Raphson Method
Important notes:
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
Important notes:
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
/*programm for modified newton raphson method*/
#include[stdio.h]
#include[math.h]
#define epsilon 1e-6
main()
{
/*This is a programm based on modified
newton raphson method to
find out root of the equation x^3-5*x^2+7*x-3=0*/
double g,g1,v,v1,v2,x,dx;
int converged=0,i;
printf("plz enter the guess value\n");
scanf("%f",&g1);
i=1;
while (converged==0)
{
printf("\n iteration no=%d\n",i);
v=g1*g1*g1-5*g1*g1+7*g1-3;
printf("v=%lf\n",v);
v1=3*g1*g1-10*g1+7;
printf("v1=%lf\n",v1);
v2=6*g1-10;
printf("v2=%lf\n",v2);
x=(v*v1)/(v1*v1-v*v2);
printf("value=%lf\n",x);
g=g1-((v*v1)/(v1*v1-v*v2));
printf("new guess is=%lf\n",g);
dx=((g-g1)/g);
printf("error=%lf\n",dx);
g1=g;
if (fabs(dx)'less than'epsilon)
{converged=1;}
printf("the root of equation is=%lf
i=%d\n",g,i);
i=i+1;
}
}
Program in C for Bisection method...
Here is code for Bisection method. Documented code in C.
Important notes:
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
/*programm for bisecion method by hemant abhare*/
#include[stdio.h]
#include[math.h]
#define epsilon 1e-6
main()
{
double g1,g2,g,v,v1,v2,dx;
int found,converged,i;
found=0;
printf(" enter the first guess\n");
scanf("%lf",&g1);
v1=g1*g1*g1-15;
printf("value 1 is %lf\n",v1);
while (found==0)
{
printf("enter the second guess\n");
scanf("%lf",&g2);
v2=g2*g2*g2-15;
printf(" value 2 is %lf\n",v2);
if (v1*v2>0)
{found=0;}
else
found=1;
}
printf("right guess\n");
i=1;
while (converged==0)
{
printf("\n iteration=%d\n",i);
g=(g1+g2)/2;
printf("new guess is %lf\n",g);
v=g*g*g-15;
printf("new value is%lf\n",v);
if (v*v1>0)
{
g1=g;
printf("the next guess is %lf\n",g);
dx=(g1-g2)/g1;
}
else
{
g2=g;
printf("the next guess is %lf\n",g);
dx=(g1-g2)/g1;
}
if (fabs(dx)'less than' epsilon
{converged=1;}
i=i+1;
}
printf("\nth calculated value is %lf\n",v);
}
Important notes:
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
/*programm for bisecion method by hemant abhare*/
#include[stdio.h]
#include[math.h]
#define epsilon 1e-6
main()
{
double g1,g2,g,v,v1,v2,dx;
int found,converged,i;
found=0;
printf(" enter the first guess\n");
scanf("%lf",&g1);
v1=g1*g1*g1-15;
printf("value 1 is %lf\n",v1);
while (found==0)
{
printf("enter the second guess\n");
scanf("%lf",&g2);
v2=g2*g2*g2-15;
printf(" value 2 is %lf\n",v2);
if (v1*v2>0)
{found=0;}
else
found=1;
}
printf("right guess\n");
i=1;
while (converged==0)
{
printf("\n iteration=%d\n",i);
g=(g1+g2)/2;
printf("new guess is %lf\n",g);
v=g*g*g-15;
printf("new value is%lf\n",v);
if (v*v1>0)
{
g1=g;
printf("the next guess is %lf\n",g);
dx=(g1-g2)/g1;
}
else
{
g2=g;
printf("the next guess is %lf\n",g);
dx=(g1-g2)/g1;
}
if (fabs(dx)'less than' epsilon
{converged=1;}
i=i+1;
}
printf("\nth calculated value is %lf\n",v);
}
Program in C for Gause Seidel method...
Though I am not smart programmer but still here is code in C for Gause Seidel method...
Important notes:
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
Important notes:
1. while running the program replace [] (in #include )by less than and greater than symbol since i cant publish post with those symbol.
2. if there is written like less than then use symbol in actual program.
/*program for guass siedel by Hemant Abhare. M.tech 1st year corrosion sci &
engg.Roll no:06316005*/
#include[stdio.h]
#include[conio.h]
#include[math.h]
#include[stdlib.h]
#define epsilon 1e-6
void main()
{
int i,j,n,k,m;
float sum,s,xi,d;
float x[20],a[20][20],b[1];
double e=0;
printf("\n ****Gauss Seidel Method**** ");
printf("\n Enter no. of eqn.: \t");
scanf("%d",&n);
printf("\n Enter Augumented matrix [A] :");
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
scanf("%f",&a[i][j]);
printf("\n a[%d][%d]=%f\n",i,j,a[i][j]);
}
{
scanf("%f",&b[i]);
printf("\n b[%d]=%f\n",i,b[i]);
}
}
printf("Enter the initial appx for
X(1),X(2),X(3)...\n");
for(i=1;i<=n;i++)
{
scanf("%f",&x[i]);
printf("\n x[%d]=%f\n",i,x[i]);
}
for(i=1;i<=n;i++)
{
if(a[i][i]==0)
printf("diagonal elements are zero,
solution not possible without pivoting\n");
}
do
{
m=1;
for(i=1;i<=n;i++)
{
s=0;
for(j=1;j<=n;j++)
if(i!=j)
s+=a[i][j]*x[j];
xi=(b[i]-s)/a[i][i];
printf("\n x[%d]=%f\n",i,xi);
d=fabs((xi-x[i]));
printf("d=%f\n",d);
x[i]=xi;
printf("x[%d]=%f\n",i,x[i]);
}
m++;
}
while ((d>= epsilon));
printf("\n Result :-");
for(i=1;i<=n;i++)
printf("\n x[%d]=%f ",i,x[i]);
}
Subscribe to:
Posts (Atom)