INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

What are all the must known Programming languages for mechanical enginners?

What are all the must known Programming languages for mechanical enginners?

(OP)
Not only general programming, knowing programming languages will help us to use advanced / user-defined features of other engineering softwares like NX, ANSYS CFX, ANSYS FLUENT etc.,

But each software supports different programming languages like NX supports C++, GRIP, Visual Basic etc., ANSYS CFX supports FORTAN, ANSYS FLUENT supports C++, etc.,

But it will be difficult to learn all programming languages.

So What are all the must known Programming languages for Mechanical enginners, which will be most useful in 'many' of the engineeing applications?

RE: What are all the must known Programming languages for mechanical enginners?

None are essential. Matlab and/or python seem useful to many, including me. I still have to write Fortran occasionally. I am sure you can find engineers who will swear that C, C++ or something else are 'essential'.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: What are all the must known Programming languages for mechanical enginners?

(Second part of the question)

In the most part, C and FORTRAN, in that order. Most CAE tools will provide APIs for both.

FORTRAN will either require buying and using the right (compatible) compiler ... and there are many out there. Mixing is possible, but challenging.

C will generally be easy as the interfaces and calling conventions are well defined. Plus the OS will be written in C, making it a good glue language for applications.

Good luck using a C++ interface without name-mangling nightmares and library versionitis.

- Steve

RE: What are all the must known Programming languages for mechanical enginners?

Assuming that you're looking at a Windows based OS for the programs... C or C++ is not a bad choice. If Microsoft based language, most of their compilers do code that is relatively easy to import/use to other languages. Unless you are dealing with legacy issues, I'd likely step away from Fortran...

Dik

RE: What are all the must known Programming languages for mechanical enginners?

2
If only there was a spreadsheet program with a built-in comprehensive scripting language that allowed you to do 95% of what you need to do, right there on the spreadsheet, but could also link to compiled routines in other languages where necessary. If we had that you could just learn the scripting language in detail, with minimal knowledge of the others picked up as and when required. That way you could concentrate on the engineering, rather than the programming.

Oh, but wait a minute ...


http://newtonexcelbach.wordpress.com/2013/02/25/wh...

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/

RE: What are all the must known Programming languages for mechanical enginners?

Well, while I have dabbled in a few languages in my youth/during my education I haven't really used one since.

Now had I known one better would I have found application for it, possibly. However, not knowing one well hasn't been an obvious impediment.

Posting guidelines FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm? (probably not aimed specifically at you)
What is Engineering anyway: FAQ1088-1484: In layman terms, what is "engineering"?

RE: What are all the must known Programming languages for mechanical enginners?

Doug makes good points, but the goto program is still Matlab, expensive though it be, for crunching of design data and the like. While Excel works well with 2D things, being a spreadsheet program, Matlab, I think, has better facilities for 3D data. Additionally, admittedly at extra cost, Matlab has a raft of supplementary toolboxes for various and sundry applications, like signal processing, image processing, etc. Reading in arbitrarily formatted output files from simulations are probably easier in Matlab.

While Matlab is costly, Octave is a free Matlab-clone, which could get you pretty far all by itself.

TTFN
FAQ731-376: Eng-Tips.com Forum Policies

Need help writing a question or understanding a reply? forum1529: Translation Assistance for Engineers

RE: What are all the must known Programming languages for mechanical enginners?

There's also 'Maple' from 'Maplesoft':

http://www.maplesoft.com/

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

RE: What are all the must known Programming languages for mechanical enginners?

SomptingGuy,

C++ is an object oriented language, as opposed to a structured language like C. Objected Oriented Programming (OOP) makes no sense to me outside of a project in which I write 2000 lines of code, you write 2000 lines of code, the OP write 2000 lines of code, etc. The name mangling nightmares you refer to are all the object declarations needed to keep all of us out of each other's workspace.

For mechanical engineering purposes, I do not think we have that problem. The overhead becomes a pain in the butt. This is why I hate Visual C.

There is Gnu Fortran, which is Free Software. Computer geeks hate Fortran. Fortran is not a general purpose language like C. It is a specialized language for doing stuff that actually, we want to do.

--
JHG

RE: What are all the must known Programming languages for mechanical enginners?

I use Delphi for most of my programming...power of C++ and ease of visual basic...

Dik

RE: What are all the must known Programming languages for mechanical enginners?

In response:

When you are writing code to extend an existing CAE (or other) package, your choice of programming language is somewhat constrained. My post addressed this. It was not a geneneral comparison among the programming languages or analysis environments w.r.t engineering use. That's down to personal preference.

