Contacts

Maximo System Properties History of Values. Tikhon Tarnavsky. Maxima is the maximum freedom of symbolic calculations. Task at home

Since in this cycle of articles we will talk about a mathematical program for symbolic calculations, for a start a few words about the fact that these are the most symbolic or, as they are also called, analytical calculations, in contrast to numerical calculations. Computers are known to operate with numbers (integers and floating semicolons). For example, solutions of equation x 2 \u003d 2 x + 1 can be obtained as -0.41421356 and 2.41421356, and 3 x \u003d 1 - as 0.33333333. But I would like to see not an approximate digital record, but an accurate value, i.e. 1 ± √2 in the first case and 1/3 in the second. From this simplest example, the difference between numerical and symbolic calculations begins. But besides this, there are still tasks that are generally impossible to solve numerically. For example, parametric equations where in the form of a solution should be expressed by an unknown one by parameter; or finding a derivative of the function; Yes, almost any sufficiently common task can be solved only in symbolic form. Therefore, it is not surprising that, for such a class of tasks, computer programs appeared, operating not only by numbers, and by almost any mathematical objects, from vectors to tensors, from functions to integro differential equations, etc.

Maxim in science and education

Among the mathematical software for analytical (symbolic) computing is the most widely known commercial ( Maple., Mathematica.); This is a very powerful tool for a scientist or teacher, graduate student or a student, which allows you to automate the most routine and requiring increased attention part of the work that operates the analytical data record, i.e. actually mathematical formulas. This program can be called a programming medium, with the difference that mathematical designations are used as elements of the programming language.

The program that has become the topic of the article works on the same principles and provides similar functionality; The most radical difference is that it is neither commercial or closed. In other words, we are talking about a free program. In fact, the use of free to more naturally for fundamental science than commercial, since the model that is used in free software is a model of openness and accessibility of all developments. Obviously, the same properties are inherent in scientific research. Using such similar approaches, you can actually consider extensions of the free program functionality or additional libraries that can be created for their needs in the process of scientific research, as an integral part of the results of such studies. And these results can be used and propagated at the discretion of the user without regard to the limitations imposed by the licenses of the original software. In the case of commercial software, which is owned by its manufacturer, this kind of freedom is significantly limited, from the impossibility of freely (and legally) to transmit itself to such a software together with developments and up to possible patent lawsuits from the developer company in the case of the distribution of homemade additional libraries to it.

On the other hand, the main direction, except for scientific developments, where such programs are in demand - this is a higher education; And the use of free software for the training needs is a real opportunity for the university, and for students and teachers to have legal copies of such software at their disposal, and even with significant, cash costs.

This article opens a cycle dedicated to a free program of analytical computing. Maxima.. This cycle I will try to give you the most complete impression of the program: it will be devoted to both the principles and basics of working with MAXIMA and the description of its wider opportunities and practical examples.

A bit of history

The history of the project, known under the name Maxima, began at the end of the 60s in the legendary MIT (Massachusetts Institute of Technology - Massachusetts Institute of Technology), when, within the framework of the large Mac project that existed in those years, work began on the symbolic calculation program that received MacSyma name (from Mac Symbolic Manipulation). The system's architecture was developed by July 1968, directly programming began in July 1969. Lisp was chosen as a language for the development of the system, and the story has shown how the right choice is: from the existing programming languages, it is the only one continues to develop and now - Almost half a century after the start of the project. The principles based on the project were later borrowed by the most actively developing commercial programs - Mathematica and Maple; Thus, MacSyma actually became a source of all directions of symbolic mathematics programs. Naturally, Macsyma was a closed commercial project; It was financed by public and private organizations, among which were included in the history of ARPA (Advanced Research Projects Agency; Remember Arpanet - Antinet Ancestor?), Energy & Defense Departments (Departments of Energy & Defence, Doe and Dod). The project was actively developed, and organizations controlling it changed more than once, as it always happens with long-lived closed projects. In 1982, Professor William Shelter began to develop his version based on the same code called Maxima. In 1998, the shelf managed to get the right to publish the code under the GPL license. The initial project Macsyma ceased to exist in 1999. William Shender continued to develop Maxima until his death in 2001. But what is characteristic of open software, the project did not die with his author and curator. Now the project continues to actively develop, and participation in it is the best business card for mathematicians and programmers of the whole world.

A few words about the program

At the moment, Maxima is available under two platforms: UNIX-compatible systems, i.e. linux and * BSD, and MS Windows. Of course, I will talk about the Linux version.

Maxima itself is a console program, and all mathematical formulas render with conventional text symbols. There is at least two advantages in this. On the one hand, Maxima itself can be used as a kernel, pulling graphic interfaces on top of it for every taste. Them today exist a lot; This time I will focus on the two most popular (see the insert) - and the most visual and convenient in work, and about the rest, let's talk in the following issues; They are also interesting in their own, although more specific.

On the other hand, by itself, without any interface add-ons, Maxima is undemanding to the gland and can work on such computers that no one consider now for computers (this may be relevant, for example, for a university or a scientific laboratory, Who has no money to update the parking lot of cars, and the need for symbolic calculations may occur).

The names of the functions and variables in maxim are sensitive to the register, that is, the capital and lowercase letters differ in them. This will not be in a novelty anyone who has already dealt with POSIX-compatible systems or with such programming languages, as, say, C or Perl. Conveniently, from the point of view of mathematics, for which it is also familiar that different objects can be designated in capital and lowercase letters (for example, the sets and their elements, respectively).

In order to start working with the program, you will need Maxima; If it will not be in standard repositories of your distribution, then you can take it on the project site, the address of which is given in the insertion.

The principles of working with the program do not depend on which interface to it you will choose, so I will try to abstract as much as possible from a specific interface, limited to small comments in cases where they behave differently.

At the moment, the latest version of the program - 5.9.3, I will talk about it; If an older version is still present in your distribution, you can use it in principle: and relevant a few more months ago 5.9.2, and in the late last year 5.9.1 do not have the current fundamental differences.

Graphic Interfaces to Maxim

From the point of view of familiarization with Maxima itself, two interfaces are of the greatest interest.

The first is a separate independent graphic program by name. . She, like Maxima, in addition to Linux / * BSD, there is also in the version for MS Windows. In WXmaxima, you enter formulas in text form, and maxima output is displayed graphically familiar mathematical symbols. In addition, the big emphasis here is made on the convenience of entering: the command line is separated from the I / O window, and the optional buttons and the menu system allow you to enter commands not only in text, but also in the dialog mode. The so-called "autocillment" in the command line is actually with such only the similarity, which is called by the Tab key. It leads itself, unfortunately, just as a smart team history, i.e. it causes that command from the already entered in this session, which begins with the characters specified in the command line, but does not complement the command names and their parameters. Thus, this interface is most convenient when you need to calculate a lot and see the results on the screen; And more, perhaps, if you do not like to enter all the commands from the keyboard. In addition, WXmaxima provides a convenient interface to the system documentation; Although, since the documentation comes in HTML format, an ordinary browser can be used instead.


