CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   is matlab enough? (https://www.cfd-online.com/Forums/main/11952-matlab-enough.html)

prapanj August 6, 2006 04:15

is matlab enough?
 
friends, i am an undergraduate aeronautic student. i am interested in cfd and have begun coding tiny codes in matlab. my question is it enough for me to hold on to matlab or should i go for other programming languages like fortran. also i believe that programming difficulty is to be encumbered on software professionals. so just to demonstrate our algorithms, isnt matlab enough for its user friendliness?

is there any other view? (i am poor in c++ and nothing in FORTRAN)


KK.Khan August 6, 2006 05:15

Re: is matlab enough?
 
If you want to be a good CFD devolper, Then it is better/necessary to learn Fortran/C++ + linux . All the work done in this field is in these two language. If you want to modify other people code or even you interested to read other work then matlab is not enough for you. Very basic work exist in matlab till now,

If you are begginer then why you hesitating learning these high level languages.

good luck

Khan


Jonas Holdeman August 6, 2006 08:53

Re: is matlab enough?
 
Is your interest aeronautics or computer programming? As an undergraduate you have much to learn. Don't waste your time learning some of the other languages now. You would still have to gather procedures for mesh generation, data handling, equation solving and visualization and integrate these. Matlab has all the support features you need to explore ideas. Unless you have a lot of time to spend and want the satisfaction of doing it all by yourself, then program development is something for a group. Don't underestimate the time lost trying to find bugs that inevitably creep into programs when writing them.

When you understand program structure and solution algorithms, you can then translate the Matlab code into more efficient languages. You have your Matlab code to guide you when you encounter bugs in your new program.

The commercial codes involve many hundreds of man-years in their development, and academic codes many tens of man-years. Be sure about your goals in your career.

Dominic August 7, 2006 00:38

Re: is matlab enough?
 
Hi,

Its always good to have matlab apart from the standard C/C++/FORTRAN. But the latter are definitely required if you want to perform a high performance computing for CFD. I suggest you to use matlab only as a support tool rather than "THE TOOL". Ive written 2D Euler codes using Matlab, but they are annoyingly slow compared to the C counterparts even if you incorporate vectorized programming skills. But later down the years i feel that Matlab will emerge as an even more powerful tool than the present. You can even write a Parallel Matlab code these days.

Cheers, Dominic

ganesh August 7, 2006 01:38

Re: is matlab enough?
 
Dear Prapanj,

Dominic is right. Though Fortran90/C++ are the preferred languages these days, it is truly possible that MATLAB could in the recent future emerge as a powerful tool. Nevertheless, MATLAB has lot of built in functions to offer that can make programming easier and comfortable. A MATLAB code at present may not be a cometitor to Fortran/C codes in HPC, but can serve as an useful testbed to demonstrate and test a lot of upcoming ideas with ease.

Regards,

Ganesh

andy August 7, 2006 04:16

Re: is matlab enough?
 
As an undergraduate performing tutorial exercises scripting environments like Mathematica, Maple, MATLAB, Python, Ruby, etc... are useful although I have observed a strong tendency to use them for almost everything including tasks that are far better perfomed in other ways.

In a research environment there is a much stronger need to use appropriate tools for the tasks being performed. Scripting is appropriate for a range of tasks but to a lesser degree than as an undergraduate.

If you are fairly sure you will continue with CFD then becoming familiar with the tools used to research and develop CFD at an early stage is probably wise. If you know MATLAB then it is a modest step to master Fortran unlike C++ which will require a much larger investment in time to understand and control what is going on. What this will also teach you is familiarity with editors, files, source, bug, build control, pre and post processors, etc... which are some of the tools used by those researching and developing CFD.

Of course this is all "overhead" and probably best avoided if you have no wish to develop the research and development side.


Mani August 7, 2006 07:58

Re: is matlab enough?
 
>(i am poor in c++ and nothing in FORTRAN)

I am seeing this from a different perspective. Maybe matlab is enough for your current purpose, but...

Regardless if it's "necessary" to know c++ and/or fortran, they are not really that difficult to learn. The fact that I have to admit not knowing anything about these popular programming languages would be reason enough for me to start learning... As a student you have more time on your hand than you'll ever have once you got a job. You could even take a class and get credit for learning.

Take the time now, and do something good for yourself (and your resume). There is no shame in spending time and effort on learning something new, so don't let those who have already lost their thirst for knowledge tell you "learning is a waste of time".

Mani August 8, 2006 07:48

Re: is matlab enough?
 
>i feel that Matlab will emerge as an even more powerful tool

Any language will be more powerful in the future, if you believe in progress, but how will they look in comparison? Will a super-high level programming language ever be faster than lower level languages? I think that regardless how efficient matlab compilers will be in the future, it will always be easier to get more optimized machine code from a programming language on the level of C++ or Fortran (some people still use assembler languages for core parts of their codes!). Advances in computer architecture would also likely benefit all of the above, so languages (or toolkits) like matlab will always be slow in comparison to programming languages that carry less unneccessary high-level baggage. Not to say matblab is not useful, it simply serves a different purpose for different applications (or on different scales). For example it's very popular in other disciplines like flight dynamics, or anything that deals with control theory, and countless other applications. Matlab code is arguably also more portable than Fortran code. Will matlab ever be the "language" of choice for CFD? It seems extremely unlikely.

The idea to use matlab in parallel seems like an odd stretch to me, though. It's like taking a truck that carries a lot of unnecessary load and putting a 100 cylinder 10000 horse power engine on it just so it can accelerate from 0-60 mph in 3 seconds, when instead you could drive a formula 1 car. I guess you could do it either way, but the question is if you want to be a truck driver or a race car driver. :) Then again, I am sure that matlab allows the hard-core user to do a lot of customization, e.g. include home made low level subroutines... or at least it should.

prapanj August 8, 2006 12:14

Re: is matlab enough?
 
hi was that dominic who replied to me "dominic chander". i expect a feeble coincidence. please reply if that was dominic chander. thank u, and a million thaks to those who cleared my doubts too..

Vena Pearl Bongolan August 10, 2006 19:16

Re: is matlab enough?
 
As someone who stopped counting the computer languages I have used at 14 (14 languages, including IBM's Job Control Language), I say: if you know TWO, you know them all.

How did I get to 14? Not because I wanted to, but HAD to. Learn as you have to!

Like you said, most CFD code are in Fortran and C/C++, and you will collide with them whether you mean to or not. Learn as you go, and good luck.


All times are GMT -4. The time now is 12:55.