Methods collection zone
3 posters
IITDU Forum :: Academics (BIT) :: Semester 3 :: MATH 304
Page 1 of 1
Re: Methods collection zone
a slight mistake u have made toma.....at jacobi iteration ....inside the fabs function u forgot to divide the x[i]-xo[i] by a x[i].....
BIT0101-rayhan- Release Candidate
- Posts : 107
Points : 177
Re: Methods collection zone
[#include
#include
int main(void){
int n = 3, r = 1.5;
//if r is over relaxed then set the value between 1 and 2, if underelaxed
//then set it at the value between 0 and 1
//if r=0, then there is no relaxation at all and it is identical
//to the gauss seidel method
double x[3], b[3] = {5, 15, 8}, e=.000001;
double a[3][3] = {
2, 1, 1,
3, 5, 2,
2, 1, 4
};
int count=0;
int i, j;
for(i=0; i
#include
int main(void){
int n = 3, r = 1.5;
//if r is over relaxed then set the value between 1 and 2, if underelaxed
//then set it at the value between 0 and 1
//if r=0, then there is no relaxation at all and it is identical
//to the gauss seidel method
double x[3], b[3] = {5, 15, 8}, e=.000001;
double a[3][3] = {
2, 1, 1,
3, 5, 2,
2, 1, 4
};
int count=0;
int i, j;
for(i=0; i
BIT0101-rayhan- Release Candidate
- Posts : 107
Points : 177
Re: Methods collection zone
wow!! ray is here as well..
ray, you need to give the codes inside the code tag.
like this:
ray, you need to give the codes inside the code tag.
like this:
- Code:
[code]
#include<stdio.h>
int main(void){
return 0;
}
[/code]
Re: Methods collection zone
i tried it like that... but i think my browser is giving me some probs...
BIT0101-rayhan- Release Candidate
- Posts : 107
Points : 177
Re: Methods collection zone
@Ray:
Thanks dosto. [You must be registered and logged in to see this image.]
In Jacobi & Gauss method I didn't divide x[i]-xo[i] by a x[i] coz it means
relativity and sir told that sometimes it makes problem. So we can
remove it. [You must be registered and logged in to see this image.]
In relaxation method if we set no relaxation then r=1 but you wrote r=0. [You must be registered and logged in to see this image.]
Thanks dosto. [You must be registered and logged in to see this image.]
In Jacobi & Gauss method I didn't divide x[i]-xo[i] by a x[i] coz it means
relativity and sir told that sometimes it makes problem. So we can
remove it. [You must be registered and logged in to see this image.]
In relaxation method if we set no relaxation then r=1 but you wrote r=0. [You must be registered and logged in to see this image.]
BIT0107-Toma- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 280
Points : 453
Re: Methods collection zone
oh... yes.. typing mistakes...
BIT0101-rayhan- Release Candidate
- Posts : 107
Points : 177
Re: Methods collection zone
these are chapter 12 sources...
[You must be registered and logged in to see this link.]
[You must be registered and logged in to see this link.]
BIT0101-rayhan- Release Candidate
- Posts : 107
Points : 177
Re: Methods collection zone
method of relaxation...
- Code:
#include
#include
int main(void){
int n = 3, r = 1.5;
//if r is over relaxed then set the value between 1 and 2, if underelaxed
//then set it at the value between 0 and 1
//if r=1, then there is no relaxation at all and it is identical
//to the gauss seidel method
double x[3], b[3] = {5, 15, 8}, e=.000001;
double a[3][3] = {
2, 1, 1,
3, 5, 2,
2, 1, 4
};
int count=0;
int i, j;
for(i=0; i
x[i] = b[i]/a[i][i];
int isError;
do{
isError=0;
for(i=0; i
double sum = b[i];
for(j=0; j
if(i!=j)
sum = sum - a[i][j]*x[j];
double dummy = sum/a[i][i];
dummy = r*dummy + (1-r)*x[i];
if(isError==0 && fabs(dummy-x[i])>e)
isError = 1;
x[i] = dummy;
}
count++;
}while(isError);
printf("Roots are: ");
for(i=0; i
printf("%f ", x[i]);
printf("& solved by %d iterations\n", count);
return 0;
}
BIT0101-rayhan- Release Candidate
- Posts : 107
Points : 177
Re: Methods collection zone
Still a little bit of problem. are the heaeder files stdio and math used here? I can edit it for you if your browser problem persists. (It happens sometimes..)
And Thanks for the chapter 12 codes
And Thanks for the chapter 12 codes
Re: Methods collection zone
Ray amarta copy koira edit koira paste marche.. [You must be registered and logged in to see this image.]
BIT0107-Toma- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 280
Points : 453
Re: Methods collection zone
BIT0107-toma wrote:Ray amarta copy koira edit koira paste marche.. [You must be registered and logged in to see this image.]
kongula :O
Re: Methods collection zone
BIT0122-Amit wrote:
kongula :O
Method of relaxation
BIT0107-Toma- Programmer
- Course(s) :
- BIT
Blood Group : B+
Posts : 280
Points : 453
Re: Methods collection zone
BIT0107-toma wrote:BIT0122-Amit wrote:
kongula :O
Method of relaxation
Hmm..
I have prepared the [You must be registered and logged in to see this link.] in the zone. mind taking a look at it and verifying?
Re: Methods collection zone
nothing ti copy paste... its just adding a line to convert the gauss seidel to a relaxation method....
i did it intentionally.. otherwise 2 different code of a same problem would create confusions...
whatever no need to write this public .... :S:S:S
u ppls really sucks... :S:S:S
i did it intentionally.. otherwise 2 different code of a same problem would create confusions...
whatever no need to write this public .... :S:S:S
u ppls really sucks... :S:S:S
BIT0101-rayhan- Release Candidate
- Posts : 107
Points : 177
Re: Methods collection zone
peoples? :/ ahem......
And NOW I understood what ray did.
Considering his intention, I would say good work Ray
And NOW I understood what ray did.
Considering his intention, I would say good work Ray
Similar topics
» Methods Covered in Math 304
» Methods in C version Toma 0.0.1
» ACM-Problems Set Collection
» OpenGL Collection
» Math Preperation Zone: Program Codes and Algorithms
» Methods in C version Toma 0.0.1
» ACM-Problems Set Collection
» OpenGL Collection
» Math Preperation Zone: Program Codes and Algorithms
IITDU Forum :: Academics (BIT) :: Semester 3 :: MATH 304
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Tue Sep 29, 2015 2:45 pm by Sophiawood
» Cisco EHWIC SFP/GE WAN Card
Mon Sep 07, 2015 11:08 am by Sophiawood
» Huawei S1700-28GFR-4P-AC Price
Thu Jun 25, 2015 2:31 pm by Sophiawood
» teach yourself C++ / Herbert Schildt Solutions
Wed Jun 03, 2015 1:52 pm by Abdullah Al Noman
» teach yourself c by herbert schildt pdf
Wed May 13, 2015 11:01 pm by Raquib Ridwan
» ASA 5506X With Firepower ASA5506-K9
Fri Apr 10, 2015 4:31 pm by Sophiawood
» New Trends in Deal Business
Tue Feb 03, 2015 9:38 pm by nersoa
» PoE Power Allocation for WS-C2960S-24PS-L
Wed Nov 05, 2014 11:12 am by Sophiawood
» How to cure back pain
Fri Oct 31, 2014 7:15 pm by Bergen Guildford