The second is a fairly interesting interface to Maxima - this is an additional mode in the editor . Although this editor has a general historical past with widely well-known Emacs, which is clear from the name, but there is little practical similarity between them. Texmacs is being developed for visual editing of the texts of the scientific themes in which you see the editable text on the screen in almost the same form in which it will be printed. In particular, it has the so-called mathematical input mode, very convenient for working with the most diverse formulas, and can import / export text in LaTEX and XML / HTML. It is the possibilities for working with formulas using Maxima, caused from Texmacs'a. In fact, the formulas are displayed in the usual mathematical notation, but it can be edited and copy to other documents like ordinary text. Maxima session is called from the menu: " insertSessionMaxima."This appears an additional menus with Maxim commands. After starting the session, you can already go into the mathematical input mode inside it (the input mode menu is called the first button on the input panel) and when entering elements of mathematical notation. This interface will be most convenient to those who want to use the results of calculations in their texts and likes to edit them in visual mode.



Getting to work

After launching the Maxima session, we see such lines in front of them:

Maxima Restarted. (% I1)

The first is a message that the Maxim's kernel has just started (instead of it, depending on the version and a specific assembly, brief information about the program can be displayed; The second is an invitation to enter the first team. A maxim team is any combination of mathematical expressions and built-in functions, completed, in the simplest case, with a comma point. After entering the command and press "ENTER" MAXIMA will output the result and will expect the following command:


For arithmetic actions, traditional designations are used: -, +, *, /; ** or ^ for the exercise, SQRT () for a square root.

If for some designations it will be not obvious how to record them in the string, I will explain it in the course of the presentation.

As you can see, each cell has its own label; This label is a cell name enclosed in brackets. Input cells are referred to as% i with a number (I from input - input), output cells - as% o with the corresponding number (o from output. - output). From the mark% start all the built-in service names: so that, on the one hand, make them enough short and convenient to use, and on the other - to avoid possible overlays with custom names, which are also often convenient to do short. Thanks to this uniformity, you do not have to memorize, as often happens in other systems, which of these short and convenient names are reserved by the program, and which you can use for your needs. For example, the internal names of% E and% PI are indicated by well-known mathematical constants; And through% C with the number is denoted by the constants used in the integration, for which the use of the letter "C" is traditionally in mathematics.

When you enter, we can contact any of the previous cells by its name, substituting it into any expressions. In addition, the latter output cell is denoted by%, and the last input cell is via _. This allows you to turn to the last result, without distracting what is its number.

Here% + 47/59 is the same as% o1 + 47/59.

The output of the results of the calculation is not always needed on the screen; It can be drowning, by completing the command to the $ symbol instead; . The stolen result is still calculated; As you can see, in this example, the cell% O1 and% O2 is available, although not shown (to the cell% O2, the appeal passes through the% symbol, the meaning of which is decrypted above):

Every new command is not necessary to write from a new line; If you enter multiple commands in one line, each of them will still match your cell name. For example, here in the row after the label% i1 were introduced from% i1 to% i4; In the cell% i3,% I1 and% I2 are used (designated as _ - Previous input):


In WXmaxima and Texmacs, the last or only command in the line can not be supplied with the final symbol - it will work the same way as if it was completed; , i.e. the conclusion will not be drunk. In further examples, I often will omit; . If you choose another interface, do not forget to add it.

In addition to using the names of the cells, we naturally can and yourself give names to any expressions. In a different way, we can say that we assign values \u200b\u200bof variables, with the difference that any mathematical expression can act as the value of such a variable. This is done with the help of a colon - the sign of equality is left to the equations that, given the general mathematical context of the recording, is simpler and more familiar. And besides, since the main mack of maxima is the symbolic record and analytical calculations, the equations are often used quite often. For example:

In some sense, the colon is even more visually in such a context than the equality sign: this can be understood that we set a kind of designation, and then we decipher through the colon that it is indicates. After the expression is named, we can call it at any time by name:

Any name can be cleaned by the Kill () function assigned to it, and free the memory occupied by this expression. To do this, simply type Kill (Name), where Name is the name of the expression destroyed; Moreover, it can be both the name assigned to you and any input or output cell. In the same way, you can clear all the memory and release all the names by entering Kill (ALL). In this case, all the I / O cells are cleaned, and their numbering will begin again from the unit. In the future, if the context be due to the logical continuation of the previous I / O lines, I will continue the numbering (I have already taken advantage of this reception above). When the new "session" is in no way connected with the previous one, I will start the numbering renovation; It will be an indirect indication of making "Kill (ALL), if you type examples in Maxima, since the names of variables and cells in such" sessions "can be repeated.

Access to Maxim Documentation

In the examples above, we used two built-in features. As it is easy to guess from the context, SOLVE is the function of solving the equation, and DIFF is the differentiation function. Almost all Maxima functionality is implemented through such built-in functions. The Maxima function can have a variable number of arguments. For example, the SOLVE function that we used with one argument is more often called with two arguments. The first sets the equation or function whose roots must be found; The second is a variable relative to which the equation must be solved:


If the formula specifying the solved equation contains only one character, as in the previous example, then the second argument can be omitted, since the choice, with respect to which it is necessary to solve the equation, is still unequivocal.

The second function from our new acquaintances - DIFF - can also take one argument; In this case, it finds the differential of the specified expression:

Through del (x) and Del (y), differentials of the corresponding characters are indicated here.

For each embedded function there is a description in the Maxima documentation. It contains information about which arguments and in which options the function is accepting, as well as a description of its action in different cases and specific examples of application. But, of course, search for a description of each desired function in HTML documentation or info-pages is not always convenient, especially since this information is needed, as a rule, right in the process. Therefore, Maxima has a special function - Describe (), which issues information from the documentation for specific words. Moreover, especially for the convenience of obtaining reference information, there is an abbreviated version of the call of this feature :? Name instead of Describe (Name). Here? - This is the name of the operator, and the argument must be separated from it a space (expression? Name is used to call the LISP function named Name). DESCRIBE function and operator? Give a list of those partitions of help and name names that contain the specified text, after which they offer to enter the number of the partition or description of the functions you want to see:

When you choose a section, its contents will be issued:


If for the word you entered after? or Describe, a single coincision was found, its description will be shown immediately.

In addition to reference, in many Maxima functions there are examples of their use. An example can be downloaded to the EXAMPLE () function. Calling this function without an argument will display a list of all names available examples; Calling the view Example (Name) will download to the current session and execute the specified example of the example:


Solving a problem with launch from under texmacs

