Fortran double vs Matlab double - Problems with Matrix decomposition

2 views (last 30 days)
Hi,
i have to translate an old Fortran77/90 prog to Matlab. Everything seems to be fine. I tried to use the same structure (for-loops instead of vectorcommands) to minimize the probability of bugs in the first versions.
The fortran sourcecode was part of the dissertation thesis of my professor at the university. Compiled with a 16bit dos machine. In the main procedure is solving a complex 49x49 matrix Ax=b problem by using linpack subroutines (LU). The matrix has a very bad condition and is almost singular. Every variable is declared as double. Result is a plot freq vs. amplitude.
My converted version shows the same plot but with some damped spikes which they shouldn't. First i used the \ Operator then i tried LU by hand, QR and so on. The best result is given by SVD(). But still not the same result of the fortran code. The determinant is NaN ...so i know a bit sensitive. But it works good in the old 16bit dos machine. I don't want to repeat my self - but the prog is almost the same except of the syntax and the known diffrences arrays, subrotines ...etc.
My prof gave me already the advice that this matrix is very delicate. He had several issues when he used an other compiler.
Does someone know if there are differences between the fortran double and the matlab default double ? Shouldn't i get the same result with the backslash op. As far as i know is matlab based on linpack - correct me if im wrong.
Or are there some know issues , bugs related to this problem ?
I would be realy glad if someone could give me a adivce.
Kind Regards Alex
ps: sorry for misstakes in spelling or grammar - i m tired -_- ....

Answers (0)

Categories

Find more on Fortran with MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!