⬆️ ⬇️

Wolfram Mathematica: Acquaintance

Everyone knows Wolfram | Alpha, and probably heard about Wolfram Mathematica. Unfortunately, the search showed the absence of posts about this wonderful medium in Habré, and this article would like to open a series of publications devoted to programming in Mathematica. First of all, it is worth mentioning the possibilities and features of this system, which is great, so please be patient. If habrazhiteley interested in this math package, then be sure to follow other articles, more specific, teaching work with the environment and the internal language.



The foundation of Mathematica is a flexible symbolic language that supports many programming paradigms, advanced debugging tools, automatic interface design, and more. It simplifies the entire development process from design to implementation. Mathematica, everything — data, programs, formulas, graphs, documents — is represented as symbolic expressions.





Since the mathematical environment is described, first of all it is necessary to tell about its computational abilities and the range of tasks to be solved: Mathematica contains the world's largest collection of highly optimized algorithms enclosed in one system, many of which were discovered at Wolfram Research. The combination of JIT efficiency (compilation on the fly) and automatically configured parallel computations ensures the correctness of the answers and the high speed of their receipt. The system supports numbers of any accuracy, and even more accurate values ​​are often used for internal calculations to improve the quality of the result. Also, to improve accuracy, the environment uses symbolic calculations, i.e. tries to simplify or transform the expression and only then makes a numerical calculation. In this case, the solution algorithm is automatically selected from thousands of methods and can be changed even during the calculation process, which speeds up the obtaining of a solution and improves the accuracy more than the manual setting of the method (which, however, is not prohibited).



')

All mathematical capabilities are enclosed in a small set of powerful functions that provide the ability to solve algebraic, differential, recurrent and functional equalities and inequalities, as well as linear systems; the ability to carry out differential and integral analyzes, series analysis and Fourier analysis, cluster analysis, integral transformations and much more. And also: symbolic matrices, matrices with numbers of any accuracy, dense, sparse, matrices with millions of elements, various numerical methods for finding roots and systems of algebraic equations. Mathematica provides a comprehensive system for discrete computing, includes all aspects of polynomial algebra, such as factoring and decomposition, structural operations, polynomial division, etc. The environment allows you to create, display and control Bezier curves, B-splines, NURBS curves and surfaces in any number of dimensions. Interpolating data with splines allows you to apply spline methods in any area.





Taking simple and multi-dimensional integrals, as well as sums and products of their sequences; A large number of numerical integration methods are supported. According to rumors, Mathematica takes 99% of all known integrals and is a leader in this field. Unfortunately, now it was not possible to find such information on the site, but it has never failed me in this area.





Mathematica supports a wide range of basic operations and algorithms on graphs, for example: finding paths, cycles, click and others. You can define arbitrary graphs, generate random ones, interactively construct them, and also export and import into the standard graph format and matrix view. About such simple things as factoring out, prime numbers, comparative and modular arithmetic can even not be mentioned. Mathematical constants of any accuracy are available, and millions of characters of constants such as π or e are calculated in an instant.





Statisticians will also find Mathematica useful, because it includes a larger number of statistical distributions than in any other system, and offers a complete set of statistical measures and operations (from the expectation and variance to semi-varieties and information entropy), automatic parameter estimation and hypothesis testing, analysis of statistical models and much more.





Not only is Mathematica a powerful computing environment, it incorporates additional functionality that affects many technical areas of activity, from computational biology and financial engineering to wave analysis and geo-information systems.





Mathematica supports hundreds of formats for import and export, including spreadsheets, xml, two-dimensional and three-dimensional graphic formats, multimedia files, documents, including pdf and html, as well as archives and many other specific data formats. Initially, all standard raster, vector and video formats are supported, including gif, jpeg, png, svg, eps, avi, flv, quicktime, swf and others. You can import video files as a whole, or select individual frames for further processing. And for working with images, Mathematica has a lot of functions built in to get them, use different filters, segmentation, shape analysis, contour extraction, etc., that work in real time.





On a multi-core system, the environment automatically starts several parts of the calculation at the same time (a few soul curls, you still need to tinker a bit). The parallel computing subsystem can scale for network computing, grid systems, cloud computing, and the symbolic language provides support for multiple data partitioning models. The system also allows GPU programming: support for CUDA and OpenCL is built in. All GPU operations are fully integrated into the environment, including data exchange between processes, automatic compilation and linking of the GPU code.