- Steve

RE: What are all the must known Programming languages for mechanical enginners?

Actually I thought the predictability of the various comments was exactly as I expected.

Funnily enough I don't write Fortran because I'm addicted to GOTO.

Cheers

Greg Locock


New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

RE: What are all the must known Programming languages for mechanical enginners?

Unfortunately my hammer in this World of nails is Matlab. And I'm religiously hateful of Excel and scathing of its devotees. Given a clean sheet, C is my fave. But that's just me.

- Steve

RE: What are all the must known Programming languages for mechanical enginners?

Quote (Greg L)

Actually I thought the predictability of the various comments was exactly as I expected.
That was my thought and the reason I didn't bother wading in.

Pick your own tool. There is not one tool for all tasks, and not all people have the same preferred tool for a given task. I'd say every post here has merit except the one that closes the door on a tool.

=====================================
(2B)+(2B)' ?

RE: What are all the must known Programming languages for mechanical enginners?

Sorry, maybe it's not my place to close the door on people expressing opinions. I was just hoping to avoid rehash of previous discussions.

My opinion - excel is a great tool for many tasks… often the first I reach for. Search the old threads for various people's discussions of pros and cons of excel.

=====================================
(2B)+(2B)' ?

RE: What are all the must known Programming languages for mechanical enginners?

and if you use HP calculators, there's always FORTH...

Dik

RE: What are all the must known Programming languages for mechanical enginners?

what do you do for a living, sluzzer?
if you are an ordinary design engineer, maybe some excel+vba to automate pieces of your work. apart from that you don't need anything.
testing uses matlab or labview for example.

in most other areas, it's usually the case that if you need a programming language, you have a phd.

RE: What are all the must known Programming languages for mechanical enginners?

Regarding the cost of Matlab: There is a FOSS alternative, Octave, that's very good. Actually, I find GNUPlot (the plotting engine employed by Octave) to be less buggy than that of Matlab.

I have used Matlab since I learned it in college, and it's a great tool. That said, for a new engineer, I might point them towards Python/Scipy/Numpy. Python is freely available (so you can use it wherever you happen to be), and it has a growing number of libraries which are really a rival to Matlab's capabilities... and in many cases are better.

That said, Matlab still has some nice graphical tools and debugging widgets which make it really nice to work with. It's also comparatively faster than Octave in solving certain types of problems. Also Simulink is really unique to Matlab. I don't use Simulink myself, but I understand that many people find it invaluable.

As far as spreadsheets go... I find them very useful for simple calculations, but I've never really pursued VBA programming. I find that if programming is required for a task, Matlab/Octave and Python seem like better tools for the job than VBA to me. Maybe that's just my own personal bias, though.

That said, one advantage of creating a spreadsheet with fancy macros is that any knucklehead should be able to use it without much knowledge about what it's doing behind the scenes... depending on the spreadsheet, though, that might not be an advantage after all. I suppose that you could say the same for a Python program with a GUI, though...

RE: What are all the must known Programming languages for mechanical enginners?

(OP)
@ loki3000
Yes loki3000, I am an "ordinary" design engineer & as u say I was doing everything in ordinary way, before joining this forum!
After joining this forum, I learnt many things by going through the queries of many persons in this forum :) I observed that some time consuming works like Modelling Gears, Extracting points to text, etc., are simplified by way of programming in GRIP or VB (mostly by Mr.JohnRBaker :) ) . So I thought learning a scripting language will not only makes the work easier but also interesting ! :) but i was confused to decide which programming language to learn & so i put this question n this forum.

Thanks everyone for the reply :)

I spent considerable time in analysing which programming language is better for " mechanical engineer" and I have gone through many sites & also read a book "Beginning programming for dummies" to understand that and I would like to share something which I learnt:

First of all the requirement for a typical mechanical design engineer is
1. to used the extended facility of softwares (NX - GRIP,VB ; EXCEL - VB ; CFX - FORTAN ; FLUENT - C++)
2. Mathematical modelling, problem solving & automation
3. Data visualization

First of all, I like to tell essential type of programming languages, in brief:
1. Machine language (only 0s & 1s ; the only language which the processor can understand but for us it is difficult to write such a program)

2. low level programming language, eg C program. (a language which is not 0s & 1s, which can be comparitively easier for us to read & understand. Even this language should be translated to 0s & 1s by "compiler program" to make the processor understand)

3. high level programming language, eg MATLAB (low level & high level with respect to computer. It means a high level program is easier for us but to the computer it is complicated)