If you have any problems with the launch of the Maxima session from Texmacs, pay attention to who in your system acts under the name / bin / sh. The fact is that the initialization of all diverse sessions is implemented in Texmacs through the shell scripts caused precisely with / bin / sh. And in the script that meets the Maxima session is used, which is not standardized as mandatory for / bin / sh, but is present in its Bash emulation. In other words, if you / BIN / SH are not reference to / bash, and something else, it can be the reason for the impossibility of opening a Maxima session (for example, in Debian and distributions based on it, except Bash link / BIN / SH may want to put even more easy dash; in this case, it is possible to restore the status quo using DPKG-RECONFIGURE DASH). If you do / bin / sh reference to / bin / bash it is not possible, you can try to change #! / BIN / SH on #! / Bin / bash in the / usr / lib / TEXMACS / TEXMACS / BIN / MAXIMA_DETECT file. I wrote about this problem to developers Texmacs, but I have not received any of their reaction, so I can not say yet, whether this flaw will be fixed in the nearest versions.

Basic principles

The fact that Maxim is written on Lisp, a person familiar with this language becomes clear already at the beginning of working with the program. Indeed, Maxime clearly traced "Lispovsky" the principle of working with data, which turns out to be very useful in the context of symbolic mathematics and analytical calculations. The fact is that in Lisp, by and large, there is no separation for objects and data: variable and expression names can be used in almost the same context. In Maxima, this property is developed even stronger: in fact, we can use any character regardless of whether it is assigned to him some expression. By default, a symbol associated with any expression will submit this expression; A symbol that is not connected with nothing will represent itself, interpreted again as an expression. Let us explain on the example:

From this it follows, in particular, that the value of the symbol included in it is automatically substituted in the expression only if this value has been attributed to the symbol until the expression is determined:

If some character already has some value, can we use this symbol in the expression, and not its value? Sure. You can do this using the sign of the apostrophe - entered in front of any symbol or expression, it prevents its calculation:

The result of expression% I12 would be similar and if B and Y had no values \u200b\u200bat that time; Thus, we can boldly block the calculation of the symbol, not even remembering (or not knowing), whether they are given any expressions at all.

In the same way, you can do with any built-in function if we want not to fulfill it, but to use in our mathematical context. For example, the already mentioned differentiation function can be useful to us to designate the derivative in the differential equation; In this case, of course, it is not necessary to calculate it:

Thanks to the described features, work in Maxim, on the one hand, becomes largely similar to the traditional "manual" work with mathematical formulas, which practically negates the psychological barrier at the beginning of working with the program. On the other hand, even at this initial stage, you actually get rid of the most routine handmade, such as tracking current characters values, and you can fully focus on the task itself. Of course, the calculation blocking is not the only way to influence how Maxim will calculate this or that expression; This process can be controlled quite flexible.

When entering each team and the result, as already noted above, the sequence number is assigned.

The designation style used allows you to refer to the previously obtained results, for example, in this way (%o 1) * (% o 2) - the results are required to multiply.

For the last answer inMaxima. There is a special designation%. And for the last command _ (adhesion sign).

Example: Calculate the value of the functionat points x.= a., and calculate.

The command (% i1) was completed (the result of% O1 appeared) and the function was determined. Therefore, the following two commands (% i2) and (% i3) caused (albeit differently) this function to calculate values \u200b\u200bat specified points. From (% i4) it can be seen that the reference to the result line (% O2) can be written without brackets ().

Major mathematical operations in Maxima are designated in the usual way: +,-, *, /. The exercise for convenience is provided to record three different methods ^, ^^, **. Assignment Sign is a colon« : ", Team for Maxima" A: 2; " It should be read as follows: "variable but Assign a number 2 ". At the end of the team except the point with a comma " ; »It is permissible to put a dollar sign $. If there is a point with a semicolon, the result is displayed on the screen, if you have a dollar, the result is not displayed on the screen, the exception is the commands for displaying graphs ending with the dollar, but displaying the graph.

3.1. Variables in Maxim

Variables B.Maxima. Could store characters, analytical expressions, function definitions, logical values \u200b\u200b"TRUE", "FALSE", lists, equations, lines of text concluded in double quotes, as part of which are Cyrillic characters, and, of course, numbers: whole, rational fractions , real fixed accuracy and substantial with a floating point of unlimited accuracy of type% PI.

From the following example it can be seen thatMaxima is a completely finished mathematician, for her variable h. And something - no one incomprehensible object "Peter" - no difference. Maxima.

In this example, Maxima was divided ("Peter" 2-4) / ("Pete" -2) and received "Peter" +2. Then from Petya +2 \u200b\u200bMaxima took away "Peter" and eventually received an integer 2.

3.2. Possible calculation errors

From the following example, it follows that in operations with numbersMaxima "swore" only for 16 meaningful numbers and "nothing computer is not alien to it," she also has purely computational problems (see% O3) with rounding when calculating.

The fact is that in the examples givenMaxima. Calculates are not integers, but with approximate. Calculations are not made in the decimal system and not by formal replacement of division by the introduction of a multiplier of 10 -5. The division is done real in the binary system. Approximate numbers have a standard length floating comma. The results are rounded so that 16 significant digits remain.

In this example, the unexpected"Additive "Minor and is only 0.3 * 10 -21.

In the following example, it is much larger. But, as in the previous case, is also a consequence of the technical capabilities of the computer in the implementation of floating-point arithmetic operations.

Due to real performing arithmetic computing, the results are inaccurate: the answers% O3 and% O4 differ from zero.

3.3. Records

If the recorded command contains a sign of equality,Maxima considers it as an equation, from the left and right part of which one and the same value can be taken away, and both part of the equation can be multiplied by the same value, with multiplication of two equations, their left and right parts are variable.

3.4. Uncertain form of expressions

Expressions in Maxima. May have two forms: acting and uncertain. In cases where the expression only needs to be displayed, not to calculate ( uncertain form ), before him follows put a sign (Single quotation). For example, we wished to display the same task that we saw the first in the windowXmaxima. , Therefore, copy the text of the job, add quotes, and call the interpreter. Receive

where we see that the first example in the windowXmaxima. It is devoted to the calculation of the integral presented here.

However, the specified method will not work if the expression is explicit value, for example, expression sin (π ) Maxima. Considers as zero and in the presence of an apostrophe. Respectively co s (2 π ) For Maxima. exactly equal to one.

On the other hand, to force to force the expression to calculate, that is, to translate it into the acting form, you should put a single quotation with two times (apply the operator of the active form - ′′ ).

3.5. Calling certificate

It is difficult to provide for a variety of possible options for recording commands for useMaxima. To calculate or convert expressions. In difficult cases, you can try to get a certificate in English.

To call certificates Should write?topic and call an interpreter by pressingShift.+ Enter.where topic - This keyword (topic) of references.

Team?? topic calls for the search on all topics of reference containing a keywordtopic.

In the following example, we wanted to ask about the factorial sign, but did not put the gap after the question of the question (mistaken).Maxima. replied that there is no exactly the same as in the request, (exact Match) themes.

And advised to try (Try.) Secondly (??) ask for the purpose of obtaining not a completely accurate answer. That the answer was unsatisfactoryMaxima reported in the form false In the response line (% O1).

