Numerical Error/Large Condition number

AI Thread Summary
The discussion revolves around a MATLAB code developed for fluid dynamics that calculates the shape of a liquid's free surface using Newton Relaxation. While the code generally produces reliable results consistent with existing literature, it occasionally yields incorrect outcomes for certain parameter values. Identifying which parameters lead to accurate results is challenging. The method involves solving a matrix equation iteratively, typically with around 30 iterations and a matrix size of approximately 600x600. The calculated height of the free surface is smooth but contains fine structures. Currently, random parameter values are generated using MATLAB's rand function, and results are filtered based on condition numbers, though this approach is unsatisfactory. The author considers rescaling the matrix coefficients and moving them to the right-hand side of the equation to improve accuracy. They also mention a previous issue with the initial profile used in the relaxation process, which contributed to the method's failures.
cathalcummins
Messages
43
Reaction score
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
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.
 
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top