Choose a language for writing technical engineering mathematics (can I use Java?)

I need to write a prototype application for an engineering company. Most of the work is the calculation of various engineering properties (I'm talking about pipes and real things here, not about software development).

However, there should also be a GUI for:

input parameters display results some basic diagrams
At present, the calculation work does not include complex mathematical elements (at the moment there are no matrices), just magazines, square roots, relatively simple formulas. Later I will have to do a few:

setting the curve numerical approximation
I was wondering if Java is used for real-world development applications?

Are there libraries for this kind of thing?

Or is it better for me to write in MatLab and then connect to the code through Java?

Also open to other languages ​​(although we are a Java store).

+4
source share
9 answers

I have some experience with both Matlab and Java for scientific / engineering code types. Yes, Java is used for real scientific and engineering codes, and there are libraries available. Of course, you can do what you want, or I'm not sure that you could reasonably distinguish the two based on your current requirements. I asked myself the following questions:

  • How much can I when programming advanced math operations? Operations such as minimization of functions, solvers of differential equations, matrix algebra. If the answer is not very good, then lean towards Matlab, which will provide all these ready-made ones (although you may need additional toolbars). If you choose Java, make sure that you are very happy with floating point arithmetic and deal with the errors that occur when using it.
  • Do I want to code everything in Java, everything in Matlab, or am I happy to use both and struggle with, say, the Java graphical interface on the Matlab engine? I think that you can do much better (with vague meaning) GUIs with Java than with Matlab, but the means of the Matlab GUI are good enough for most of its users, that the complexity of integrating Matlab with Java is not worth solving. But then, many Matlab users are not software developers.
  • What development speed do I need for the prototype to work? If you were equally skilled in Java and in Matlab, I would suggest that you can do it faster in Matlab, because numeric data is already provided, you can focus on the graphical interface. But if you are an experienced Java programmer recently released at Matlab, you may decide to stick with what you know.
  • How will I develop and deploy a production application if the prototype is successful? If Matlab does not fit your deployment ideas, then learning it and forgetting it may not be useful.

Finally, since you are requesting recommendations in another language: forget Java, forget Matlab, forget Python, forget R, use Mathematica, it's even more fun and very powerful.

+14
source

This seems to work for Matlab: you give no reason not to use it. There is some code for evaluating Matlab expressions from Java: http://www.cs.virginia.edu/~whitehouse/matlab/JavaMatlab.html

+5
source

Python has several decent GUI tools as well as NumPy and is easy and fun to write.

+4
source

I suppose Java would be a good choice, although it is not considered a typical language for rapid application development.

Pros:

  • universal GUI toolkit for desktop applications in the standard library (Swing),
  • (relatively) cross-platform,
  • large libraries, for example. from Apache ; a large math library to look at will be colt ; for charts and diagrams you might like jfreechart ..

Minuses:

  • "not so fast" prototyping capabilities

Further reading:

+4
source

I did some work where I had to redefine the Matlab code in Java, so this is certainly possible. Java code can be quite verbose compared to the original Matlab, since Matlab can work directly on matrices / arrays, etc.

Some math libraries you might want to look at if they support the functionality you are looking for:

+4
source

This mainly depends on how easy it is in your environment to include math or another math engine in your product. If this is easy, I would suggest using mathlab, but if not, for example. you have licensing problems or deployment problems, you are probably best using plain Java code.

+1
source

You can also consider the R language .

0
source

I would do a search for software written to calculate pipelines. This issue has been solved. (As you have already noted, calculations should not be difficult). At a minimum, I would recommend that you know what is available to you, how much it will cost, and where the break-even point is for development costs.

A commercial product will have a huge advantage over everything you write: it will have a wider community of users that will bang on it and detect errors for a longer period of time than your prototype. It's worth it too.

What is your opportunity cost? What else could you do with development time that would generate more revenue?

0
source

Do not forget numpy or scipy. Both allow you to call fast matrix libraries from Python.

0
source

Source: https://habr.com/ru/post/1299528/


All Articles