In the next question, we were also mistaken (again did not put a space), but wanted to ask about the functioncOS ( x.) It turned out unclear for the program and therefore did not receive any answer at all.

In the case of factorial (!) With a secondary query, Maxima gave an exhaustive answer (which we reduced a little)

In response, Maxima first created a numbered list of answers (in this case, she has two numbers 0 and 1), then suggested entering separated by a space (space - separated ) Section numbers or specify all (aLL) or none ) of them. After clarification ( but) that she understood how (all. ), Maxima printed a certificate for the requested "factorial".

3.6. Entering numeric information

Input rules of numbers inMaxima. exactly, as for many other similar programs. A whole and fractional part of decimal fractions are divided by a symbol. point. Before negative numbers put a sign minus. The numerator and denominator of ordinary fractions are divided using a symbol / ( direct Slash).

Please note that if a certain symbolic expression is obtained as a result of the operation, and it is necessary to obtain a specific numeric value in the form of a decimal fraction, it will solve this task. numer. In particular, the option numer Allows you to move from ordinary fractions to decimal:

Here Maxima First of all, operated by default. It folded the fraction 3/7 and 5/3 according to the rules of arithmetic accurately: found and led the fraraty to the general denominator and folded the numerals. As a result, she received 44/21. Only after we asked her to get a numerical answer, she brought an approximate, with an accuracy of 16 characters, a numerical answer 2,095238095238095.

3.7. Establishment and seniority of operations

As noted above, the designation of arithmetic operations inMaxima. They do not differ from the classical presentation, the same mathematical signs are used: + - * /. But the exercise is provided to be denoted by three ways: ^, ^^, **.

Square root extraction produces SQRT () function, degree root extraction n. write down as a degree ^^ (1 / n.).

In Maxima. Standard operations are defined - finding a number factorial, (for example, 6! \u003d 1· 2 · 3 · 4 · 5 · 6 \u003d 120) and the finding of a double factorial (for example, 6 !! \u003d 2· 4 · 6 = 48; 7! = 1 · 3 · 5 · 7.= 105).

To increase the priority of operation when recording commands for Maxima, round () brackets are used.

As can be seen from the results of the calculation results (% O13) - (% IO5), Maxima correctly understands the seniority of operations: first advocated the construction of the division into the degree and only then the division operation. By executing the command (% i13), it was elevated to the degree 1 and divided the result by 3, but when executing the team (% I14), the root of the third degree was calculated, the result (% O15) is equal to the work (% O13) and (% O14).

3.8. Constants

In Maxima. For convenience of calculations, there are a number of built-in constants, the most common of them are shown in the following table (Table 1):

Table 1

The names of the constants and their designation in Maxima.

Name

Designation

π (Pythagorean number)

e. (Eulero number)

Imaginary unit ()

+ ∞ (plus infinity)

- ∞ (minus infinity)

mINF.

True

true.

False

false

Complex infinity

infinity.

left (in relation to limits)

minus.

right (with respect to limits)

plus.

Golden section ()

% phi.

3.9. Variables and expressions

Variables are used to store the results of intermediate calculations. Note that when entering the names of variables, functions and constants, a register of letters is important. So, variables X. andX. - These are two different variables.

The assignment of the variable value is carried out using a symbol. : (colon), for example x: 5.

If you need to delete the value of the variable (clean it), then the method is appliedkill: Kill (x ) - Deletes the value of the variable x, and the Kill (All) command deletes the values \u200b\u200bof all previously used variables. And, in addition, the Kill method begins a new numbering for executable commands (note that the response to the command (% i3) below turned out to be an answer to the number zero (% O0) done, and then the numbering of the commands began again from the unit).

Recall also that in one line (see%i. 1), you can write several commands, dividing the last symbol ; (point with a comma) or a $ (dollar) sign, if we do not need to display the result on the monitor.

Mathematical operations in Maxima are used to record expressions. All in Maxima is expressions, including mathematical expressions as such, as well as objects and software blocks. The simplest expression is an atom or an operator with arguments.

Atom - symbol (name), row in double quotes, or a number (integer or floating point).All expressions of non-atoms are represented as oper.(a1. ,.., aN.), where oper -operator name, A1, ..., aN -his arguments. Expressions may be displayed in different ways, but the internal representation is always the same. Arguments of expression may be atoms or expressions of non-atoms.

Team op.returns the operator, args. Returns the arguments atomdetermines whether the expression is atom.

For example :

Function symbolp. Returns "True" if its argument is a symbol.

The function of two FREEOF (,) arguments () returns "true" if its second argument is free (does not contain) the first argument.

The zeroequiv (,) function checks whether its argument is -Function of one argument - zero. Zeroequiv returns "True" if its argument is zero and "false" otherwise.

The zeroequiv function can be useful in cases where the result of a series of transformations is not confidence that the resulting function is identical in source.

3.10. Mathematical functions

Maxima has a large set of built-in mathematical functions. The most frequently used are shown in Table. 2.

Table 2

Built-in mathematical functions Maxima.

Functions

Designation

Trigonometric

sin (sinus),

cOS (cosine),

tan (Tangent),

cot (Cotangent)

Inverse

trigonometric

aSIN (Arksinus),

aCOS (Arkkosinus),

aTAN (Arctanens),

aCOT (Arkkothangence)

Seeks, Kosyosons

sec (x) \u003d 1 / cos (x), (sections),

cSC (X) \u003d 1 / SIN (X), (Cosac)

Natural logarithm

log ()

square root

sQRT ()

module

aBS ()

remainder of the division

mod (,)

Minimum of the list

min (x1, ..., xn)

Maximum from the list

max (x1, ..., xn)

Argument sign

POS (X\u003e 0),

Zero (x \u003d 0),

sIGN (X); \u003d NEG (X<0),

PNZ - (not defined)

Random number

random (N. ) - whole, from the interval

if N-track

random (Float (P )) - a floating point number

It should be borne in mind that some names of functions differ from the names used in the domestic literature. Maxima is used instead of TG - TAN, instead of CTG - COT, instead of Arcsin - ASIN, instead of ArcCOS - ACOS, instead of ArctG - ATAN, instead of ArcCTG - ACOT, instead of LN - LOG, instead of COSEC - CSC.

Examples of using functions:

3.11. Rule recording functions

To write a function, you must specify its name, and then, in parentheses, write through the comma of the arguments. If the value of the argument is the list, it consists in square brackets, and the list elements are also separated by commas.

3.12. Custom functions

The user can specify its own functions. To do this, first indicates the name of the function, the names of the arguments are listed in brackets, after signs := (colon and equal) follows a description of a function that can be non-immature. After task, the user function is called exactly as built-in functions.Maxima.

It must be remembered that you should not use for the names of the name reserved for the built-in featuresMaxima. (recorded above in Table. 2).

3.13. Translation of complex expressions in the linear form

One of the most difficult classes for novice users of the systemMaxima. is the record of complex expressions containing degrees, fractions and other designs in linear form (in the text form of recording, withASCII. Symbols, in one line).

