Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

need a programming language for simple geometrical simulation 1

Status
Not open for further replies.

simnia

Computer
Jul 13, 2011
4
0
0
US
I would like some suggestions as to which programming language to use for a simulation project.

I'm trying to simulate a new type of associative computer memory, which may or may not be implemented as a neural network. I want to be able to show simple geometrical objects moving around on the screen in simulation, like spots, lines, and squares, probably only in 2 dimensions, but I will need colors. I'm anticipating storing the points that describe these geometrical objects in arrays. The objects don't have to move particularly fast, but since I plan to film the results and post them on YouTube, they should be fast enough and solid to look visually interesting/convincing.

I am using Windows Vista. I know only the basics of Linux, but I suppose I could learn more Linux if necessary since there is no real deadline on this project. I have decades of programming experience and I know many languages like C++, Java, MATLAB, Scilab, CLIPS/JESS, Pascal, and BASIC.

One coworker told me that he would use MATLAB for such a project, when I told him what I was trying to do. I cannot afford MATLAB, but Scilab is free and almost the same, so that sounds like the best language for me at the moment, *if* his advice about MATLAB is good. However, as far as I know, such graphical simulation capability is not available in Scilab, despite some impressive videos on YouTube that do not describe how their Scilab programs are interfacing, or how they are working/plotting, so I am wary of starting a huge project in Scilab if I'm not sure it would do what I want.

Any suggestions?
 
Replies continue below

Recommended for you

If you can run Crysis at 60fps on a desktop computer written in (mostly) C/C++, and you already know it well, why fight it?

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
Have you looked at COGO (aka Coordinate Geometry)?

In lieu of C++ you might look at Delphi... a Pascal like language.

Dik
 
Thanks for all the suggestions. I'm totally unfamiliar with Crysis and COGO and Delphi, but I'll take a look into those. I've never tried Visual BASIC but I'm sure I'd find it easy since I knew BASIC very well at one time. I forgot to mention that I do have a copy of Microsoft Visual Studio, even though I can't afford any new software now. That has C++ and I believe Java and Visual BASIC, though I haven't tried the latter two on it. Also, this is a personal project to try out an idea, not a work project or school project, so I can't get funding for it, which is why I need free or close to free software.
 
If you have VS, then you have both VB and VC++, both of which have "forms" upon which you can put graphical objects and move them around, etc. Worst comes to worse, you can do similar things in Excel with VBA. I've created a mock display with controls, and you can click butttons, and make different images appear on the mock display, etc.

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
Well, I see that Python is not part of your arsenal...but I am going to suggest because is totally free along with all its powerful modules for 2D and 3D visualization and simulation, etc.

A couple of years ago, I co-worker wanted to develop a little graphical program to coaching soccer...so, I found Visual Python


and thanks to the ease of programming and the examples, I had something rather impressive just over a weekend.
 
Worst comes to worse, you can do similar things in Excel with VBA.

Why "worst comes to worse"?

For someone familiar with Basic and wanting to do some simple graphics with minimum expenditure and hassle it seems the obvious choice.

Some examples of animations produced in Excel with little or no programming:

(download spreadsheet from Animation doesn't work on-line but click download button for working copy)




Doug Jenkins
Interactive Design Services
 
I don't have Microsoft Office (I can't afford it), so I would have to use Open Office for anything like Excel, and I don't know about their compatibilities and interfaces, which might be different than Microsoft's. Still, that's a good idea, and I can look in it. Also, although I reinstalled my copy of VS this week, I have only Visual Studio 6.0, which is largely incompatible with Vista, so (per Internet information) in practice I can use only C++ and Visual Basic in VS, not Java (J++), on this OS and computer. (I can't afford the $500+ upgrade to Visual Studio 2010 for Vista.) Yesterday one person told me that Eclipse is a free Java environment, which is another option for me.
 
How about writing it in javascript using raphael ( Javascript is free, it will run on any browser. Raphael is just a VML/SVG front end. It works out whether you are using IE or some other browser and calls the appropriate routines.

The only drawback is that it is a bit slow but given that you want to put it on the net, why not just write it for the net.

The nice thing about this is you don't need a compiler and you can run it on any OS as long as it has a browser that supports javascript. As for editors, any editor will do.
 
MS offers a free version of all of their dev tools... you will miss out on things like internet and database development, but it doesn't sound like that would matter.

I have to question any serious engineering project that has the odd specs you're listing, as well as posting the results on YouTube...

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
It should be possible to do what you want in Open Office, but I haven't tried it, so I can't guarantee it.

Java is free, and there are several free development environments for it, including Eclipse.

Javascript is also free, and may well be the best option for what you want. This link:


has a link to a Javascript file for animated pendulums, and also a link with a discussion on the source code. Might be a good place to start.

Doug Jenkins
Interactive Design Services
 
Matlab, Java, scilab, or dev C++ with OpenCV all should work just fine, particularly if you have decades of programming experience.
dev C++ with OpenCV is free.

[peace]
Fe
 
Get MS Visual C# 2010 Express (free) and try out WPF Animation on a Windows Form application.
Plenty of tutorials out there to get some simple animation happening and C# should be simple to pick up if you've used C++ and Java before.

Or, as gsal mentioned, Phython would be good fit for this type of thing.
 
Update...

My copy of Visual Studio C++, which I found out is too old to function on Vista despite online tips I found on how to get it to run on Vista, is ruled out now. I'm going to play with Visual Basic on that software tonight, but I expect the same incompatibility problems. I can't afford the $500+ for an upgrade to modern Visual Studio, and with so many problems with their software, I'm not sure I would pay Microsoft more money for that product even if I could afford it.

Another person I met suggested I could download JRE (Java environment) for free, and just use Notepad for writing the Java programs. That sounds like a decent solution.

PHP is impossible to develop on Vista, in my experience, despite some online claims to the contrary, whose online tips never worked for me. As far as I know, both PHP and JavaScript need to run from web pages, which is workable but a little weird.

I don't need any databases for this project.

It was a professor at UCSD who knew the particulars of my situation and of my intended project who recommended putting any of my simulation results online.

Thanks for the new suggestions, like OCTAVE and C#.

I'm also looking into a new consulting job, so all your suggestions might be good for that other project, especially if database-related, even if not good for this personal project of mine.

 
If you haven't already look into Python as another member suggested.
I hadn't used it before. But I recently installed it put it to the test. I must say that it is really good.
It is a higher level language than C and functions a little slower than Matlab/Octave but is free and works well.

[peace]
Fe
 
you can also use qt designer for c++, but i'd use a more high-level language if i were you.
python for example (eclipse ide) with c++ for the computationally intensive parts.
 
Status
Not open for further replies.
Back
Top