You are not logged in.
Let's do a little experiment, we know that
(1/3) x 900000 = 300000
Enter just as you see it
.3333 x 900000 = ?
This is the result I get: 299970
Do you believe that .3333 and 1 / 3 are the same thing?
No,it is like that: 0.3333333333333333333333333....................................................
Isn't it the same matrix??
1 1/2 1/3 1/4
1/2 1/3 1/4 1/5
1/3 1/4 1/5 1/6
1/4 1/5 1/6 1/7
I have written the command format rat and get now the numbers as fractions.. ![]()
You are not remembering the other threads. That condition number is kaboobly doo. A Hilbert matrix will not allow arithmetic to be done on it easily. So even when you ask for the condition number it gives the wrong answer! My answer is correct.
Ok,I got it...
Look at Hilbert 4 x 4. It only gives 4 digits! You need 400 digits to get an accurate answer.
So,what does this mean?? Has the precision to do something with the fact that I get Nan as result???
:
I also have to find the condition number for different values of n and for the 250 x 250 Hilbert matrix,I found it like that: 3.9067e+020..Is it equal with your result,if we consider that Matlab looses a lot of digits of precision??
hilb(4):
1.0000 0.5000 0.3333 0.2500
0.5000 0.3333 0.2500 0.2000
0.3333 0.2500 0.2000 0.1667
0.2500 0.2000 0.1667 0.1429
Why are you using such a large matrix?
I have to implement the methods for different values of n,with 50<=n<=1000..
You are trying to invert a 250 x 250 Hilbert Matrix!!!!!!!
What do you mean???Isn't is possible to do this??? ![]()
You need to provide the n.
It is given from the user when he calls the function..You could take n=250,to check if you get the same results as mine.. ![]()
What do you mean???Which dimension??I wrote this command H=hilb(n) in a function and each time I call it I give different values..The formula for this matrix is
Are you being asked to use your routine on a Hilbert Matrix?
Yes,and I did it using this: hilb(n)..
Also,now I ran the Gauss-Seidel function I wrote for the Hilbert Matrix for MAXITERATIONS>=250..The method does not converge but I get a number,for example for MAXITERATIONS=250 I get this number:1.4455...Why does this happen???
Hi;
That is not exactly correct, it can be made to converge using Gauss Seidel.
How can I do this?? ![]()
Hi;
The Hilbert matrix as described in the other thread is notoriously ill conditioned. That is the reason for the problem. You would have to work to many digits of precision or in exact arithmetic. Matlab as far as remember can do neither.
So,if I am asked to write the error of the last iteration for different n,is the right answer that it is Nan for n>=250??
Hi ![]()
I wrote a function in matlab,that implements the Jacobi and Gauss-Seidel method.I have to do this for different matrices..I am facing difficulties when I call my function,giving the Hilbert matrix..
I have to find the error ||x_{k}-d|| (where d is the accurate solution) of the last iteration,with ε=0.000001.I tried to find this and for MAXITERATIONS>=250 I get Nan as result..Isn't it wrong??What should I change? ![]()
I checked if it converges using the Gauss-Sheidel method,but it doesn't...
![]()
Prove that moving mass m underlying the action of linear spring constant k, has the form y (t) = Asin (wt + f), where t is time and A, w, f fixed. Interpret the physical significance of these constants and determine their values if at the time t = 0, the mass is removed y0 and velocity v0. If in addition the mass subject to outdoor force F (t) = F_ {0} sin (w_ {0} t), amplitude F_ {0} and cyclic frequency w_ {0}, calculate the amplitude of motion and investigate the dependence of the circular frequency w_ {0}.
Could you give me a hint,what I have to do??
There are lots of different algorithms that have those names. Please point me to the exact ones or describe them further.
I do not program in Matlab but I can easily program the relevant algorithms in Mathematica and iterate 100 times.
The formula I have to use for the Jacobi method is this: D*x_{k+1}=-(U+L)*x_{k}+b,
for the Gauss Seidel method the formula I have to use is this:(D+L)*x_{k+1}=b-U*x_{k}.
( L is the lower triangular and U the upper triangular matrix)
Both of the programs should terminate either if the number of iterations surpass the maximum number of iterations MAXITERATIONS or if one of these conditions/or both of them:
|| x_{k}-x_{k-1} ||<ε , || b-Ax_{k} ||<ε
are valid.
Could you tell me the solution of x of both methods and also the number of iterations each method needed to converge?
Hello ![]()
I have written two programs using matlab,in which I implement the Jacobi and Gauss Seidel method.
Both of the programs should terminate either if the number of iterations surpass the maximum number of iterations MAXITERATIONS or if one of these conditions/or both of them:
|| x_{k}-x_{k-1} ||<ε , || b-Ax_{k} ||<ε
are valid.
Could you give me the results of an example with an initial value [tex] x_{0} [/tex],an array A ,a specific b,a specific MAXITERATIONS and a specific small number ε,so I can check my output?For example,if :
A=[4 5 1 5;6 3 1 2;9 9 6 1;1 2 3 5]
x0 =[0;0;0;0]
b=[3;2;1;4]
MAXITERATIONS=100
ε=0.001
which should be the solution of x,at the first code,and which at the second one?
RCond is not the condition number it is the reciprocal of it. Also you are being warned by Matlab that the result he just gave you is not reliable. In this case it is not even close.
The lesson on condition numbers is supposed to make you aware that when the condition number is large ( the Hilbert Matrix has this problem ) that any numeric result will be wildly unstable. Matlab is working to what, 16 digits? That is not enough to compute Hilbert(100).
Nice..Thank you very much!!!
The correct answer is given above. What you are doing wrong is ignoring the purpose of the lesson.
What do you mean???That,using matlab,the result I found is correct but in reality it is not near to the real number of the condition number ,because of the fact that the Hilbert Matrix is a very ill conditioned matrix ???Or do I understand it wrong??? ![]()
And...how can I find the right number of the condition number of the 100x100 Hilbert Matrix,using the infinity norm??
I used the ready function cond((hilb(100),inf) and I got this result.When I run my code,I get this warning message:
Matrix is close to singular or badly scaled.Results may be inaccurate.RCOND:2.144574e-021.
What can I do??
I have written a function in matlab to count the condition number,using the infinity norm,of the 100x100 Hilbert Matrix and I get this result:4.6629e+020
Is this wrong??
Which is the condition number of the matrix E,using the infinity norm, where E is a 100x100 tridiagonal matrix with the number 3 at the main diagonal and the number 2 at the first diagonal below this,and also the number 2 at the first diagonal above the main diagonal??
I hope someone can help me..
And how can I prove this??? ![]()
I think I have to use {n choose r},but I am not sure ![]()