To facilitate this process, it is notels to give several recommendations:

1. Do not forget to put a sign of multiplication! In a graphic windowMaxima. According to the rules of mathematics twice the value of the variable h. writes in the form of 2 x.but when recording a team forMaxima. it should look like 2 * x.

2. But between the name of the function and the bracket with the argument, the multiplication sign is not written;sin * (x ) - Here is an extra multiplication sign.

3. In case of doubt, it is always better to rearrange and put "extra", additional brackets (). The numerator and expression denominator always need to enter into brackets. When recording the end of the degree, the base and the degree is better to always take in brackets.

4. The function does not exist separately from its arguments (if any). Therefore, for example, when it is built into the degree of function of some argument, you should take the entire function with arguments in brackets, and then build the resulting design to the desired degree: (sIN (X. )) ** 2. Very often, novice users are trying to take into a degree only the name of the function, forgetting about the arguments:sin ** 2 (x ) - it is not right!

5. It is also necessary to remember that several function arguments are recorded in brackets, through a comma, for examplemin (x 1, x 2, x 3, x N. ).

6. Invalid function recordingsin (2 * x) as sin * 2 * x or sin 2 x . Remember howMaxima. When writing brackets: as soon as you try to write a discovery bracket, she immediately writes the second - a steam room - a closing bracket. Therefore, when writing functions, write the name of the function, then put empty brackets after it and only then write all its arguments in these brackets, separating them with commas. There should be no design between the name of the function and the opening bracket!

7. In the case of recording a complex expression, scroll it into several simple components, enter them separately and then combine using the notation previously discussed.

Examples of simple commands for Maxima. :

Mathematical recording

Team for Maxima.

(x + 2) / (Y-7)

(x + 3) ** (2 * y)

sIN ((X-2) / (A + 3))

((x-2) / (a \u200b\u200b+ 3) +2) / (4- (y-7) / (b + 4)) + 12 * x

The exercise: N. it is necessary to introduce the following expression:

Guidelines: We divide this expression into three components: we will consider the numerator separately part, the expression in the denominator in brackets and the degree. We introduce each named component, and unite them into the expression.

When entering the command, the erroneous entry of the command forMaxima. You can select and remove from the graphic screen (from the keyboard), and write and execute it instead (with the keyboard by pressingShift.+ ENTER) The correct command should be expected that the response number will change.

If you click on the abrade triangle with the mouse, the triangle will paint, and the string will be hidden, and the record will appear (1 Lines Hidden). To remove from the screen and response, and the command (block marked on the left square bracket), you follow the mouse to select the square bracket in the entry-response, call the right mouse button the context menu and select the Delete Selection option. So in previous examples of the string with the command (% i4) and with the answer (% o4) no - they are removed.

Note also that when recording a team forMaxima. (% O1) / (% O2) ** (% O3) In the line (% i5), it is quite acceptable to be renovated and write otherwise using additional brackets for the denominator: (% O1) / ((% O2) ** (% O3) ). ButMaxima. Correctly understood us without these "extra brackets" and calculated the introduced expression mathematically correctly, because it understands the mathematics starting operations: First of all, the arguments are calculated (since they are in brackets) and functions, then the exercise is carried out, then the operation of division and multiplication and only then addition and subtraction.

by 0):
a) y: 2 / x; x: 0; b) U: 0; V: 2 / U; c) z: 0; T: 2 / z; and why?

3. What is the operator in expressions a) x ^ y; b) - t; c) x + y;?

4. What will answermaxima, if you fulfill the command: u - v; OP (%);?

5. What is equalization: a) 4 * - 2; b) 4 * + 2; c) 4 ** - 2;?

6. What is the arguments in the expressionfAS (P, Q): \u003d P - Q?

7. Is an ABC expression atom?

8. Why in the following examplesMaxima managed to numerically calculate TG (π / 2) And, but refused to make numerical calculations for CTG (0)?

9. What answer will give Maxima if the team for it will be like this:

10. What is more e. π or π. E.?

11. How much percent more of the compared numbers exceeds the smaller?

12. What will answer Maxima if the team for her will be like this:

Complete mathematics

Alexander Bikmeev It disassembles how free is computer mathematics and how free software is mathematical.

Any science, from physics to philology, uses the achievements of mathematics. In connection with these specialists, non-mathematicians need funds that allow to put tasks in mathematical form and obtain solutions in the formula or set of values, that is, computer mathematics systems are needed, capable of making labor solutions to mathematical problems with various methods.

Unfortunately, in our country, such programs are distributed in a fairly narrow field of scientific activity, and not least, this is due to the fact that schoolchildren and students do not introduce professional mathematical packages, the cost of only one license to which is often calculated by thousands and tens of thousands of rubles.

We invite you to look into the world of free mathematical packages that can be downloaded free from the Internet to use for any kind of research (sometimes with reservations), as well as, due to the presence of source texts, study their internal device and, if desired, expand their functionality proper Forces.

Symbolic calculations

Computer mathematics systems (SCM) are developed for a long time, and Maxima. () It was one of the first. Initially, it was a commercial product, but, without sustaining the competition, the system moved into the discharge free.

Shell wxmaxima. and menu item that allows you to output or remove from the screen of the Mathematical Operations Panel.

The main advantage Maxima. Before other free systems is support for symbolic calculations. That is, entering an analytical expression or equation, you can get the result also in analytical form.

Maxima. Allows you to solve algebraic equations, system of equations, perform integration, differentiation operations, decomposition in a row and so on. In addition, it knows how to solve differential equations, boundary tasks, Cauchy challenges, perform algebraic calculations with matrices, build graphs and surfaces specified by various functions in Cartesian and polar coordinate systems. All possibilities are difficult to list.

For SCM Maxima. Developed several shells, most convenient of which (for a novice user) is wxmaxima. (See Fig. 1). Starting from version 0.8.0, it rapidly changes for the better. The latest version (0.8.3) contains features of such well-known commercial packages as Maple. and MathCAD.. Work in this shell is quite simple and allows you to obtain acceptable results after a few minutes of use. Many operations whose names are present in the menu and on the toolbars are equipped with convenient masters that allow you to solve tasks, not even knowing the built-in language and teams. Maxima.. Well, another important fact - all shells for this SCM are Russified. In addition, having studied free package Maxima., students will be able to easier to be mastered in commercial packages, which is due to both relative interface similarity, and the syntax used (this applies Maxima. and Maple.).

The system is perfectly documented, but reference material is represented only in English. Our magazine published educational materials about work in SCM Maxima. (LXF81-86). Being a console application, Maxima. can work in batch mode, i.e., it can be transmitted to process a text file with a message list and receive a text file with the results again, and if we consider that the output can be decorated with means of markup system TeX.This allows you to use it as a base for building your own applications. One example of such a development is the expansion Texmacs..

Based on the existing learning experience, it can be said that students of junior courses are mastering work in Maxima.quickly quickly and begin to use it when performing tasks for other subjects. But with each course they have more and more problems.

