Numerical Error/Large Condition number

In summary: It was generating a lot of spurious solutions that were completely wrong. After I switched to a different initial profile, the error went away.
  • #1
cathalcummins
46
0
Hi there,

I am working on a problem in Fluid dynamics. I've written a code in MATLAB which finds the shape of the free surface of the liquid based on Newton Relaxation. The code is fairly robust and produces good results which agree with current papers on the same problem.

Unfortunately, for some values of the parameters of the problem, the results are just plain wrong. It's not straightforward to identify a priori which values of the parameters will lead to the correct results and which will give spurious ones.

The method boils down to solving a matrix equation successively in a relaxation fashion. The number of iterates is generally quite modest ~30 and the matrix is usually about 600X600.

The quantity being calculated, the height of the free surface, is fairly smooth but displays some fine structure too.

The way I have the problem working now is to use MATLAB's rand function to generate random parameter values and then filter the results based on the condition numbers of the resulting system. This seems to get me a little further but I am unhappy with this approach.

I was thinking about rescaling the large matrix of coefficients and dumping them onto the right hand side of the matrix equation. Is this usually advantageous? Does anyone have similar experience with numerical error/scaling?

Thanks for reading
 
Technology news on Phys.org
  • #2
I just heard a talk about errors showing up when the problem involves the "computation of multiple roots of polynomials whose coefficients are inexact". All the research was done using matlab. Are you doing something like that?

google pulls up some papers on this.
 
  • #3
That sounds about right, thank you. Fortunately, since I wrote the last post, I discovered that the method was failing for a different reason. The "initial profile" I used to start the relaxation procedure was a very poor choice.
 

1. What is numerical error and how does it affect calculations?

Numerical error refers to the difference between the calculated value and the true value of a mathematical calculation. It can occur due to limitations in the precision of numbers used in calculations or due to rounding errors. Numerical error can significantly affect the accuracy of calculations, especially in complex and iterative algorithms.

2. What is the condition number of a matrix?

The condition number of a matrix is a measure of its sensitivity to numerical errors. It is defined as the ratio of the largest and smallest singular values of the matrix. A matrix with a high condition number means that small changes in the input data can result in large changes in the output, indicating that the matrix is ill-conditioned and prone to numerical errors.

3. How can a large condition number be identified?

A large condition number can be identified by calculating the ratio of the largest and smallest singular values of a matrix. If the ratio is close to 1, the matrix is well-conditioned, but if it is significantly larger than 1, the matrix is ill-conditioned and has a large condition number.

4. What are the consequences of a large condition number?

A large condition number can lead to significant numerical errors in calculations, making the results unreliable. It can also affect the stability and convergence of numerical algorithms, causing them to fail or produce incorrect results. In some cases, a large condition number may also indicate that the problem is ill-posed and has no unique solution.

5. How can numerical errors and large condition number be minimized?

Numerical errors and large condition number can be minimized by using more accurate numerical methods and algorithms, increasing the precision of numbers used in calculations, and avoiding operations that can amplify errors (such as subtracting nearly equal numbers). It is also important to carefully analyze the data and problem at hand to identify any potential sources of errors and mitigate them as much as possible.

Similar threads

  • Programming and Computer Science
Replies
6
Views
2K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
Replies
22
Views
2K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
2
Views
888
  • Atomic and Condensed Matter
Replies
4
Views
1K
Back
Top