WxMaxima is a graphical user interface (GUI) for the Maxima computer algebra system (CAS). WxMaxima allows one to use all of Maxima’s functions. In addition, it provides convenient wizards for accessing the most commonly used features. This manual describes some of the features that make wxMaxima one of the most popular GUIs for Maxima.
In the open-source domain, big systems are normally split into smaller projects that are easier to handle for small groups of developers. For example a CD burner program will consist of a command-line tool that actually burns the CD and a graphical user interface that allows users to implement it without having to learn about all the command line switches and in fact without using the command line at all. One advantage of this approach is that the developing work that was invested into the command-line program can be shared by many programs: The same CD-burner command-line program can be used as a âsend-to-CDâ-plug-in for a file manager application, for the âburn to CDâ function of a music player and as the CD writer for a DVD backup tool. Another advantage is that splitting one big task into smaller parts allows the developers to provide several user interfaces for the same program.
Система комп’ютерної алгебри (СКА), подібна до Maxima, дуже добре вкладається у цю схему. СКА може надавати логіку до програми-калькулятора із довільною точністю обчислень або може виконувати автоматичні перетворення форму у фоновому режимі для більших систем (наприклад, Sage). Крім того, нею можна користуватися і безпосередньо, як самостійною системою. Доступ до Maxima можна отримати з командного рядка. Втім, часто інтерфейси, подібні до wxMaxima, є набагато ефективнішим способом доступу до програмного забезпечення, особливо для початківців.
Maxima є повноцінною системою комп’ютерної алгебри (СКА). СКА — програма, яка може розв’язувати математичні задачі перетворенням формул і визначенням формули, яка розв’язує задачу, замість простого виведення числової форми результату. Іншими словами, Maxima може слугувати калькулятором, який визначає числові значення змінних, а може давати аналітичні розв’язки. Крім того, у програмі передбачено багато обчислювальних методів для аналізу рівнянь і систем рівнянь, які не може бути розв’язано аналітично.
Extensive documentation for Maxima is available in the internet. Part of this documentation is also available in wxMaximaâs help menu. Pressing the Help key (on most systems the F1 key) causes _wxMaxima_âs context-sensitive help feature to automatically jump to _Maxima_âs manual page for the command at the cursor.
WxMaxima is a graphical user interface that provides the full functionality and flexibility of Maxima. WxMaxima offers users a graphical display and many features that make working with Maxima easier. For example wxMaxima allows one to export any cellâs contents (or, if that is needed, any part of a formula, as well) as text, as LaTeX or as MathML specification at a simple right-click. Indeed, an entire workbook can be exported, either as a HTML file or as a LaTeX file. Documentation for wxMaxima, including workbooks to illustrate aspects of its use, is online at the wxMaxima help site, as well as via the help menu.
Обчислення, які ви наказуєте виконати wxMaxima у фоновому режимі передаються інструментам командного рядка Maxima.
Much of wxMaxima is self-explaining, but some details require attention. This site contains a number of workbooks that address various aspects of wxMaxima. Working through some of these (particularly the “10 minute (wx)Maxima tutorial”) will increase oneâs familiarity with both the content of Maxima and the use of wxMaxima to interact with Maxima. This manual concentrates on describing aspects of wxMaxima that are not likely to be self-evident and that might not be covered in the online material.
Однією із дуже небагатьох речей, які є нестандартними у wxMaxima є те, що дані для Maxima у програмі впорядковано за комірками, які обчислюються (тобто надсилаються до Maxima) лише на запит користувача. При обчисленні комірки усі команди у ній, і лише у ній, обчислюються пакетно. (Попереднє твердження є не зовсім точним: можна позначити набір сусідніх комірок і обчислити їх разом. Крім того, можна наказати Maxima обчислити усі комірки у робочій книзі одразу.) Підхід wxMaxima до надсилання команд на виконання може спочатку видатися незвичним. Втім, він значно спрощує роботу із великими документами (у яких користувач не хоче, щоб програма автоматично вмикала повне переобчислення усього документа у відповідь на будь-яку зміну). Крім того, такий підхід є дуже зручним для усування вад.
Якщо ви почнете вводити якийсь текст у вікні wxMaxima, програма автоматично створить нову комірку робочого аркуша. Тип цієї комірки можна вибрати за допомогою панелі інструментів. Якщо створено комірку з кодом, її вміст може бути надіслано до Maxima. Результат обчислень буде показано під рядком коду. Пару таких команд показано нижче.
On evaluation of an input cell’s contents the input cell Maxima assigns a label to the input (by default shown in red and recognizable by the %i
) by which it can be referenced later in the wxMaxima session. The output that Maxima generates also gets a label that begins with %o
and by default is hidden, except if the user assigns the output a name. In this case by default the user-defined label is displayed. The %o
-style label Maxima auto-generates will also be accessible, though.
Окрім комірок для вхідних даних, у wxMaxima передбачено комірки для документації, комірки зображень, комірки заголовків, комірки глав та комірки розділів. У кожної комірки є власний буфер скасовування дій, тому дуже просто діагностувати проблеми, змінюючи значення у комірках і поступово скасовуючи внесені зміни у різних комірках. Крім того, у самого робочого аркуша також є власний буфер скасовування дій, яким може скористатися для скасовування редагувань у комірках, додавання і вилучення комірок.
На рисунку нижче показано різні типи комірок (комірки заголовків, комірки розділів, комірки підрозділів, текстові комірки, комірки введення-виведення та комірки зображення).
Робочий аркуш складається з комірок. У wxMaxima передбачено такі типи комірок:
Типовою поведінкою wxMaxima при введенні тексту є автоматичне створення комірки формули. Комірки інших типів можна створити за допомогою меню «Комірка», натискання клавіатурних скорочень для пунктів з цього меню або за допомогою спадного списку на панелі інструментів. Після створення нематематичної комірки усе, що введено у файл, вважатиметься текстом.
Текст коментаря (у стилі C) може бути частиною математичної комірки ось так: /* Цей коментар буде проігноровано Maxima */
«/*
» позначає початок коментаря, «*/
» — його кінець.
Якщо користувач намагається позначити ціле речення, текстовий процесор намагається розширити позначений фрагмент так, щоб він автоматично завершувався на початку і наприкінці слів. Так само, wxMaxima, якщо позначено декілька комірок, доповнюватиме позначений фрагмент до меж комірок.
Нестандартною особливістю є те, що у wxMaxima передбачено гнучку систему перетягування зі скиданням, у якій визначено два типи курсорів. wxMaxima автоматично перемикатиметься між ними, коли у цьому виникатиме потреба:
When you start wxMaxima, you will only see the blinking horizontal cursor. If you start typing, a math cell will be automatically created and the cursor will change to a regular vertical one (you will see a right arrow as “prompt”, after the Math cell is evaluated (CTRL+ENTER), you will see the labels, e.g. (%i1)
, (%o1)
).
Ви можете створити комірки іншого типу (за допомогою меню «Комірка»), можливо, комірку заголовка та текстову комірку, яка описуватиме виконану математичну дію, коли почнете створення вашого робочого аркуша.
Якщо ви переходитимете між різними комірками програма також показуватиме горизонтальний курсор, що блиматиме. На місці курсора ви можете вставити комірку до робочого аркуша (математичну комірку простим введенням формули або комірку іншого типу за допомогою меню).
The command in a code cell is executed once by pressing CTRL+ENTER, SHIFT+ENTER or the ENTER key on the keypad. The wxMaxima default is to enter commands when either CTRL+ENTER or SHIFT+ENTER is entered, but wxMaxima can be configured to execute commands in response to ENTER.
WxMaxima contains an autocompletion feature that is triggered via the menu (Cell/Complete Word) or alternatively by pressing the key combination CTRL+SPACE. The autocompletion is context-sensitive. For example, if activated within a unit specification for ezUnits it will offer a list of applicable units.
Besides completing a file name, a unit name, or the current command or variable name, the autocompletion is able to show a template for most of the commands indicating the type (and meaning) of the parameters this program expects. To activate this feature press SHIFT+CTRL+SPACE or select the respective menu item (Cell/Show Template).
Комп’ютери традиційно зберігають символи у форматі 8-бітових значень. Це уможливлює існування наборів, що складаються лише із 256 різних символів. У такий набір може бути включено усі літери, цифри та символи керування (завершення передавання, кінець рядка, лінії та кутики для малювання меню тощо) майже будь-якої європейської мови.
Втім, у більшості мов до вибраної кодової сторінки із 256 символів не можна включити додаткові символи, зокрема літери грецької абетки, які широко використовуються у математичних формулах. Щоб подолати обмеження подібного типу, було винайдено Юнікод — кодування, яке працює для латиниці, але використовує набагато більше за 256 символів.
Maxima уможливлює використання символів Юнікоду, якщо програму було зібрано за допомогою компілятора Lisp, у якому передбачено підтримку Юнікоду або такого, який є нейтральним щодо кодування символів. Оскільки, хоча б одна з цих вимог, зазвичай, справджується, у wxMaxima реалізовано спосіб введення грецьких символів з клавіатури:
key | Greek letter | key | Greek letter | key | Greek letter |
---|---|---|---|---|---|
a | alpha | i | iota | r | rho |
b | beta | k | kappa | s | sigma |
g | gamma | l | lambda | t | tau |
d | delta | m | mu | u | upsilon |
e | epsilon | n | nu | f | phi |
z | zeta | x | xi | c | chi |
h | eta | om | omicron | y | psi |
q | theta | p | pi | o | omega |
A | Alpha | I | Iota | R | Rho |
B | Beta | K | Kappa | S | Sigma |
G | Gamma | L | Lambda | T | Tau |
D | Delta | M | Mu | U | Upsilon |
E | Epsilon | N | Nu | P | Phi |
Z | Zeta | X | Xi | C | Chi |
H | Eta | Om | Omicron | Y | Psi |
T | Theta | P | Pi | O | Omega |
You can also use the “Greek letters”-sidebar to enter the Greek letters.
Attention: Lookalike characters > > Several Latin letters look like the Greek letters, e.g. the Latin letter “A” > and the Greek letter “Alpha”. Although they look identical, they are two > different Unicode characters, represented by different Unicode code points (numbers). > > This might be problematic, if you assign a value to the Variable A and later use the Greek letter Alpha to do something with this variable, especially on printouts. > For the greek letter my (which is also used as prefix for micro) there are also two > different unicode code points. > > The “Greek letters”-sidebar therefore has the option, that lookalike characters > are not available (which can be changed using a right-click menu).
У той самий спосіб можна вводити різноманітні математичні символи:
keys to enter | mathematical symbol |
---|---|
hbar | Planck’s constant: a h with a horizontal bar above it |
Hbar | a H with a horizontal bar above it |
2 | squared |
3 | to the power of three |
/2 | 1/2 |
partial | partial sign (the d of dx/dt) |
integral | integral sign |
sq | square root |
ii | imaginary |
ee | element |
in | in |
impl implies | implies |
inf | infinity |
empty | empty |
TB | big triangle right |
tb | small triangle right |
and | and |
or | or |
xor | xor |
nand | nand |
nor | nor |
equiv | equivalent to |
not | not |
union | union |
inter | intersection |
subseteq | subset or equal |
subset | subset |
notsubseteq | not subset or equal |
notsubset | not subset |
approx | approximately |
propto | proportional to |
neq != /= or # | not equal to |
+/- or pm | a plus/minus sign |
<= or leq | equal or less than |
>= or geq | equal or greater than |
<< or ll | much less than |
>> or gg | much greater than |
qed | end of proof |
nabla | a nabla operator |
sum | sum sign |
prod | product sign |
exists | there exists sign |
nexists | there is no sign |
parallel | a parallel sign |
perp | a perpendicular sign |
leadsto | a leads to sign |
-> | a right arrow |
–> | a long right arrow |
You can also use the “Symbols”-sidebar to enter these Mathematical symbols.
If a special symbol isnât in the list, it is possible to input arbitrary Unicode characters by pressing ESC [number of the character (hexadecimal)] ESC. Additionally the “symbols” sidebar has a right-click menu that allow to display a list of all available unicode symbols one can add to this toolbar or to the worksheet.
ESC61ESC therefore results in an a
.
Please note that most of these symbols (notable exceptions are the logic symbols) do not have a special meaning in Maxima and therefore will be interpreted as ordinary characters. If Maxima is compiled using a Lisp that doesnât support Unicode characters they might cause an error message.
It may be the case that e.g. Greek characters or mathematical symbols are not included in the selected font, then they can not be displayed. To solve that problem, select other fonts (using: Edit -> Configure -> Style).
wxMaxima will replace several Unicode characters with their respective Maxima expressions, e.g. “²” with “^2”, “³” with “^3”, the square root sign with the function sqrt()
, the (mathematical) Sigma sign (which is not the same unicode character as the corresponding greek letter) with sum()
, etc.
Доступ до найважливіших команд Maxima або речей, подібних до таблиці змісту, вікон із діагностичними повідомленнями або журналу останніх виданих команд можна отримати за допомогою бічних панелей. Увімкнути бічні панелі можна за допомогою меню «Перегляд». Панелі можна пересувати як всередині вікна wxMaxima, так і ззовні. Ще однією корисною панеллю є панель введення грецьких літер за допомогою вказівника миші.
За допомогою бічної панелі «Зміст» можна збільшити або зменшити рівень заголовка: просто клацніть на заголовку правою кнопкою миші і виберіть наступний більший або менший рівень заголовка.
Several word processors and similar programs either recognize MathML input and automatically insert it as an editable 2D equation - or (like LibreOffice) have an equation editor that offers an âimport MathML from clipboardâ feature. Others support RTF maths. WxMaxima, therefore, offers several entries in the right-click menu.
У wxMaxima ви зможете скористатися стандартними варіантами Markdown, які не суперечать математичним позначенням. Одним із елементів розмітки є невпорядковані списки.
Ordinary text
* One item, indentation level 1
* Another item at indentation level 1
* An item at a second indentation level
* A second item at the second indentation level
* A third item at the first indentation level
Ordinary text
WxMaxima will recognize text starting with >
chars as block quotes:
Ordinary text > quote quote quote quote > quote quote quote quote > quote quote quote quote Ordinary text
WxMaxima’s TeX and HTML output will also recognize =>
and replace it by the corresponding Unicode sign:
cogito => sum.
Other symbols the HTML and TeX export will recognize are <=
and >=
for comparisons, a double-pointed double arrow (<=>
), single-headed arrows (<->
, ->
and <-
) and +/-
as the respective sign. For TeX output also <<
and >>
are recognized.
Більшість клавіатурних скорочень можна знайти у тексті відповідних меню. Оскільки їх взято з тексту меню і, отже, може бути змінено під час перекладу wxMaxima так, щоб вони відповідали потребам користувачів локалізованих клавіатур, ми не наводимо їх у цьому підручнику. Втім, декілька клавіатурних скорочень все ж не документовано у меню:
Якщо текстову комірку буде розпочато з TeX:
у експортованих у форматі TeX даних буде буквально відтворено текст, який вказано після позначки TeX:
. За допомогою цієї можливості можна використовувати розмітку TeX у робочій книзі wxMaxima.
Матеріал, який було отримано під час сеансу роботи у wxMaxima може бути збережено для наступного використання у три способи:
.mac
files are ordinary text files that contain Maxima commands. They can be read using _Maxima_âs batch()
or load()
command or _wxMaxima_âs File/Batch File menu entry.
Один з прикладів наведено нижче. Quadratic.mac
визначає функцію і після цього створює креслення за допомогою wxdraw2d()
. Далі, буде виведено вміст файла Quadratic.mac
і виконано обчислення нової визначеної функції f()
.
batch()
Увага! Хоча назва файла Quadratic.mac
містить звичайний для Maxima суфікс (.mac
), прочитати дані з нього зможе лише wxMaxima, оскільки команда wxdraw2d()
є wxMaxima-розширенням до Maxima.
You can be use .mac
files for writing your own library of macros. But since they donât contain enough structural information they cannot be read back as a wxMaxima session.
.wxm
files contain the worksheet except for Maxima’s output. On Maxima versions >5.38 they can be read using Maxima’s load()
function just as .mac files can be. With this plain-text format, it sometimes is unavoidable that worksheets that use new features are not downwards-compatible with older versions of wxMaxima.
This is just a plain text file (you can open it with a text editor), containing the cell contents as some special Maxima comments.
It starts with the following comment:
/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/ /* [ Created with wxMaxima version 24.02.2_DevelopmentSnapshot ] */
And then the cells follow, encoded as Maxima comments, e.g. a section cell:
/* [wxMaxima: section start ]
Title of the section
[wxMaxima: section end ] */
or (in a Math cell the input is of course not commented out (the output is not saved in a wxm
file)):
/* [wxMaxima: input start ] */
f(x):=x^2+1$
f(2);
/* [wxMaxima: input end ] */
Images are Base64 encoded with the image type as first line):
/* [wxMaxima: image start ]
jpg
[very chaotic looking character sequence]
[wxMaxima: image end ] */
A page break is just one line containing:
/* [wxMaxima: page break ] */
And folded cells marked by:
/* [wxMaxima: fold start ] */
...
/* [wxMaxima: fold end ] */
У цьому заснованому на XML форматі файлів зберігається увесь робочий аркуш, включно із даними щодо масштабу та списком спостереження. Цей формат файлів є рекомендованим.
Для деяких типових змінних налаштувань у wxMaxima передбачено два способи налаштовування:
Частота кадрів анімації, яка використовуватиметься для нових анімацій, зберігається у змінній wxanimate_framerate
. Початкове значення цієї змінної, яке міститиметься у новому робочому аркуші, можна змінити за допомогою діалогового вікна налаштовування.
Після наступного запуску креслення, які вбудовано до робочого аркуша, буде створено з цим розміром, якщо значення wxplot_size
не було змінено maxima.
In order to set the plot size of a single graph only use the following notation can be used that sets a variableâs value for one command only:
wxdraw2d(
explicit(
x^2,
x,-5,5
)wxplot_size=[480,480]$ ),
За допомогою цього пункту можна увімкнути дві речі:
Якщо позначено цей пункт, файл, у якому зберігається робочий аркуш, буде перезаписано лише за запит користувача. Втім, у випадку аварії, втрати живлення тощо, у каталозі тимчасових даних завжди лишатиметься резервна копія.
Якщо не встановлено цей параметр, wxMaxima поводиться подібно до сучасної програми для мобільних телефонів:
If you are using Unix/Linux, the configuration information will be saved in a file .wxMaxima
in your home directory (if you are using wxWidgets < 3.1.1), or .config/wxMaxima.conf
((XDG-Standard) if wxWidgets >= 3.1.1 is used). You can retrieve the wxWidgets version from the command wxbuild_info();
or by using the menu option Help->About. wxWidgets is the cross-platform GUI library, which is the base for wxMaxima (therefore the wx
in the name). (Since the filename starts with a dot, .wxMaxima
or .config
will be hidden).
Якщо ви користуєтеся Windows, налаштування буде збережено у реєстрі. Записи wxMaxima можна знайти у цій гілці: HKEY_CURRENT_USER\Software\wxMaxima
WxMaxima is primarily a graphical user interface for Maxima. As such, its main purpose is to pass along commands to Maxima and to report the results of executing those commands. In some cases, however, wxMaxima adds functionality to Maxima. _WxMaxima_âs ability to generate reports by exporting a workbookâs contents to HTML and LaTeX files has been mentioned. This section considers some ways that wxMaxima enhances the inclusion of graphics in a session.
wxsubscripts
визначає, чи wxMaxima виконуватиме автоматичне перетворення нижніх індексів у назвах змінних (і як вона це робитиме):
Якщо має значення false
, функціональну можливість буде вимкнено, wxMaxima не виконуватиме автоматичного перетворення частини назв змінної після символу підкреслення.
Якщо встановлено значення all
, усе після символу підкреслення буде перетворено на нижній індекс.
Якщо встановлено значення true
для wxsubscripts
, назви змінних у форматі x_y
буде показано як літеру із нижнім індексом, якщо
x
or y
is a single letter or - y
is an integer (can include more than one character).If the variable name doesnât match these requirements, it can still be declared as “to be subscripted” using the command wxdeclare_subscript(variable_name);
or wxdeclare_subscript([variable_name1,variable_name2,...]);
Declaring a variable as subscripted can be reverted using the following command: wxdeclare_subscript(variable_name,false);
You can use the menu “View->Autosubscript” to set these values.
Команди, які виконуються довго, можуть надавати користувачам інформацію на смужці стану. Цю інформацію буде замінено на будь-яку нову інформацію, яку програма надсилатиме туди (це надає змогу використовувати смужку стану як індикатор поступу), і буде вилучено, щойно буде завершено виконання поточної команди, яку надіслано до Maxima. Команду wxstatusbar()
можна безпечно використовувати навіть у бібліотеках, які може бути використано у звичайній Maxima (без wxMaxima): якщо wxMaxima немає, команда wxstatusbar()
просто не оброблятиметься.
for i:1 thru 10 do (
/* Tell the user how far we got */
wxstatusbar(concat("Pass ",i)),
/* (sleep n) is a Lisp function, which can be used */
/* with the character "?" before. It delays the */
/* program execution (here: for 3 seconds) */
sleep(3)
? )$
Креслення (яке фундаментально пов’язано із графікою) є місцем, де графічний інтерфейс користувача має надавати якісь додаткові можливості до оригінальної програми.
Maxima normally instructs the external program gnuplot to open a separate window for every diagram it creates. Since many times it is convenient to embed graphs into the worksheet instead wxMaxima provides its own set of plot functions that donât differ from the corresponding maxima functions save in their name: They are all prefixed by a âwxâ.
The following plotting functions have wx-counterparts:
wxMaxima’s plot function | Maxima’s plot function |
---|---|
wxplot2d() |
plot2d |
wxplot3d() |
plot3d |
wxdraw2d() |
draw2d |
wxdraw3d() |
draw2d |
wxdraw() |
draw |
wximplicit_plot() |
implicit_plot |
wxhistogram() |
histogram |
wxscatterplot() |
scatterplot |
wxbarsplot() |
barsplot |
wxpiechart() |
piechart |
wxboxplot() |
boxplot |
If a wxm
-file is read by (console) Maxima, these functions are ignored (and printed as output, as other unknown functions in Maxima).
Як ми вже згадували вище, діалогове вікно налаштовування надає змогу змінити типові розміри креслень. Унаслідок застосування цього способу змінюється початкове значення wxplot_size
. Підпрограми створення креслень wxMaxima враховують це значення, яке визначає розмір креслення у пікселях. Це значення завжди можна отримати або використати для встановлення розмірів наступних креслень:
wxplot_size:[1200,800]$
wxdraw2d(
explicit(
sin(x),
x,1,10
) )$
Якщо потрібно змінити розміри лише одного креслення, у Maxima передбачено канонічний спосіб зміни атрибута лише для поточної комірки. У цьому випадку до команди wxdraw2d( ) додається специфікація wxplot_size = [значення1, значення2], яка не є частиною команди wxdraw2d.
wxdraw2d(
explicit(
sin(x),
x,1,10
)wxplot_size=[1600,800]$ ),
Встановлення розміру вбудованого креслення за допомогою wxplot_size
працює для вбудованих креслень, які використовують, наприклад, команди wxplot
, wxdraw
, wxcontour_plot
і wximplicit_plot
, і для вбудованих анімацій, які використовують команди with_slider_draw
і wxanimate
.
Gnuplot doesnât seem to provide a portable way of determining whether it supports the high-quality bitmap output that the Cairo library provides. On systems where gnuplot is compiled to use this library the pngCairo option from the configuration menu (that can be overridden by the variable wxplot_pngcairo
) enables support for antialiasing and additional line styles. If wxplot_pngCairo
is set without gnuplot supporting this the result will be error messages instead of graphics.
Якщо креслення було створено за допомогою команд типу wxdraw
(у wxplot2d
і wxplot3d
підтримки цієї можливості не передбачено), і розмір файла базового проєкту gnuplot не є надто великим, wxMaxima пропонує контекстне меню, за допомогою якого можна відкрити креслення у інтерактивному вікні gnuplot.
plot
windowsУ MS Windows, якщо у змінній Maxima gnuplot_command
замінити «gnuplot» на «wgnuplot», gnuplot запропонує можливість відкрити вікно консолі, у якому ви зможете вводити команди gnuplot. На жаль, вмикання цієї можливості призводить до того, що gnuplot на короткий період «викрадає» фокусування клавіатури кожного разу, коли готується креслення.
На просторових креслення доволі важко читати кількісні дані. Альтернативним рішенням є прив’язка третього параметра до коліщатка миші. Команда with_slider_draw
є версією wxdraw2d
, яка готує декілька креслень і надає змогу перемикатися між ними пересуванням повзунка у верхній частині вікна. WxMaxima надає змогу експортувати анімацію у форматі анімації gif.
Першими двома аргументами with_slider_draw
є назва змінної, яка покроково змінюватиметься між кресленнями, і список значень цієї змінної. Наступними аргументами є звичайні аргументи wxdraw2d
:
with_slider_draw(
f,[1,2,3,4,5,6,7,10],
title=concat("f=",f,"Hz"),
explicit(
sin(2*%pi*f*x),
x,0,1
grid=true
), );
Доступ до тих самих можливостей для просторових креслень можна отримати за допомогою функції with_slider_draw3d
, яка надає можливість обертати просторові креслення:
wxanimate_autoplay:true;
wxanimate_framerate:20;
with_slider_draw3d(
makelist(i,i,1,360,3),
α,title=sconcat("α=",α),
surface_hide=true,
contour=both,
view=[60,α],
explicit(
sin(x)*sin(y),
x,-Ï,Ï,
y,-Ï,Ï
) )$
Якщо важливою є загальна форма креслення, може бути достатнім трошки пересунути креслення з метою зробити його просторову природу інтуїтивно зрозумілою:
wxanimate_autoplay:true;
wxanimate_framerate:20;
with_slider_draw3d(
t,makelist(i,i,0,2*Ï,.05*Ï),
title=sconcat("α=",α),
surface_hide=true,
contour=both,
view=[60,30+5*sin(t)],
explicit(
sin(x)*y^2,
x,-2*Ï,2*Ï,
y,-2*Ï,2*Ï
) )$
Для тих, хто знайомий більше з plot
, аніж з draw
, другий набір функцій:
with_slider
and - wxanimate
.Зазвичай, анімації відтворюються і експортуються із частотою кадрів, яку можна вибрати у налаштуваннях wxMaxima. Щоб встановити швидкість відтворення окремої анімації, можна скористатися змінною wxanimate_framerate
:
wxanimate(a, 10,
sin(a*x), [x,-5,5]), wxanimate_framerate=6$
Функції анімації використовують команду maxima makelist
і тому мають спільну ваду — значення змінної повзунка замінюється на вираз, лише якщо змінна є безпосередньо видимою у виразі. Тому такий приклад не працюватиме:
f:sin(a*x);
with_slider_draw(
a,makelist(i/2,i,1,10),
title=concat("a=",float(a)),
grid=true,
explicit(f,x,0,10)
)$
If Maxima is explicitly asked to substitute the sliderâs value plotting works fine instead:
f:sin(a*x);
with_slider_draw(
b,makelist(i/2,i,1,10),
title=concat("a=",float(b)),
grid=true,
explicit(
subst(a=b,f),
x,0,10
) )$
Хоча wxMaxima не надає доступу до цієї можливості, ця функція Maxima (у конфігураціях, де передбачено її підтримку) іноді є дуже зручною. Наведений нижче приклад походить із допису Маріо Родрігеса (Mario Rodriguez) у списку листування Maxima:
load(draw);
/* Parabola in window #1 */
draw2d(terminal=[wxt,1],explicit(x^2,x,-1,1));
/* Parabola in window #2 */
draw2d(terminal=[wxt,2],explicit(x^2,x,-1,1));
/* Paraboloid in window #3 */
draw3d(terminal=[wxt,3],explicit(x^2+y^2,x,-1,1,y,-1,1));
Також можна накреслити декілька креслень в одному вікні:
wxdraw(
gr2d(
key="sin (x)",grid=[2,2],
explicit(sin(x),x,0,2*%pi)),
gr2d(
key="cos (x)",grid=[2,2],
explicit(cos(x),x,0,2*%pi))
);
Бічна панель «Накреслити за допомогою Draw» приховує простий генератор коду, який уможливлює створення сцен, які використовують певну гнучкість пакунка draw, з яким постачається maxima.
Створює каркас команди draw()
, яка малює плоску сцену. Цю сцену пізніше може бути заповнено за допомогою команд, які створюють вміст сцени, наприклад, за допомогою кнопок у рядках під кнопкою «Плоский».
Однією з корисних можливостей кнопки «Плоский» є те, що вона надає змогу налаштувати сцену як анімацію, у якій змінна (типовою змінною є t) має різне значення для кожного з кадрів: часто динамічне плоске креслення надає змогу простіше інтерпретувати дані за ті самі у формі нерухомого просторового креслення.
Створює каркас команди draw()
, яка малює просторову сцену. Якщо не налаштовано ні двовимірну, ні тривимірну сцену, усі інші кнопки налаштовуватимуть двовимірну сцену, яка містить команду, яку створює кнопка.
Додає стандартне креслення виразу, подібного до sin(x)
, x*sin(x)
або x^2+2*x-4
до команди draw()
, у якій зараз перебуває курсор. Якщо команди draw немає, буде створено двовимірну сцену із кресленням. Кожну сцену можна заповнити довільною кількістю креслень.
Спробувати знайти усі точки, у яких справджуються вирази, подібні до y=sin(x)
, y*sin(x)=3
або x^2+y^2=4
, і накреслити криву-результат за допомогою команди draw()
у поточній позиції курсора. Якщо команди draw виявлено не буде, буде створено плоску сцену із кресленням.
Покроково проходить змінну від нижньої межі до верхньої межі і використовує два виразу, подібні до t*sin(t)
і t*cos(t)
для створення координат точок x, y (у просторових кресленнях використовується і z) кривої, які буде передано до поточної команди draw.
Малює точки, які, якщо вказано, буде з’єднано. Координати точок буде взято зі списку списків, двовимірного масиву або списку масивів для кожної з осей.
Малює заголовок у верхній частині діаграми,
Налаштовує вісі.
(Лише для просторових креслень) Додає контурні лінії, подібні до тих, які можна знайти на карті висот, до команд креслення, які йдуть за нею у поточній команді «draw()» і/або до площини основи діаграми. Крім того, цей майстер надає змогу повністю пропустити малювання кривих і показати лише контурне креслення.
Додає запис умовних позначень із назвою наступного креслення на панель умовних позначень діаграми. Порожнє значення назви вимикає створення записів умовних позначень для наступних креслень.
Встановлює колір лінії для наступних креслень у поточній команді малювання.
Встановлює колір заповнення для наступних креслень у поточній команді малювання.
Відкриває допоміжне вікно, за допомогою якого можна налаштувати лінії сітки.
Надає змогу вибрати адекватну позицію у компромісному питанні «швидкість чи точність?», яке є частиною будь-якої програми для креслення.
If the .wxmx
file format is being used embedding files in a wxMaxima project can be done as easily as per drag-and-drop. But sometimes (for example if an imageâs contents might change later on in a session) it is better to tell the file to load the image on evaluation:
maxima show_image("man.png");
У діалоговому вікні налаштовування wxMaxima передбачено можливість редагування двох файлів із командами, які виконуються під час запуску програми:
maxima-init.mac
- one file of additional commands that are executed if wxMaxima is starting Maxima: wxmaxima-init.mac
Ці файли зберігаються у каталозі користувача Maxima (зазвичай, каталозі maxima
у Windows, .maxima/
у інших системах) у домашній теці користувача. Розташування файлів можна визначити за допомогою такої команди: maxima_userdir;
wxsubscripts
tells Maxima if it should convert variable names that contain an underscore (R_150
or the like) into subscripted variables. See wxdeclare_subscript
for details which variable names are automatically converted. - wxfilename
: This variable contains the name of the file currently opened in wxMaxima. - wxdirname
: This variable contains the name the directory, in which the file currently opened in wxMaxima is. - wxplot_pngcairo
tells whether wxMaxima tries to use _gnuplot_âs pngcairo terminal that provides more line styles and a better overall graphics quality. - wxplot_size
defines the resolution of embedded plots. - wxchangedir
: On most operating systems wxMaxima automatically sets _Maxima_âs working directory to the directory of the current file. This allows file I/O (e.g. by read_matrix
) to work without specifying the whole path to the file that has to be read or written. On Windows this feature sometimes causes error messages and therefore can be set to false
from the config dialogue. - wxanimate_framerate
: The number of frames per second the following animations have to be played back with. - wxanimate_autoplay
: Automatically play animations by default? - wxmaximaversion
: Returns the version number of wxMaxima. - wxwidgetsversion
: Returns the wxWidgets version wxMaxima is using.The function table_form()
displays a 2D list in a form that is more readable than the output from _Maxima_âs default output routine. The input is a list of one or more lists. Like the “print” command, this command displays output even when ended with a dollar sign. Ending the command with a semicolon results in the same table along with a “done” statement.
table_form(
[1,2],
[3,4]
[
] )$
Як показує наступний приклад, списки, які зібрано командою table_form
, можна створювати до виконання команди.
Крім того, оскільки матриця — список списків, матриці можна перетворювати на таблиці у подібний же спосіб.
У wxMaxima передбачено декілька функцій, які збирають дані щодо поточної системи для звітування щодо вад:
wxbuild_info()
gathers information about the currently running version of wxMaxima - wxbug_report()
tells how and where to file bugsКоманда box()
Maxima призводити до того, що wxMaxima виводить її аргумент червоним кольором, якщо другим аргументом команди є текст highlight
.
WxMaxima’s help menu provides access to the Maxima and wxMaxima manual, tips, some example worksheets and in command line Maxima included demos (the demo()
command).
Please notice, that the demos write:
~~~ At the ’_’ prompt, type ‘;’ and
That is valid for command-line Maxima, however in wxMaxima by default it is necessary to continue the demonstration with: CTRL+ENTER
(That can be configured in the Configure->Worksheet->“Hotkeys for sending commands to Maxima” menu.)
Since Maxima (the program that does the actual mathematics) and wxMaxima (providing the easy-to-use user interface) are separate programs that communicate by the means of a local network connection. Therefore the most probable cause is that this connection is somehow not working. For example, a firewall could be set up in a way that it doesnât just prevent unauthorized connections from the internet (and perhaps intercept some connections to the internet, too), but also blocks inter-process-communication inside the same computer. Note that since Maxima is being run by a Lisp processor the process communication that is blocked does not necessarily have to be named “maxima”. Common names of the program that opens the network connection would be sbcl, gcl, ccl, lisp.exe, or similar names.
On Unix computers another possible reason would be that the loopback network that provides network connections between two programs in the same computer isnât properly configured.
На внутрішньому рівні більшість сучасних форматів на основі XML є звичайними файлами zip. wxMaxima не увімкнула стискання, що робить вміст файлів .wxmx
придатним до перекладу у будь-якому текстовому редакторі.
If the zip signature at the end of the file is still intact after renaming a broken .wxmx
file to .zip
most operating systems will provide a way to extract any portion of the information that is stored inside it. This can be done when there is a need of recovering the original image files from a text processor document. If the zip signature isnât intact that does not need to be the end of the world: If wxMaxima during saving detected that something went wrong there will be a .wxmx~
file whose contents might help.
And even if there isnât such a file: The .wxmx
file is a container format and the XML portion is stored uncompressed. It it is possible to rename the .wxmx
file to a .txt
file and to use a text editor to recover the XML portion of the file’s contents (it starts with <?xml version="1.0" encoding="UTF-8"?>
and ends with </wxMaximaDocument>
. Before and after that text you will see some unreadable binary contents in the text editor).
Якщо текстовий файл, що містить ці дані (наприклад скопійовані і вставлені як текст до звичайного файла), збережено як файл із суфіксом назви .xml, wxMaxima відомий спосіб відновлення тексту документа з цього файла.
has finished
Зазвичай, wxMaxima очікує, доки буде передано усю двовимірну формулу, перш ніж починає виводити дані. Таким чином заощаджується час, який могло б бути витрачено на постійні спроби вивести незавершену формулу. Втім, існує команда disp
, яка може виводити діагностичні дані негайно, не очікуючи на завершення поточної команди Maxima:
for i:1 thru 10 do (
disp(i),
/* (sleep n) is a Lisp function, which can be used */
/* with the character "?" before. It delays the */
/* program execution (here: for 3 seconds) */
sleep(3)
? )$
Це означає, що wxMaxima не вдалося прочитати файл, який Maxima мала наказати створити gnuplot.
Можливими причинами цієї помилки є такі:
implicit_plot
but this package was not loaded by _Maxima_âs load()
command before trying to plot. - Maxima tried to do something the currently installed version of gnuplot isnât able to understand. In this case, a file ending in .gnuplot
located in the directory, which _Maxima_âs variable maxima_userdir
is pointing, contains the instructions from Maxima to gnuplot. Most of the time, this fileâs contents therefore are helpful when debugging the problem. - Gnuplot was instructed to use the pngCairo library that provides antialiasing and additional line styles, but it was not compiled to support this possibility. Solution: Uncheck the “Use the Cairo terminal for the plot” checkbox in the configuration dialog and donât set wxplot_pngCairo
to true from Maxima. - Gnuplot didnât output a valid .png
file.Значення змінної повзунка, типово, буде підставлено до виразу для креслення, лише якщо воно є видимим у цьому виразі. Використання команди subst
, яка підставляє змінну повзунка до рівняння, яке слід накреслити, має усунути проблему. Наприкінці розділу Вбудовування анімацій до робочого аркуша наведено приклад.
У програмі передбачено окремі функції скасовування дій для дій з комірками і для дій усередині комірок, тому така подія має бути дуже рідкісною. Якщо таке все ж сталося, існує декілька способів відновити дані:
maxima playback();
One possible reason is that Maxima cannot be found in the location that is set in the âMaximaâ tab of _wxMaxima_âs configuration dialog and therefore wonât run at all. Setting the path to a working Maxima binary should fix this problem.
It is theoretically possible that wxMaxima doesnât realize that Maxima has finished calculating and therefore never gets informed it can send new data to Maxima. If this is the case âTrigger evaluationâ might resynchronize the two programs.
Компілятор Lisp SBCL типово позначається із обмеженням на використання пам’яті, яке надає змогу запускати його на слабких комп’ютерах. При компіляції великих пакунків програмного забезпечення, зокрема lapack, або роботі з великими списками або формулами це обмеження може заважати нормальній роботі. Щоб зняти обмеження, SBCL можна передати параметр --dynamic-space-size
, який вказуватиме SBCL, скільки мегабайтів пам’яті слід зарезервувати. У 32-бітовому Windows-SBCL можна зарезервувати до 999 мегабайтів. У 64-бітовій версії SBCL, яку запущено у Windows, можна наказати програмі використовувати понад близько 1280 мегабайтів, чого має бути достатньо для збирання lapack.
One way to provide Maxima (and thus SBCL) with command line parameters is the “Additional parameters for Maxima” field of _wxMaxima_âs configuration dialogue.
Встановлення пакунка ibus-gtk
має усунути проблему. Докладніше про це на сторінці (https://bugs.launchpad.net/ubuntu/+source/wxwidgets3.0/+bug/1421558).
Якщо вашу Maxima засновано на SBCL, слід додати такі рядки до вашого файла .sbclrc
:
commonlisp (setf sb-impl::*default-external-format* :utf-8)
Тека, у якій має бути розташовано цей файл залежить від системи та способу встановлення. Втім, будь-яка Maxima на основі SBCL, яка вже виконала обчислення у якійсь комірці протягом поточного сеансу, без проблем повідомить, де його можна знайти, у відповідь на таку команду:
:lisp (sb-impl::userinit-pathname)
There seem to be issues with the Wayland Display Server and wxWidgets. WxMaxima may be affected, e.g. that sidebars are not moveable.
You can either disable Wayland and use X11 instead (globally) or just tell, that wxMaxima should use the X Window System by setting: GDK_BACKEND=x11
E.g. start wxMaxima with:
GDK_BACKEND=x11 wxmaxima
once?
До робочого аркуша вбудовуються файли .png. wxMaxima дозволяє користувачу вказати, де має бути створено ці файли:
wxdraw2d(
file_name="test",
explicit(sin(x),x,1,10)
);
Якщо має бути використано якийсь інший формат зображень, простіше створити зображення окремо, а потім імпортувати їх до робочого аркуша:
load("draw");
pngdraw(name,[contents]):=
(draw(
append(
[terminal=pngcairo,
dimensions=wxplot_size,
file_name=name
],contents
)
),show_image(printf(false,"~a.png",name))
);pngdraw2d(name,[contents]):=
pngdraw(name,gr2d(contents));
pngdraw2d("Test",
explicit(sin(x),x,1,10)
);
Не безпосередньо, за допомогою Maxima. Але для цього є команди gnuplot:
wxdraw2d(
proportional_axis=xy,
explicit(sin(x),x,1,10)
wxplot_size=[1000,1000]; ),
messages like
```
1 HIToolbox 0x00007ff80cd91726 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 102 2 HIToolbox 0x00007ff80cd912b8 _ZN15MenuBarInstance14EnableAutoShowEv + 52 3 HIToolbox 0x00007ff80cd35908 SetMenuBarObscured + 408 … ```
This might be an issue with the operating system. Disable the hiding of the menu bar (SystemSettings => Desktop & Dock => Menu Bar) might solve the issue. See wxMaxima issue #1746 for more information.
Так. Скористайтеся пакунком LaTeX «geometry» для визначення розмірів полів.
You can add the following line to the LaTeX preamble (for example by using the respective field in the config dialogue (“Export”->“Additional lines for the TeX preamble”), to set borders of 1cm):
latex \usepackage[left=1cm,right=1cm,top=1cm,bottom=1cm]{geometry}
Якщо бібліотека wxWidgets є достатньо новою, wxMaxima автоматично працюватиме у темному режимі, якщо у ньому працює решта операційної системи. Сам робочий аркуш типово має світле тло. Втім, колір тла можна змінити. Крім того, ви можете скористатися пунктом меню «Перегляд/Інвертувати яскравість робочого аркуша», за допомогою якого можна швидко перетворити робочий аркуш з темного на світлий, і навпаки.
WxMaxima delegates some big tasks like parsing Maxima’s >1000-page-manual to background tasks, which normally goes totally unnoticed. At the moment the result of such a task is needed, though, it is possible that wxMaxima needs to wait a couple of seconds before it can continue its work.
‘xx_YY’ can not be set" occurs
(Таке саме може статися із іншими програмами.) Переклад може працювати після натискання кнопки «Гаразд». wxMaxima не просто використовує власні переклади, але і переклади з бібліотеки wxWidgets.
Локалі може не бути у системі. У системах Ubuntu/Debian локалі можна створити за допомогою такої команди: dpkg-reconfigure locales
Ці символи можна знайти на бічній панелі Unicode (пошукайте «великі літери із подвійним контуром»). Втім, підтримку цих символів має бути передбачено у вибраному шрифті. Якщо програма не показує символи належним чином, виберіть інший шрифт.
command line Maxima?
If wxMaxima is used, the Maxima variable maxima_frontend
is set to wxmaxima
. The Maxima variable maxima_frontend_version
contains the wxMaxima version in this case.
If no frontend is used (you are using command line Maxima), these variables are false
.
Usually you can start programs with a graphical user interface just by clicking on a desktop icon or desktop menu entry. WxMaxima - if started from the command line - still provides some command-line switches, though.
-v
або --version
: вивести дані щодо версії програми-h
або --help
: вивести короткий довідковий текст-o
або --open=<рядок>
: відкрити файл, який передано як аргумент до цього параметра командного рядка-e
або --eval
: обробити файл після його відкриття-b
або --batch
: якщо ви відкриваєте файл з командного рядка, усі комірки у цьому файлі обчислюються, а потім програма виконує збереження файла. Це, наприклад, корисно, якщо сеанс, який описано у файлі, призводить до того, що Maxima щось виводить до файлів. Пакетну обробку буде зупинено, якщо wxMaxima виявить, що Maxima вивела повідомлення про помилку, і призупинить обробку, якщо Maxima задасть питання: математика є дещо інтерактивною за природою, тому повністю автономна пакетна обробка можлива далеко не завжди.--logtostderr
: Log all “debug messages” sidebar messages to stderr, too.--pipe
: Pipe messages from Maxima to stdout.--exit-on-error
: Close the program on any maxima error.-f
or --ini=<str>
: Use the init file that was given as an argument to this command-line switch-u
, --use-version=<str>
: Use maxima version <str>
.-l
, --lisp=<str>
: Use a Maxima compiled with Lisp compiler <str>
.-X
, --extra-args=<str>
: Allows to specify extra Maxima arguments-m
or --maxima=<str>
: allows specifying the location of the maxima binary--enableipc
: Lets Maxima control wxMaxima via interprocess communications. Use this option with care.--wxmathml-lisp=<str>
: Location of wxMathML.lisp (if not the built-in should be used, mainly for developers).Замість символу мінуса у деяких операційних системах перед перемикачами командного рядка використовується тире.
wxMaxima is mainly developed using the programming language C++ using the wxWidgets framework, as build system we use CMake, a small part is written in Lisp. You can contribute to wxMaxima, join the wxMaxima project at https://github.com/wxMaxima-developers/wxmaxima, if you have knowledge of these programming languages and want to help and contribute to the open source project wxMaxima.
But not only programmers are necessary! You can also contribute to wxMaxima, if you help to improve the documentation, find and report bugs (and maybe bugfixes), suggest new features, help to translate wxMaxima or the manual to your language (read the Readme in the locale subdirectory how wxMaxima and the manual can be translated).
Or answer questions of other users in the discussion forum.
Початковий код wxMaxima документовано за допомогою системи Doxygen тут.
Програма є майже самодостатньою, тому, окрім системних бібліотек (та бібліотеки wxWidgets), ніяких зовнішніх залежностей (зокрема графічних файлів або частини Lisp (файла wxmathML.lisp
) не потрібно, ці файли включено до виконуваного файла програми.
If you are a developer, you might want to try out a modified wxmathML.lisp
-file without recompiling everything, one can use the command line option --wxmathml-lisp=<str>
to use another Lisp file, not the included one.