System of equations - Relative error

  • #1
mathmari
Gold Member
MHB
5,049
7
We have the linear system of equations with

First, I want to calculate the solution using the Gauss algorithm with complete pivoting, with accuracy and floating-point arithmetic with decimal places.

I have done the following:

The maximal element of the matrix is . We exchange the first and the last column and the first and last row (we make also the respective changes at the vector x and b)

So, we have the following:


So, we get the equations:


From the last equation we get .

From the second equationwe get .

From the first equation we get .

So we get the solution

The exact solution is (according to Wolfram) To check the accuracy of do we have to calculate the difference between the exact solution and the solution that we found? (Wondering)
I also have to calculate an estimate of the relative error using the condition number in respect of .

Do we have to use forthat the following inequality?


(Wondering)
 
Mathematics news on Phys.org
  • #2
mathmari said:
To check the accuracy of do we have to calculate the difference between the exact solution and the solution that we found?

Hey mathmari! (Smile)

I think that is indeed what we'd supposed to be doing.

mathmari said:
I also have to calculate an estimate of the relative error using the condition number in respect of .

Do we have to use forthat the following inequality?

Yep. I think so.
And afterwards, we can compare the result with the we found in the previous question. (Thinking)
 
  • #3
I like Serena said:
I think that is indeed what we'd supposed to be doing.

We have that

To find the difference should we have more digits at the exact solution, or not? So, do we have to calculate it with Matlab for example? (Wondering)

Or do we have to calculate ? (Wondering)
I like Serena said:
Yep. I think so.
And afterwards, we can compare the result with the we found in the previous question. (Thinking)

How can we calculate and ? (Wondering)
 
  • #4
mathmari said:
We have that

To find the difference should we have more digits at the exact solution, or not? So, do we have to calculate it with Matlab for example? (Wondering)

Or do we have to calculate ?

That wouldn't give us the error in would it?
I think the most straight forward way is to indeed use e.g. Matlab.

mathmari said:
How can we calculate and ? (Wondering)

is the maximum absolute value of the elements in isn't it?
Can we give an upper bound for it? (Wondering)
 
  • #5
I like Serena said:
That wouldn't give us the error in would it?
I think the most straight forward way is to indeed use e.g. Matlab.

Ah ok!

I like Serena said:
is the maximum absolute value of the elements in isn't it?
Can we give an upper bound for it? (Wondering)

But do we have the vector ? (Wondering)
 
  • #6
mathmari said:
But do we have the vector ? (Wondering)

Nope. But we don't need it to find an upper bound of do we? (Wondering)
That is assuming that is as accurate as possible within the given precision.
 
  • #7
I like Serena said:
Nope. But we don't need it to find an upper bound of do we? (Wondering)
That is assuming that is as accurate as possible within the given precision.

Does it hold that ? (Wondering)
 
  • #8
mathmari said:
Does it hold that ? (Wondering)

Nitpick: I'd make it .
That's because if the first element was for instance really , it would still be rounded to , wouldn't it? (Nerd)
 
  • #9
I like Serena said:
Nitpick: I'd make it .
That's because if the first element was for instance really , it would still be rounded to , wouldn't it? (Nerd)

Ah ok!

The same holds also for , i.e. , or not? Then we have that
What about in the denominator? (Wondering)
 
  • #10
mathmari said:
Ah ok!

The same holds also for , i.e. , or not?

Isn't slightly different since it's about a matrix?
What was the definition again?

Separately from that, don't we still need to calculate both and ? (Thinking)
 
  • #11
I like Serena said:
Isn't slightly different since it's about a matrix?
What was the definition again?

It is , where .

Why is this different, I haven't really understood that. Could you explain it further to me? (Wondering)
I like Serena said:
Separately from that, don't we still need to calculate both and ? (Thinking)

We have that and , right? (Wondering)
 
  • #12
mathmari said:
It is , where .

Why is this different, I haven't really understood that. Could you explain it further to me?

Each has a doesn't it?
And we add of them togerther.
So shouldn't we have ? (Wondering)

mathmari said:
We have that and , right? (Wondering)

Yep. (Nod)
 
  • #13
Ah ok!

So, we have


But what about with at the denominator? (Wondering)
 
  • #14
mathmari said:
So, we have


But what about with at the denominator?

Isn't that as well? (Wondering)
 
  • #15
Ah yes!

We also have that .

We have that .

The inverse matrix is (with for decimal places)


So,

The condition number is defined as .

So, we get:


Since then
That means that the relative is , right? (Wondering)
 
Last edited by a moderator:
  • #16
mathmari said:
That means that the relative is , right? (Wondering)

Yep. That looks correct to me. (Nod)

Do note that we're measuring 2 different things here.
Calculating using Matlab yields the relative error due to rounding errors when using full pivot Gaussian elimination, and it assumes that and .
Calculating using the condition number of the matrix as we did, calculates how rounding errors in and propagate while assuming that there are no rounding errors during the algorithm to solve the system.
So we would need to add them together to estimate the full relative error. (Thinking)
 
  • #17
Ah ok! Thank you! (flower)
 

Similar threads

Replies
4
Views
1K
Replies
9
Views
3K
Replies
4
Views
1K
Replies
5
Views
2K
Replies
0
Views
931
Replies
7
Views
2K
Replies
9
Views
5K
Replies
2
Views
1K
Replies
10
Views
2K
Back
Top