📜 ⬆️ ⬇️

Why is Maxima a schoolboy and a student? or "The Problem of a Weightless Bear"

In this post I want to kill several birds with one stone.
First, once again tell people about the free computer algebra system Maxima.
Secondly, to find the weight of the "mystical hare" from an easy task for schoolchildren

Thus, after reading this article, you will learn what Maxima is, for what purposes it can be used, and how to solve the system of linear equations in Maxima,


')

Part One: Why is a student or schoolboy Maxima?



For all the periods of my studies at the stages of school, secondary special or higher education.
None of the teachers did not talk about free applied mathematical programs capable of simplifying the life of a technical specialty student.

For some reason, in the minds of teachers, the best tool for automatic calculations was Microsoft Excel. Both in college and in university, we were asked to do the calculations either on a calculator or in Excel. With that, both college and university were very decent in my environment.

I remember the feeling of euphoria when I accidentally by the will of a friend met Matlab.

I just opened a new world of accessible mathematics. Now I will share it with you.

Why do we need computer algebra systems at all?
According to my personal observations, well, for example, from this article
Math can bring physical suffering
so sadly to admit it, but the average young man is quite
may fall into a stupor at the sight of something more complicated than 2 * 2.

I'll start with a brief review of Maxima.

As mentioned earlier, Maxima is a free computer algebra system.
Maxima has a wide mathematical toolbox.
From simple arithmetic, to symbolic or numerical calculations from the field of higher mathematics (differential equations, integrals, Laplace transforms, Taylor series, and so on ...)
Naturally Maxima also knows how to build graphics.

In contrast to the more venerable, demanding and weighty Matlab and MathCad.
Maxim is not demanding on resources, and most importantly, completely free.

Certainly the above programs perform a wide range of tasks.
I think there is no program that alone could replace all the functions offered by the full package of the same Matlab (with the included symbolic computation module), but now we will talk about the simplest calculations that can be useful to the student.

Moreover, Maxima would rather be more appropriately compared with Maple. The Internet claims that Maxima is an OpenSource analogue of Maple (Maybe so, but I myself can’t say, because Maple hasn’t seen it in its pure form)

You can download Maxima and some documentation for it at maxima.sourceforge.net/en
Naturally there is a version for both Windows and Linux systems.

Maxim is a console program, but there are various graphical interfaces to it. Perhaps the most common of them is WxMaxima.

Maxima is written in Common Lisp. It will be easy for people familiar with this language to master it (and maybe even see how the program functions work). In other matters, people who do not know programming at all are not mastering the basics of Maxima, either.

Not to be unfounded I will give a simple example

we will enter the following expression in maxima

diff (x ^ 3, x, 1);

and as an answer we get

first derivative 3 * x ^ 2.

Everything. Hate table of derivatives (you probably had this) - you can no longer learn! The same is true for integrals: we introduce integrate (cos (x), x); we get: sin (x).

It will look like this:
image

How to do it:
Suppose your hands are burning, you have just set a maxim and want to see at least some result:

in order to calculate the derivative, open WxMaxima
Click on the empty white space with the left mouse button, and copy or type there the diff formula (x ^ 3, x, 1); then press Control + Enter and you will receive calculations for this cell. It should be noted that in Maxima the cells are dependent on each other, so for example if you drive in

(% i1) x: 2;

(% i2) x + 3;

And calculate by pressing control + Enter only in the second cell.
you will get back
(% o2) x + 3;

because the value calculated in the previous cell is not yet known.

Also, if you change the value in the cell (% i1) x: 2; for example on (% i1) x: 4; don't forget to recalculate the cell.

Although of course you can press ctrl + R to recalculate all the cells at once.

And the last tip: Sometimes it is useful to reset the process of your hectic activity in Maxima by choosing the command Maxima-> restart maxima


And so I told you a little about Maxima and am ready to go to the second part of the Article.

Part Two: Solving the system of linear equations in Maxima (the problem of a weightless bear)



Background:

One cloudy autumn day, my colleague Drzugrik walked across the expanses of the Internet and came across this link: nnm.ru/blogs/samovar1/pedagogi-rezvyatsya

After we wiped away the tears of joy and emotion, we all together undertook to solve one of the tasks proposed in this article.

So here's the problem statement.
In general, the task was presented in a graphical way, but I will describe it just in case with the text too:

the fox weighs as much as a five hare weight hare and weight taken together
a wolf weighs as much as a fox and a four-kilo weight taken together
a hare and a fox weigh as much as a wolf and a one kilo weight taken together
A bear weighs as much as a hare fox and a wolf combined.

Picture with task:
Author unknown taken with nnm


So having received the task, we immediately rushed to solve it.

We started with the creation of a system of equations, but then our paths and, most importantly, the results “a little” diverged.

What we just did not work:
and negative mass bears

Fragment of the cartoon Winnie the Pooh

and Hare Mutants, weighing three times more than a wolf

Rayman Raving Rabbids - Ubisoft


A colleague even sent this task to her friend - a teacher of lower grades, but she also suffered a fiasco.

As a result, there was a person among us able to solve this problem.
But due to the fact that he was able to do this alone, the sediment remained and in order to dispel my doubts, I decided to call for help - COMPUTER.

I suggest you first try to find the answer to the problem manually, and only then look under the spoiler

To solve the problem in Maxima the following code was entered:
(% i1) eq1: lisa = zay + 5; eq2: lisa + 4 = volk; eq3: lisa + zay = volk + 1; eq4: medved = volk + lisa + zay;
(% o1) lisa = zay + 5
(% o2) lisa + 4 = volk
(% o3) zay + lisa = volk + 1
(% o4) medved = zay + volk + lisa

this is the input of our system of equations then the second line

(% i2) solve ([eq1, eq2, eq3, eq4], [zay, lisa, volk, medved]);
(% o5) [[zay = 5, lisa = 10, volk = 14, medved = 29]]

it is directly solving the equations

and third line

(% i3) ev ([eq1, eq2, eq3, eq4], [%]);

this is a substitution check

(% o6) [10 = 10.14 = 14.15 = 15.29 = 29]

Everything is quite simple.


So, if you didn’t look under the spoiler, found the solution and want to check it, then you don’t even have to install Maxima on your computer. You can use
WEB-interface at maxima-online.org .

To run on the installed version of WxMaxima, the task file can be downloaded from the people:
narod.ru/disk/63475686001.9c996f295ea0a37cef0241e55a328799/%D0% B7% D0% B0% D0% B4% D0% B0% D1% 87% D0% B0.wxm.html

Of the shortcomings of Maxima, perhaps in my opinion it is possible to single out a not very strong community.
For example, the answer to my question about the reverse Laplace transform, I did not find on the Internet.

Ps I understand that in fact, many Habr readers are probably good at math, so you may not agree with me that people in general are not well aware of math and even wonder how we could find difficulties in such a simple task, but everything relatively. The people around me (and I myself) own the “queen of sciences” very poorly, and most importantly, we make purely human errors through carelessness. Therefore, I hope that this article will help people cope at least with the long-forgotten basics of mathematics.

upd: corrected grammatical errors thanks vasilisc kiselev_dv

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


All Articles