Mathematica contains a complete set of functions for displaying structured and unstructured data in 2d and 3d. Built-in functions for plotting contour and density graphs, graphs from points, lines and surfaces, vector graphs and streamline graphs, histograms, two-dimensional and three-dimensional pie and bar charts, bubble diagrams, graphs for specialized areas (such as finance and statistics, graph theory , control systems, etc .: chart “candlesticks”, QQ-normal probabilistic plot (quantile plot), “box with whiskers” (box-and-whiskers plot), LAFCH (Bode plot) and many others).





The graphics subsystem provides a high-quality static or dynamic representation of functions, data, charts, images, or annotations, automatically determining the balance between computation speed and visual correspondence. Graphic functions are able to independently select the print area and the division into regions. Mathematica provides hundreds of options to control every aspect of the display, including image size, axis labels, grid display, splitting, fill, 3d lighting, camera angle, and much more, allowing you to create professional-looking graphics. Moreover, 3d-graphics are interactive, allowing you to change the parameters of the camera in real time.





We should also mention development, which is much easier with automatic interface design, symbolic setting of controls, a single input interface, debugging and profiling with the ability to set different types of breakpoints, follow expressions during code execution, visual step-by-step monitoring of program execution and many to others. Mathematica provides a powerful source editor with syntax highlighting, error reporting, command completion, automatic formatting, indentation, etc. Integration with Wolfram Workbench's multilingual IDE (based on Eclipse) gives you access to various tools that increase development efficiency, such as project file management, advanced tools for working with source code, debugging and syntax analysis.





Mathematica includes a complete set of interface elements and controls: buttons, sliders, tabs, checkboxes, pop-up menus, dialog boxes, toolbars, and also provides the ability to create your own elements. The system renders the controls in a natural way for each platform, allowing you to share graphically graphic applications without having to think about which OS they will work on. UI elements can contain and display any Mathematica expression.





The system allows you to create packages - platform-independent libraries of code that allow you to reuse it and easily distribute it with a full set of documentation and auxiliary toolbars. External controllers or input devices are easy to connect to Mathematica: it automatically recognizes and allows you to configure gamepads, joysticks, tactile devices, 3d mice and other HID devices on any platform.





Work with the environment mainly occurs in the so-called “laptops” (notebook, * .nb), which can contain formatted text, graphics, interactive applications, code and data, and can also be used for distribution in the form of a report or presentation. Entering formulas is very simple and at the same time extremely powerful. The system contains all typical features of a high-quality text processing system, and the symbolic structure underlying the document provides flexible options for defining markup and using styles (cascading stylesheets): over 1000 formatting and design options are available both from the menu and programmatically.





Mathematica connects to any standard SQL DBMS, providing a high-level symbolic representation of the database, queries and results along with full support for traditional SQL string queries; can call subroutines and be called from programs in C, .NET, Java, and other languages; automatically generate C code for use in individual projects or for compiling into libraries or executable files; connect dynamic libraries at runtime; connect to WSDL web services. All this provides a simple introduction to the existing infrastructure. webMathematica deploys high-performance Mathematica applications in the form of interactive websites that use modern web standards and services to add dynamic content and perform calculations via the web. With gridMathematica, applications can run in parallel mode in a cluster with automatic coordination and process control. Software reporting is supported in a variety of formats, including PDF, spreadsheet, HTML, and RTF.





Thanks to the powerful Manipulate function, you can create interactive mini-applications that can be viewed and run on any system using the free Mathematica Player. Among the features of the 8 version of the package, you can select direct access to Wolfram | Alpha data and a free form of linguistic input. You can enter the formula in simple human language, which can be useful for beginners.





As can be seen from the above, the system is cross-platform and released for windows, mac os, linux and even sun solaris 10, both in 32-bit and 64-bit versions. ( system requirements and an accurate list of supported OS). And, of course, such a powerful system cannot do without documentation. Mathematica did not disappoint here too: help consists of interactive laptops containing more than 100,000 examples. All examples can be launched or changed directly in the documentation (do not be afraid, the changes will not be saved), allowing you to easily learn the new functionality.





Conclusion

During the preparation, materials from the features section of the official website, documentation and personal many years of experience with the environment were used. Additional information can be found in the above section, information on how to use the system in the solutions section , as well as user stories . The pro version costs a lot, however there are significant discounts for students, educational institutions and home use. A trial version is available for 15 days of use. [And you can download it yourself you know where].

I hope I managed to interest you, and Habr will see many more articles about Wolfram Mathematica.



UPD: vayun mentioned one of the most interesting pieces to learn about - the Wolfram Demonstrations Project , where you can watch a lot of mini-programs made using Manipulate. All programs have an online preview, and the ability to download a demo project (you can run it with free Mathematica Player ) and source code.

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



All Articles