Wolfram Mathematica: Acquaintance

Everyone knows Wolfram | Alpha, and probably heard about Wolfram Mathematica. Unfortunately, the search showed the absence of posts about this wonderful environment on the Habré, and this article would like to open a series of publications devoted to programming in Mathematica. To begin with, it’s worth mentioning the capabilities and features of this system, which oh how many, so be patient. If this mathematical package is of interest to habrazhiteli, then other articles will surely follow, more specific, teaching how to work with the environment and the internal language.

Mathematica is based on a flexible symbolic language that supports many programming paradigms, advanced debugging tools, automatic interface design and much more. It simplifies the entire development process from design to implementation. Mathematica everything - data, programs, formulas, graphs, documents - represents in the form of symbolic expressions.


Since the mathematical environment is described, first of all, it is necessary to talk about its computational abilities and the range of tasks to be solved: Mathematica contains the largest collection of highly optimized algorithms in the world in one system, many of which were discovered by Wolfram Research. The combination of the effectiveness of JIT (compilation on the fly) and automatically configurable parallel computing guarantees the correctness of the answers and high speed of their receipt. The system supports numbers of any accuracy, moreover, even more precise values ​​are often used for internal calculations to improve the quality of the result. Also, to increase accuracy, the environment uses symbolic calculations, i.e. tries to simplify or transform the expression and only then performs a numerical calculation.


All mathematical possibilities 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 conduct differential and integral analyzes, series analysis and Fourier analysis, cluster analysis, integral transforms 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 factorization and decomposition, structural operations, division of polynomials, etc. The environment allows you to create, display and manage 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 field.


Taking simple and multidimensional 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, it was not possible to find such information on the site right now, but it had never let me down in this area.


Mathematica supports a wide range of basic operations and algorithms on graphs, for example: finding paths, loops, clicks and others. You can set arbitrary graphs, generate random graphs, interactively design them, and also export and import into the standard graph format and matrix view. Simple things like factoring, prime numbers, comparative and modular arithmetic may not even be mentioned. Mathematical constants of any accuracy are available, and millions of signs of constants like π or e are calculated in an instant.


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


Not only is Mathematica a powerful computing environment, it has built-in additional functionality that affects many technical areas of activity, from computational biology and financial engineering to wave analysis and geographic 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 entire video files or select individual frames for further processing. And for working with images, Mathematica has a lot of functions built in that serve to obtain them, apply various filters, segmentation, shape analysis, highlight contours, etc., working in real time.


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


Mathematica contains a complete set of functions for displaying structured and unstructured data in 2d and 3d. Functions are built for displaying contour and density graphs, graphs from points, lines and surfaces, vector graphs and graphs of streamlines, histograms, two-dimensional and three-dimensional sector and column diagrams, bubble diagrams, graphs for specialized areas (such as finance and statistics, graph theory , control systems, etc.: the “Japanese candles” chart, QQ-normal probabilistic chart (quantile plot), “box with mustache” (box-and-whiskers plot), LAFCH (Bode plot) and many others).


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


Separately, it is worth mentioning about development, which is much easier with the automatic design of interfaces, symbolic control elements, a single input interface, debugging and profiling with the ability to set various types of breakpoints, monitor expressions during code execution, visual step-by-step control of program execution and many more to others. Mathematica provides a powerful source code editor with syntax highlighting, error reporting, command addition, automatic formatting, indentation, etc. Integration with the multilingual IDE Wolfram Workbench (based on Eclipse) gives you access to various tools that increase development efficiency, for example: project file management, advanced tools for working with source code, debugging and syntax analysis.


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


The system allows you to create packages - platform-independent code libraries that allow you to reuse it and easily distribute it with a full set of documentation and auxiliary toolbars. It’s easy to connect external controllers or input devices 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 extremely powerful at the same time. The system contains all the typical features of a high-quality word processing system, and the character structure underlying the document provides flexible options for setting cascading stylesheets: more than 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 can be called from programs in C, .NET, Java and other languages; automatically generate C code for use in individual projects or for compilation into libraries or executable files; connect dynamic libraries at runtime; Connect to WSDL web services. All this provides a simple implementation in 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. Using gridMathematica, Applications can be run in parallel in a cluster with automatic coordination and process control. Software reporting is supported in a variety of formats, including PDF, spreadsheets, HTML and RTF.


Thanks to the powerful Manipulate feature, you can create interactive gadgets that can be viewed and run on any system using the free Mathematica Player. Among the features of version 8 of the package, one can single out direct access to Wolfram | Alpha data and a free form of linguistic input. You can enter the formula in simple human language, which may 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 32-bit and 64-bit. ( system requirementsand an exact list of supported OSs). And, of course, in such a powerful system can not do without documentation. Mathematica did not disappoint here either: the help consists of interactive laptops containing more than 100,000 examples. All examples can be started or changed directly in the documentation (do not be afraid, the changes are not saved), making it easy to learn new functionality.


Conclusion

In preparation, we used materials from the features section of the official website, documentation, and many years of personal experience working with the environment. Additional information can be found in the section indicated above, information on how to use the system in the solutions section , and you can also see user stories . The pro version costs a lot, but there are significant discounts for students, educational institutions and home use. A trial version is also 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 on Wolfram Mathematica.

UPD: vayun mentioned one of the most interesting pieces for familiarization - aboutWolfram Demonstrations Project , where you can watch many mini-programs made using Manipulate. All programs have an online preview, and the ability to download a demo project (you can start it with the free Mathematica Player ) and source codes.

Also popular now: