CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Problem with Matlab (https://www.cfd-online.com/Forums/main/8912-problem-matlab.html)

havana March 25, 2005 23:31

Problem with Matlab
 
I have written several codes using Matlab. I written a code in explicit form, and I found that the results seems to deviate from the code written in other languages, but the accuracy is still acceptable. However, when I modify the codes to implicit form for shock capturing, the code just blown out. And in some other cases, it spent more iterations compare to other languages.

May I know what is the problem? Should I use Matlab to write my CFD code? Please help to clear my great doubt. Thanks a lot.

Havana

Willpin March 26, 2005 04:51

Re: Problem with Matlab
 
I think Fortran is more suitalbe for Engineering calculation. But if the accuracy is in the range of tolerance, it should be ok with matlab.

khairy March 27, 2005 15:28

Re: Problem with Matlab
 
Hi i already write CFD codes using Qbasic,Fortran77,Matlab6,Fortran90,and Visual basic 6,from my little experience in CFD fortran 90 is the most effective and rapid one. if you need any help contact at omrkhairy75@yahoo.com have a good luck khairy-Egypt

havana March 28, 2005 04:19

Re: Problem with Matlab
 
So did you face the same problem as I do when using Matlab?

Steve March 28, 2005 14:43

Re: Problem with Matlab
 
My advice (been there, done that):

Use MATLAB to prototype your code. Then rewrite your solver in C/C++/FORTRAN/Fortran. Connect to it via Matlab's excellent MEX interface, so you can pre- and post-process in MATLAB. Finally, divorce yourself from MATLAB entirely.

I wrote C++ classes to emulate the MATLAB data structures, using well known (and fast) FORTRAN underneath to do the matrix manipulation. Converting from MATLAB to C++ was quite simple.

debs March 28, 2005 20:20

Re: Problem with Matlab
 
Matlab code should work fine like anyother code as long as you do not have problems of memory. Check for memory problems and also check your code

Peter Attar March 28, 2005 23:19

Re: Problem with Matlab
 
I know this may be hard to believe...but perhaps you have a bug.....


All times are GMT -4. The time now is 16:45.