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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...
Back
Top