The fact is that along with a large number of positive moments Maxima. There are also negative. First, the end result, especially when solving complex tasks, largely depends on the level of knowledge of mathematics and the experience of using this SCM, because it is sometimes necessary to perform preliminary transformations on their own. Secondly, Maxima. It works very well with algebraic expressions, but transcendental, logarithmic and similar to them cause significant difficulties. However, if you cannot get an analytical solution, you can always use the numerical calculation. Third, opportunities Maxima. on the construction of complex graphs or visualization, for example, vector field, do not go any comparison with the possibilities Maple.. And finally, fourth, for full-fledged work it is necessary to study numerous teams and constants Maxima., And this requires time and patience.

SCM Maxima. Included in many Linux distributions or at least necessarily present in the repositories. It is included in the educational products such as Altlinux School, Edubuntu and Edumandriva.

Window Smath Studio., in which the function is defined, its derivative is calculated and the schedule is built.

It should be noted that engineers are still accustomed to working with such a powerful calculator application as MathCAD.. This is an engineering calculation system available for any platforms (see Commercial Packages), but for serious money. However, employers require that graduates will be able to work in this system. How to be educational institutions?

Saving project was born in our country: Smath Studio. (http://ru.smath.info/forum/). This is free, but, unfortunately, not yet a free product, the developer of which, Andrei Ivashov, is trying to create an alternative to monster MathCAD., And it turns out this (see Fig. 2). The application is designed for the environment .Netand then adapted for Mono..

Smath Studio. Allows analytical calculations, operations with matrices, build graphs and calculate derivatives, and even supports programming functions. Unfortunately, analytical integration is not yet supported, but the product is successfully evolving, and in the fall of 2009 the author finishes the development of an infrastructure that will allow the use of third-party connected modules. Perhaps then the development of the application will enter a new level, and we will get a full alternative MathCAD..

It should also be noted that in the spring of 2009, by agreement with the author, the product was included in the EDUMANDRIVA Educational Distribution. Despite limited functionality, this application allows you to perform daily calculations at the level of schoolchildren and junior courses, as well as simple engineering calculations. And if you consider that Smath Studio. Perfectly feels on pocket computers and smartphones managed by Windows Mobile, the acquaintance with him for schoolchildren and students is simply necessary.

On the official website there is always documentation in DOC and ODT formats, and on the official forum you can ask questions to the developer or community and discuss the algorithms used in the development of an application.

Window wxmaxima. With the results of symbolic calculations and graph graph

At the end of this section, I want to focus on the fact that the packets of symbolic mathematics are issued as a result, and not the number. Consider the example shown in Fig. 3, in which the user function is defined and the second derivative was found for it; Then the function is integrated. At the same time the schedule was built. Thus, schoolchildren and students can clearly fulfill the full analysis of the function. And this is not all: Maxima. Able to simplify expressions by disclosing brackets, bringing similar terms, performing substitutions and setting certain conditions and assumptions imposed on the expression. Add here the possibility of symbolic solutions of equations and systems of equations, as well as differential equations, and you will understand that the modern student without these tools can not do, and teachers of natural disciplines can revive lessons and practical classes through the input of interactive tasks or demonstration material.

Numerical calculations

As you know, not every task can be solved analytically, that is, to get a solution in the form of a certain formula. Then various numerical methods come to the rescue, to obtain a solution with some accuracy. The most famous representative of applications for numerical calculations is the system of computer algebra (SKA) Matlab.

Matlab Widely distributed worldwide (see comparison in LXF109), but the cost of even educational licenses are not affordable not only to schools, but also many Russian universities. Abroad also prefer to consider money - and investigate human resources into the development of free analogues Matlab. Consider some of them.

First of all, in my opinion, it is worth stopping on the project GNU OXTAVE (http://www.gnu.org/software/octave/). Developers are positioning this system as a "high-level programming language for numerical calculations." Like many free * NIX projects with a long tradition, it provides the command line interface. Enter in Terminal oCTAVE - and (if, of course GNU OCTAVE. Installed on a computer) You will invite this system in front of you. Start entering commands, and the results of the calculations will be displayed in the terminal.

The command line interface has its advantages, as it practically does not take computer computing resources, leaving the entire processor power to the calculation itself, and not on a beautiful display of text text and the result of calculations. Nevertheless, the modern user is rarely ready to put up with it.

. Shell qtoctave with computing performed.

For a long time GNU OCTAVE. did not have a graphical interface, until finally, did not appear qtoctave (See Fig. 4). This shell very reminds the interface. Matlab and allows you to automate the execution of some routine operations (for example, the construction of graphs) with the help of masters.

The language of the system is made as similar to the language. Matlab; Consequently, a man who has mastered GNU OCTAVE.will be able to work almost without retraining Matlab, namely, it is necessary to employers. In addition, the enthusiasts of the movement of free software for the system created a sufficient number of extension packages. Due to this, the functions of the SK itself is constantly growing. Well, and the presence of comprehensive documentation (albeit in English) both for the system and for extension packages makes this product not only profitable, but also accessible to study.

The minuses include not quite a convenient shell interface qtoctaveMoreover, the version has not been updated since the fall of 2008 (the impression is created that the project is abandoned). Extensions packages are not rich in features and do not shine with graphic capabilities; In addition, they are not equivalent, since the situation is such that one project is developed by a freshman student, and the second, for example, a team of teachers of the university. But this is a completely free project, with which you can not worry about the licensed cleanliness of the solutions obtained.

The next package that I would like to consider is called Scilab. (http://www.scilab.org), whose name itself indicates similarity Matlab. Initially, it was also a commercial product, and he was called Blaise, and then Basile. His creators inspired the first versions MatlabAnd for some time they competed. However, in the early 90s, Simulog stopped selling it, and then six developers of the French National Research Institute (INRIA) founded the project Scilab..

Scilab. It is advantageous from his fellow on the workshop by the developed interface, the presence of a sufficiently large number of specialized expansion packages, as well as the fact that it is supported by a consortium Scilab.which includes major educational and scientific institutions from around the world.

Interface Scilab 5.

Scilab. - the only free system similar Matlabhaving your own tool for block modeling called Scicos.. In the product distribution, there is a built-in scripting editor and the functions with the possibility of debugging. Scilab. It has developed graphic possibilities for creating high-tech applications. With the functionality of the system, you can read, examined demo examples - some of them are very impressive (select menu items ? \u003e Demonstration of opportunities).

Scilab. It has a function in its composition not only to perform all sorts of operations on matrices, but also to build graphs and three-dimensional surfaces in various coordinate systems, functions for working with genetic algorithms, solving problems in graphs, statistical functions, imitation modeling tools and much more. Every year several conferences dedicated to the use of SKA Scilab. In science, education and production.

There are several books on the world on the description of the work in Scilab., as well as solving a number of specialized tasks. Unfortunately, none of them have been translated into Russian. In Russia, only two books came out, one - within the framework of the national project, and in the second Scilab. Describes along with non-free packages. Our magazine has also repeatedly printed textbooks on work in Scilab. (LXF106-109 and), and yet the documentation is not enough, and the reference materials do not always allow you to understand how one or another function works.

Freemat. - An impressive result of what a team is capable of three like-minded people.

Fifth version Scilab. marked the beginning of a new stage in the development of the system. The application interface has changed (the developers refused GTK.-Interface), began to change the block modeling tool Scicos.which in October 2009 should change its name on Xcos..

Another variation on the topic Matlab is an Freemat. (); This package has another important overall feature with MatlabNamely support for object-oriented programming. The program interface is sufficiently pleasant. In the main window implemented automatic commands. The official site has a full guide to work with the system (in English). The distribution of the program has a small, according to current standards, the volume is 18 MB.

The system allows the numerical solution of equations and systems of equations, both linear and nonlinear, and numerical processing of signals (see Fig. 6); It is capable of working with multidimensional matrices. The main positive moments Freemat.compared to Scilab. and OCTAVEare large compatibility of the internal language system with the language Matlab and use OpenGL To build graphs and surfaces, as a result of which they look better.

Minuses of the same Freemat. are low speed (some tasks are solved at times slower than in other packages) and the lack of expansion packages. This system is developing only by the efforts of the team of three. The project does not have a large community.

Remote Mathematics

The above-mentioned systems are local projects, that is, work with them is carried out on one machine. But this happens inconvenient - for example, when remotely learning; In addition, not all students will agree (and sometimes they can) put these applications on their home computers. In this case, funds are needed for remote work with mathematical packages.

SMATH Studio Live.: Consider without leaving the browser (albeit not very fast).

Among those considered this opportunity provides Smath Studio.. In chapter Live. The official site (http://smath.info/live) is a virtual work list, on which anyone can perform their calculations. The system is very convenient, although it does not shine speed.

And yet more professional in this regard Sage (http://www.sagemath.org/). This system consists of a Web server providing a graphical interface to interact with the code. Pythonon which her core is written. Any user with their favorite web browser can connect to the server, register and receive personal space in your own. It can be both open, and closed, that is, only accessible to the server administrator and the owner itself. Work sheets can be created in the personal space, and all calculations are performed.

Within the working sheet, you can use any available language, and such a lot. Default System Sage Combines the following products: Gap, Maxima, Python, R, Latex. In addition, can be connected Octave, Axiom, Magma, Mathematica, Matlab, Maple, Mupad other. As a result, we obtain a single remote work server that allows you to train any mathematical packages and perform calculations using both free and commercial computer mathematics systems.

. For incomprehensible reasons Sage. refuses to work in Firefox.But otherwise this is a good solution for remote work.

The system of access rights to personal spaces and the possibility of collaboration with a working sheet of several users at once allows to organize remote training with a sheet of explanation of the curriculum containing examples of solving problems, and personal assignment sheets for each student.

Currently, there are several public Sage-Servers - you can connect to them, see the sheets laid out in common access, to have their own personal space and, in case of difficulties, ask for help from the community. To do this, simply make a working sheet public. I assure you: wishing to help quite a lot, the only problem is that the working language is English.

There are links to a test public server on the official website (http://www.sagenb.org), as well as on training materials and books created using this system. Sign up and try Sage - Maybe this is what you are looking for? It is also worth noting that we did not manage to enter the server in Firefox.But in other browsers there were no problems.

So, we reviewed the most popular free computer mathematics systems. Is it possible to use them in training and to work - to solve you. We have already done your choice, and do not regret it.

Commercial systems

Among the commercial systems are the most popular three: Matlab (numerical calculations) Maple. (The main emphasis is on symbolic calculations) and Mathematica. (successfully combines the aspirations of the first two). Powerful engineering package is located MathCAD.Since it is rather a large engineering calculator, and it is not intended to solve complex tasks of mathematical physics or the theory of encryption, signal processing, and so on.

All these packages have versions for the most common platforms: Windows, Linux and Mac OS X. We give the cost of one license of these packages for academic institutions, according to the Softline price list:

  • Matlab - 30 765 rubles;
  • Mathematica. - 9002 rubles;
  • Maple. - 36 286 rubles;
  • MathCAD. - 5290 rubles.

Conclusions You can do ourselves.

Cycle operator

The cycle operator can be set in several ways. The method of setting depends on whether it is known in advance how many times it is necessary to perform the cycle body.

Example: Quitting the cycle to output variable values \u200b\u200band in the range from -3 to 10 in increments of 5:

Example: the cycle to find the sum of all natural numbers to the number 50 inclusive:

The next important possibility of the Maxima system is work with lists and arrays.

MakeList command is used to generate lists. For example, using the command

we formed a list with the name X, consisting of ten elements, valid

ARRAY command is used to generate arrays. For example, with the help of the command,

we formed a two-dimensional array A, consisting of 10 lines and 5 columns. To fill the array by elements, we use the cycle with the parameter. For example,

So-called Gubina, E.V. Andropov

To display the elements of the array on the screen, you can use the command:

An array can be formed without prior announcement. In the following example, we formed a one-dimensional array X, consisting of 5 elements, the values \u200b\u200bof which are calculated by the formula x i \u003d sin i.

The inconvenience of working with arrays is that the output of the values \u200b\u200bof the elements of the array is carried out in the column. It is much more convenient if the values \u200b\u200bof the array (two-dimensional) are displayed in the form of a matrix. For these purposes, you can use the GenMatrix command. For example, to form a two-dimensional array (matrix), you must specify the command as follows:

Withdraw the resulting array:

1.7. Manage computing process in Maxima

The Maxima Computer Mathematics System refers to symbolic mathematics systems. Therefore (by default) the system issues the result in symbolic form. That is, if you do not specify a special command, system

Chapter 1 Basics of Work in Computer Mathematics Math Maxima

never present the results obtained during the calculations in the form of an approximate estate. For example, if we enter the command to enter the command2, we will get:

If there is a need to present the result in the course of the calculations in the form of a real number, then in this case you need to give a special system to the system. For example, you can do this: if you want to get an approximate value of 2, then select the menu item Numerical calculations → To Float(including single accuracy) (orto BigFloat

(including double accuracy)). The result will look like this:

The "%" sign in Maxima is used to appeal to the result obtained in the last session of the work. This is convenient if there is no need to enter user variables and to further use the obtained values.

To control the calculation process, the so-called "Calculation blocking". Blocking is performed using a single sign of the apostrophe. Her essence:

if you put the apostrophe sign before the name or variable name, then the calculation of the function itself (but not its arguments) or variable is blocked;

if you put an apostrophe before the expression concluded in the brackets, then all this expression will remain the entire expression, that is, all the functions that are part of it, and all the arguments of these functions.

For example, set the function F X and compare the results obtained when you try to calculate the function value at pointX \u003d 0.

As you can see, the sign of the apostrophe has blocked an attempt to calculate the function value in the first case.

Another example:

So-called Gubina, E.V. Andropov

As opposed to blocking computing using two signs of the apostrophe, on the contrary, you can make the system of computing - "Forced calculation". For example,

aK can be seen, the system refused to calculate the integral, although we did not give the command to block the calculations. If we deliver a double apostrophe in front of the team, we will get the following result:

Note that in the Maxima system by default, all angles are measured in radians. Therefore, if you want to work with corners in degrees, it will be necessary to recall the translation formula from radians to degrees.

In Maxima terminology, the non-form of expression is called "Noun Form", calculated - "Verb Form".

The next important point when working in computer mathematics systems is the ability to substitute the values \u200b\u200bof variables or parts of expressions in the function, expressions. Consider some of the features of the system provided for these purposes.

For example, it is required to express COS X 4SIN X - X instead of the variable to substitute a particular value, for example,.

Chapter 1 Basics of Work in Computer Mathematics Math Maxima

Thus, the Subst command allows you to perform substitution to the expression of any variables. In fact, substitution commands in the expression or function in Maxima are several.

1.8. Simplest transformations of expressions

By default, the MAXIMA system is the active auto-project function, i.e. The system tries to simplify the entered expression itself without any team.

Example. Let it be required to find the value of the following numerical expression

1 1− 4

: 2 1 4 4 5 7.

Let us set the expression according to the rules of the Maxima system.

As you can see, the system responded to the value of the expression, although we did not ask any team.

How to make the system bring not the result, but the expression itself? To do this, the simplification function must be disabled using the SIMP: FALSE $ command. Then we get:

In order to activate the simplification function, you need to set the SIMP: True $ command. The auto-recovery function can operate both with numeric and with some not numeric expressions. For example,

So-called Gubina, E.V. Andropov

When you enter, we can contact any of the previous cells by its name, substituting it into any expressions. In addition, the last cell of the output is denoted by%, and the last input cell is via _. This allows you to turn to the last result, without distracting what is its number. But such appeals to cells do not need to be abused, because when overestimating the entire document or its individual input cells, disagreements between cell numbers may occur.

the result is 5 times.

Preferably, instead of cell names, use variables and assign their names to any expressions. In this case, in the form of the value of the variable can act any mathematical expression.

Value names are saved throughout work with the document. Recall that if you need to remove the definition from the variable, then this can be done using the Kill (Name) function, where Name is the name of the expression being destroyed; Moreover, it can be both the name assigned to you and any input or output cell. In the same way, you can clear all the memory and release all the names by entering the Kill (All) command (or select Maxima-\u003e Clear Memory (Clear Memory)). In this case, all the I / O cells are cleaned, and their numbering will begin again from the unit.

The auto-recovery function is not always able to simplify the expression. In addition, there is a number of teams that are designed to work with expressions: rational and irrational. Consider some of them.

rat (expression) - converts a rational expression to canonical form: reveals all brackets, then brings everything to a common denominator, sums up and reduces; Certains all numbers in the ultimate decimal record to rational. The canonical form is automatically "canceled" in case of any transformations that are not rational

ratsimp (expression) - simplifies the expression due to rational transformations. It works including "deep into", that is, irrational

Chapter 1 Basics of Work in Computer Mathematics Math Maxima

part of the expression are not considered as atomic, but simplified, including all rational elements within them

fullratsimp (expression) -the function of simplifying the rational expression by the method of sequential use to the transmitted expression of the RATSIMP () function. Due to this, the function works slightly more than ratsimp (), but it gives a more reliable result.

expand (expression) - reveals brackets in expression at all levels of nesting. Unlike the RATEXPAND () function, the fractions of the transit to the general denominator does not lead.

radcan (expression) is a function of simplifying logarithmic, exponential functions and power with non-target rational indicators, that is, roots (radicals).

Often, only its complication can occur when trying to simplify expression in Maxima. An increase in the result may occur due to the fact that it is unknown which values \u200b\u200bcan take variables included in the expression. To avoid this, you should be restricted on the values \u200b\u200bthat the variable can receive. This is done using the Assume function. Therefore, in some cases, the best result can be achieved by combining Radcan () with Ratsimp () or Fullratsimp ().

- A 2 B 2

aBA1 / 4.

Example. Simplify expression

b A B A 2 1/4

a 2- B 2.

If you apply to our expression to simplify rationally, we get:

Applicate the Assume function (condition) and use it to some variables included in the expression, restrictions on their values:

So-called Gubina, E.V. Andropov

As you can see, they received a compact result.

1.9. Solution of algebraic equations and their systems

IN the MAXIMA system for solving linear and nonlinear equations is used built-in SOLVE function, which has the following syntax:

sOLVE (EXPR, X) - solves the algebraic EXPR equation relative to the variableXX

solve (EXPR) - solves the algebraic EXPR equation with respect to an unknown variable included in the equation.

For example, solve linear equation 5 x + 8 \u003d 0. To do this, we use the button on the toolbar, when you click on which a dialog box appears (Fig. 13). We introduce the original equation and click OK.

Fig. 13. Dialog box for solving equations

As a result, a team will be formed in the working document to solve the equation and the solution found:

Chapter 1 Basics of Work in Computer Mathematics Math Maxima

The command to solve the equations can be set in such a way that you can easily check the decisions found. To do this, it is advisable to use the EV substitution command.

For example, we solve the algebraic equation x 3 + 1 \u003d 0 and perform the verification of the decisions found.

As a result, three roots were obtained. Under the name RESH, we have a list of values \u200b\u200b- the roots of the equation. The elements of the list are in square brackets and separated from one of the other semicol. To each such element of the list, you can contact its number. We use it when checking solutions: we will substitute alternately each of the roots into the original equation.

Using the ALLROOTS (EXPR) command, you can find all the approximate solutions of the algebraic equation. This command can be used if the Solve command could not find the solution to the equation or the solution is obtained too cumbersome, as, for example, for the next equation: (1 + 2 x) 3 \u003d 13.5 (1 + x 5).

So-called Gubina, E.V. Andropov

Using the SOLVE command, you can find solutions of systems of linear algebraic equations. For example, a system of linear equations

Ð x +2 y +3 z +4 k +5 m \u003d 13

2 x + y + 2 z + 3 k + 4 m \u003d 10

2 x + 2 y + z + 2 k + 3 m \u003d 11 can be solved as follows:

2 x + 2 y + 2 z + k + 2 m \u003d 6

ï 2 x +2 y +2 z +2 k + m \u003d 3

1. Save each of the system equations under the names EQ1, EQ2, EQ3, EQ4, EQ5.

2. We find the system solution.

3. Perform the verification of the solution found:

Thus, when substituting the solution obtained in each of the system equations, faithful equality was obtained.

The SOLVE function of the MAXIMA system can solve the linear equations in the event that the solution is not only. Then it resortes to the designations of the type% R_NUMBER to show that an unknown variable is free and can take any values.

To solve systems of nonlinear equations, you can use the algsys command. For example, find the solution of the system of equations



Did you like the article? Share it