Results 1 to 4 of 4

Math Help - Plot condition number of Hilbert matrix against matrix size n.

  1. #1
    Newbie
    Joined
    Mar 2009
    Posts
    7

    Plot condition number of Hilbert matrix against matrix size n.

    Plot condition number of Hilbert matrix against matrix size n. Propose set of linear equations with Hilbert matrix of coefficients and with solution .Try to solve the equation for different n and plot the norm of the residual against n.

    Honestly I have no idea how to cooperate with it. I've just found out that i have to use hilb(n).
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by adashiu View Post
    Plot condition number of Hilbert matrix against matrix size n. Propose set of linear equations with Hilbert matrix of coefficients and with solution .Try to solve the equation for different n and plot the norm of the residual against n.

    Honestly I have no idea how to cooperate with it. I've just found out that i have to use hilb(n).
    As:

     <br />
H_n = \begin{bmatrix}<br />
1 & \frac{1}{2} & ... & \frac{1}{n} \\<br />
\frac{1}{2} & \frac{1}{3} & ... & \frac{1}{n+1} \\<br />
: & : & \ddots & : \\<br />
\frac{1}{n} & \frac{1}{n+1} & ... & \frac{1}{2n-1} \\<br />
\end{bmatrix}<br />

    You want the solution of:

     <br />
H_nx=c<br />

    to be:

     <br />
x=\begin{bmatrix}1 \\ 1 \\ \vdots \\ 1 \end{bmatrix}<br />

    in which case we want:

     <br />
c=\begin{bmatrix}\sum_{r=1}^n \frac{1}{r} \\ \\ \sum_{r=2}^{n+1} \frac{1}{r} \\ \\ \vdots \\ \\ \sum_{r=n}^{2n-1} \frac{1}{r}\end{bmatrix}<br />

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Mar 2009
    Posts
    7
    Ummm.... It looks for me like a magic And how to write an m. file concerning solution of this problem? Would you be so kind and tell me?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by CaptainBlack View Post
    As:

     <br />
H_n = \begin{bmatrix}<br />
1 & \frac{1}{2} & ... & \frac{1}{n} \\<br />
\frac{1}{2} & \frac{1}{3} & ... & \frac{1}{n+1} \\<br />
: & : & \ddots & : \\<br />
\frac{1}{n} & \frac{1}{n+1} & ... & \frac{1}{2n-1} \\<br />
\end{bmatrix}<br />

    You want the solution of:

     <br />
H_nx=c<br />

    to be:

     <br />
x=\begin{bmatrix}1 \\ 1 \\ \vdots \\ 1 \end{bmatrix}<br />

    in which case we want:

     <br />
c=\begin{bmatrix}\sum_{r=1}^n \frac{1}{r} \\ \\ \sum_{r=2}^{n+1} \frac{1}{r} \\ \\ \vdots \\ \\ \sum_{r=n}^{2n-1} \frac{1}{r}\end{bmatrix}<br />

    CB
    Untested:

    Code:
    Hn=hilb(n);
    x=ones(n,1);
    c=(sum(Hn))';  % or Hn*x
    x1=Hn\c;
    err=sqrt((x1-x)'*(x1-x));
    cn=cond(Hn);
    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: February 6th 2011, 04:51 AM
  2. Generate a random matrix given a condition number
    Posted in the Advanced Algebra Forum
    Replies: 2
    Last Post: January 1st 2010, 08:24 AM
  3. determining matrix size
    Posted in the Advanced Algebra Forum
    Replies: 2
    Last Post: June 23rd 2009, 02:27 PM
  4. matrix size in matlab
    Posted in the Math Software Forum
    Replies: 4
    Last Post: November 23rd 2008, 01:38 AM
  5. Condition Number of a Matrix
    Posted in the Advanced Math Topics Forum
    Replies: 0
    Last Post: May 4th 2007, 10:25 PM

Search Tags


/mathhelpforum @mathhelpforum