4. Scripting language: This can be any programming language (mostly low level languages) by which the usage of a software can be extended or customized as per our need. As said by Mr.somptinguy, the choice of learning a scripting language is constrained, since many softwares uses different languages & it depends only on the software maker & there is no single scripting language for all softwares.


Many prefers low level languages like C, since
1. it is widely accepted,
2. it is the choice for scripting language for many softwares.
3. can be used to control hardwares easily (if we need)

But it is less preferable when it comes to our requirement 2 & 3 (i.e., mathematical modeling, data visualization etc.,)

Considering all that, I think "MATLAB" is better. MATLAB suites for requirement 2 & 3. Some may tell that excel is sufficient. But I say, atleast excel is not easier in handling complex problems, plotting complex graphs (like 3d plots, polar plots etc) and much more. And coming to our requirement to use a "scripting language", there is a option to convert Matlab program to C program completely using "matlab coder"; it can be used to access hardware too. The generated program can be used as standalone executable program also using matlab compiler.

Hence matlab satisfies most of our requirement.

There are much more like object oriented programming languages like c++, database languages, etc., but here i shared only a few thing which is necessary for a mechanical engineer!

Atlast I know, most of the persons here are experts & knows these things pretty well. But I shared, to give a clear picture and it may help somebody who knows only little like myself ;) & looking forward to learn a lot :)
If I am wrong anywhere, then please let me know.

(some may still think, explaining even types of languages is too much ;) but previously i was searching in this forum for the samething & so i shared it here :) )

Thank you.

RE: What are all the must known Programming languages for mechanical enginners?

for mechanics (deflections for example, hydraulics...) excel is better (than matlab), since it gives you a GUI, you can paste pics inside, so that you don't forget in a couple of months what do the formulas do, etc. MathCAD is even better, but more expensive and it's a PTC product.
i doubt you really need the features of matlab + advanced feats are quite expensive (matlab -> c++). it is much worse for symbolic math then mathematica or mathcad.

i think NX also uses C for macros.

RE: What are all the must known Programming languages for mechanical enginners?

The old style NX 'Macros' (which we still support) are recorded using a proprietary keystroke capture scheme, however 'Journals', which can be recorded and played-back like a 'marco', can be created using any one of several standard languages, including Visual Basic, C++, Java and C#, and starting with the next release of NX, which we began beta testing last week, we've added Python.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

RE: What are all the must known Programming languages for mechanical enginners?

Just for my own interest John, are you saying that users can effectively drive an "NX session" through interpreted Python. An imported Python module with access to NX data structures and its engine? As opposed to an extension to the core functionality of NX. Or both.

- Steve

RE: What are all the must known Programming languages for mechanical enginners?

This is how this new capability is being described at the moment:

The Python programming language is added as a language binding for NX Open. This allows NX users to record and replay NX workflows in the Python language. Advanced users can create or extend NX Open Python journals to develop NX Open applications in Python. These applications can use any of the features of the Python programming language including classes, looping constructs, control statements, and callbacks. Python journals can be recorded and replayed on Windows, Linux, and Mac.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.

RE: What are all the must known Programming languages for mechanical enginners?

Thanks. That's interesting. Python does seem to be the glue/driver/wrapper scripting language du jour.

- Steve

RE: What are all the must known Programming languages for mechanical enginners?

shouldn't python already be available via .net (ironpython)?

RE: What are all the must known Programming languages for mechanical enginners?

Loki - I haven't tried Iron Python, but looking at the Wikipedia page on it, it seems to have one large problem for engineering applications:

" Conversely, CPython applications that depend on extensions to the language that are implemented in C (e.g. NumPy) are not compatible with IronPython,[16] although a commercially-supported open source project to address this is underway.[17]"

However linking Python to Excel is relatively simple with a number of packages, of which ExcelPython (which I am experimenting with at the moment) is free and open source, and seems to work well.

Doug Jenkins
Interactive Design Services
http://newtonexcelbach.wordpress.com/

RE: What are all the must known Programming languages for mechanical enginners?

yes, that is true.
ironpython is more of a just another language for .net. just the syntax, not the libraries.

RE: What are all the must known Programming languages for mechanical enginners?

I do most of my stuff with web based apps coming from a web hosting programming background (7 years operating NPS Internet Solutions, Inc.), hence my programming weapon of choice is Perl, with a little HTML, javascript and MySQL thrown in. I haven't had to touch Matlab or C++ since my college days, some 20 years ago.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close