Group Abstract Group Abstract

Message Boards Message Boards

Code for verification of reliable digits ?

Posted 10 years ago

the linear equation system $Ax=b$ has one approximation $\bar x$ and one exact $x^* \neq 0$ solutions. we also gives: $p>3, \|x^* - \bar x \| \leq 10^{-20} + \|A\| \|A^{-1}\| 10^{-p} \|x^*\| $ which $\|A\| \|A^{-1}\|=10^{4}$. The reliable digits of $\bar x$ for solutions of this system of equation is $0$.

this is the mathematica code for verification of the above example.

    hm = HilbertMatrix[4];
    sol = {1, 1, 1, 1};
    mat = Round[N[hm], 1.*^-4];
    bv = Round[N[hm.sol], 1.*^-4];
    s = LinearSolve[mat, bv];
    NumberForm[Norm[sol - s], 5]

The result is $0.6780$. I didn't understand what the meaning of this result. anyone could describe it the result of this code for me? (i.e what is the relation among this answer and the solved example ).

POSTED BY: Dr Muh Nikson
8 Replies
Posted 10 years ago

I got it, except your last statement "there are at most one digit or so correct." would you please wrote more simpler?

Thanks so much Teacher :)

POSTED BY: Dr Muh Nikson
POSTED BY: Daniel Lichtblau
Posted 10 years ago
POSTED BY: Dr Muh Nikson
Posted 10 years ago

Were you not asking about $\|x^\ast-\bar{x}\|$? Norm[x]is just the Mathematica expression for $\|\mathtt x\|$.

POSTED BY: J. M.
Posted 10 years ago

Thanks so much, very nice.

We have one approximation solution:

Out[53]= {1.01850881228, 0.783151176337, 1.53552721482, 0.645697515412}

with this code:

In[54]:= diff = approxsol - sol

we get a vector with difference between the solution with approximation solution.

but I couldn't get this code:

In[55]:= Norm[diff]
POSTED BY: Dr Muh Nikson

Probably you are right about the purpose of that forced rounding.

POSTED BY: Daniel Lichtblau
Posted 10 years ago
POSTED BY: J. M.
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard