2
0

More than 1 year has passed since last update.

「maxima 入門」入門(Windows編)

Last updated at Posted at 2019-10-15

数式処理ソフト Maxima

仮説(95) 確率論及統計論
https://qiita.com/kaizen_nagoya/items/89d0a91a56d33529e85c

「量子アニーリングの基礎」を読む
https://qiita.com/kaizen_nagoya/items/29580dc526e142cb64e9

の式の展開を埋めるため。

LaTeX/TeXの式を生成するため。

アナログ制御とデジタル制御の連結方法を検討するため。

その前段としてscilabとmaximaの連携を図りたい。

Toppers_JSPとScicos_lab(Scilabでも可)による組込みメカトロニクス制御シミュレーション 塩出 武(個人)
https://qiita.com/kaizen_nagoya/items/2aa0454c7bde7058e3f1

TOPPERS/箱庭 簡易デモ紹介
https://qiita.com/kanetugu2018/items/cf4f0a094419393fb500

の入力として、maxima -> scilab -> simulator
maxima -> latex
maxima -> XML -> ...
などなど。

maxima

http://maxima.sourceforge.net
https://sourceforge.net/projects/maxima/

maxima0.png

「Download」を押す

maxima.png

「保存」を押す。

maxima2.png

「実行」を押す。

maxima3.png

「次へ」を押す。

maxima4.png

契約条項に問題がなければ、「同意する」を押す。

maxima5.png

「次へ」を押す

maxima6.png

「次へ」を押す

maxima7.png

「完了」を押す

maxima8.png

「wxMaxima」を起動する。

maxima9.png

「方程式」メニューの「方程式を解く」を押す。式を入力する。
ここでは
http://www.k-techlabo.org/www_maxima/maxima_main.pdf
p.10の2つめの式を入れる。
入力した式を編集したら、エラーが出た。
再入力。

maximaa.png

「Maxima」ニューの「Tex出力」を選び張り付ける。

maximab.png

「編集」メニューでtextとしてコピーすればtexファイルになる。
mathml, latexもそれぞれ試した。
latexは余分な飾りが多かった。

#text としてコピー

tex(%)$
$$\left[ x=\left({{-1}\over{2}}-{{\sqrt{3}\,i}\over{2}}\right)\,

 \left({{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,

 c^3-b^2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a

 }}-{{3\,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^3}\over{27\,a^3}}

 \right)^{{{1}\over{3}}}-{{\left({{\sqrt{3}\,i}\over{2}}+{{-1}\over{2

 }}\right)\,\left({{\left(-1\right)\,b^2}\over{9\,a^2}}+{{c}\over{3\,

 a}}\right)}\over{\left({{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c

 \right)\,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{

 {{b\,c}\over{a\,a}}-{{3\,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^

 3}\over{27\,a^3}}\right)^{{{1}\over{3}}}}}+{{\left(-1\right)\,b

 }\over{3\,a}} , x=\left({{\sqrt{3}\,i}\over{2}}+{{-1}\over{2}}

 \right)\,\left({{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c\right)

 \,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{{{b\,c

 }\over{a\,a}}-{{3\,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^3

 }\over{27\,a^3}}\right)^{{{1}\over{3}}}-{{\left({{-1}\over{2}}-{{

 \sqrt{3}\,i}\over{2}}\right)\,\left({{\left(-1\right)\,b^2}\over{9\,

 a^2}}+{{c}\over{3\,a}}\right)}\over{\left({{\sqrt{27\,a^2\,d^2+

 \left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{

 {{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a}}-{{3\,d}\over{a}}}\over{6

 }}+{{\left(-1\right)\,b^3}\over{27\,a^3}}\right)^{{{1}\over{3}}}}}+

 {{\left(-1\right)\,b}\over{3\,a}} , x=\left({{\sqrt{27\,a^2\,d^2+

 \left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{

 {{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a}}-{{3\,d}\over{a}}}\over{6

 }}+{{\left(-1\right)\,b^3}\over{27\,a^3}}\right)^{{{1}\over{3}}}-{{

 {{\left(-1\right)\,b^2}\over{9\,a^2}}+{{c}\over{3\,a}}}\over{\left(

 {{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,c^3-b^

 2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a}}-{{3

 \,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^3}\over{27\,a^3}}

 \right)^{{{1}\over{3}}}}}+{{\left(-1\right)\,b}\over{3\,a}} \right] $$

#math MLとしてコピー

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <semantics>
    <mtable>
      <mlabeledtr columnalign="left">
        <mtd>
          <mtext/>
        </mtd>
        <mtd/>
      </mlabeledtr>
    </mtable>
    <annotation encoding="application/x-maxima">(%i4)	tex(%)$
$$\left[ x=\left({{-1}\over{2}}-{{\sqrt{3}\,i}\over{2}}\right)\,
 \left({{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,
 c^3-b^2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a
 }}-{{3\,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^3}\over{27\,a^3}}
 \right)^{{{1}\over{3}}}-{{\left({{\sqrt{3}\,i}\over{2}}+{{-1}\over{2
 }}\right)\,\left({{\left(-1\right)\,b^2}\over{9\,a^2}}+{{c}\over{3\,
 a}}\right)}\over{\left({{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c
 \right)\,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{
 {{b\,c}\over{a\,a}}-{{3\,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^
 3}\over{27\,a^3}}\right)^{{{1}\over{3}}}}}+{{\left(-1\right)\,b
 }\over{3\,a}} , x=\left({{\sqrt{3}\,i}\over{2}}+{{-1}\over{2}}
 \right)\,\left({{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c\right)
 \,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{{{b\,c
 }\over{a\,a}}-{{3\,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^3
 }\over{27\,a^3}}\right)^{{{1}\over{3}}}-{{\left({{-1}\over{2}}-{{
 \sqrt{3}\,i}\over{2}}\right)\,\left({{\left(-1\right)\,b^2}\over{9\,
 a^2}}+{{c}\over{3\,a}}\right)}\over{\left({{\sqrt{27\,a^2\,d^2+
 \left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{
 {{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a}}-{{3\,d}\over{a}}}\over{6
 }}+{{\left(-1\right)\,b^3}\over{27\,a^3}}\right)^{{{1}\over{3}}}}}+
 {{\left(-1\right)\,b}\over{3\,a}} , x=\left({{\sqrt{27\,a^2\,d^2+
 \left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,c^3-b^2\,c^2}}\over{2\,3^{
 {{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a}}-{{3\,d}\over{a}}}\over{6
 }}+{{\left(-1\right)\,b^3}\over{27\,a^3}}\right)^{{{1}\over{3}}}-{{
 {{\left(-1\right)\,b^2}\over{9\,a^2}}+{{c}\over{3\,a}}}\over{\left(
 {{\sqrt{27\,a^2\,d^2+\left(4\,b^3-18\,a\,b\,c\right)\,d+4\,a\,c^3-b^
 2\,c^2}}\over{2\,3^{{{3}\over{2}}}\,a^2}}+{{{{b\,c}\over{a\,a}}-{{3
 \,d}\over{a}}}\over{6}}+{{\left(-1\right)\,b^3}\over{27\,a^3}}
 \right)^{{{1}\over{3}}}}}+{{\left(-1\right)\,b}\over{3\,a}} \right] $$</annotation>
  </semantics>
</math>

latex としてコピー

\noindent
%%%%%%%%%%%%%%%
%%% INPUT:
\begin{minipage}[t]{4em}\color{red}\bf
(\% i4)
\end{minipage}
\begin{minipage}[t]{\textwidth}\color{blue}
tex(\%)\$


\end{minipage}
%%% OUTPUT:
\[\displaystyle \mbox{}\\\mbox{\$ \$ \backslash left[ x=\backslash left(\{\{-1\}\backslash over\{2\}\}-\{\{\backslash sqrt\{3\}\backslash ,i\}\backslash over\{2\}\}\backslash right)\backslash ,}\mbox{}\\\mbox{ \backslash left(\{\{\backslash sqrt\{27\backslash ,a\textasciicircum2\backslash ,d\textasciicircum2+\backslash left(4\backslash ,b\textasciicircum3-18\backslash ,a\backslash ,b\backslash ,c\backslash right)\backslash ,d+4\backslash ,a\backslash ,}\mbox{}\\\mbox{ c\textasciicircum3-b\textasciicircum2\backslash ,c\textasciicircum2\}\}\backslash over\{2\backslash ,3\textasciicircum\{\{\{3\}\backslash over\{2\}\}\}\backslash ,a\textasciicircum2\}\}+\{\{\{\{b\backslash ,c\}\backslash over\{a\backslash ,a}\mbox{}\\\mbox{ \}\}-\{\{3\backslash ,d\}\backslash over\{a\}\}\}\backslash over\{6\}\}+\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum3\}\backslash over\{27\backslash ,a\textasciicircum3\}\}}\mbox{}\\\mbox{ \backslash right)\textasciicircum\{\{\{1\}\backslash over\{3\}\}\}-\{\{\backslash left(\{\{\backslash sqrt\{3\}\backslash ,i\}\backslash over\{2\}\}+\{\{-1\}\backslash over\{2}\mbox{}\\\mbox{ \}\}\backslash right)\backslash ,\backslash left(\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum2\}\backslash over\{9\backslash ,a\textasciicircum2\}\}+\{\{c\}\backslash over\{3\backslash ,}\mbox{}\\\mbox{ a\}\}\backslash right)\}\backslash over\{\backslash left(\{\{\backslash sqrt\{27\backslash ,a\textasciicircum2\backslash ,d\textasciicircum2+\backslash left(4\backslash ,b\textasciicircum3-18\backslash ,a\backslash ,b\backslash ,c}\mbox{}\\\mbox{ \backslash right)\backslash ,d+4\backslash ,a\backslash ,c\textasciicircum3-b\textasciicircum2\backslash ,c\textasciicircum2\}\}\backslash over\{2\backslash ,3\textasciicircum\{\{\{3\}\backslash over\{2\}\}\}\backslash ,a\textasciicircum2\}\}+\{\{}\mbox{}\\\mbox{ \{\{b\backslash ,c\}\backslash over\{a\backslash ,a\}\}-\{\{3\backslash ,d\}\backslash over\{a\}\}\}\backslash over\{6\}\}+\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum}\mbox{}\\\mbox{ 3\}\backslash over\{27\backslash ,a\textasciicircum3\}\}\backslash right)\textasciicircum\{\{\{1\}\backslash over\{3\}\}\}\}\}+\{\{\backslash left(-1\backslash right)\backslash ,b}\mbox{}\\\mbox{ \}\backslash over\{3\backslash ,a\}\} , x=\backslash left(\{\{\backslash sqrt\{3\}\backslash ,i\}\backslash over\{2\}\}+\{\{-1\}\backslash over\{2\}\}}\mbox{}\\\mbox{ \backslash right)\backslash ,\backslash left(\{\{\backslash sqrt\{27\backslash ,a\textasciicircum2\backslash ,d\textasciicircum2+\backslash left(4\backslash ,b\textasciicircum3-18\backslash ,a\backslash ,b\backslash ,c\backslash right)}\mbox{}\\\mbox{ \backslash ,d+4\backslash ,a\backslash ,c\textasciicircum3-b\textasciicircum2\backslash ,c\textasciicircum2\}\}\backslash over\{2\backslash ,3\textasciicircum\{\{\{3\}\backslash over\{2\}\}\}\backslash ,a\textasciicircum2\}\}+\{\{\{\{b\backslash ,c}\mbox{}\\\mbox{ \}\backslash over\{a\backslash ,a\}\}-\{\{3\backslash ,d\}\backslash over\{a\}\}\}\backslash over\{6\}\}+\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum3}\mbox{}\\\mbox{ \}\backslash over\{27\backslash ,a\textasciicircum3\}\}\backslash right)\textasciicircum\{\{\{1\}\backslash over\{3\}\}\}-\{\{\backslash left(\{\{-1\}\backslash over\{2\}\}-\{\{}\mbox{}\\\mbox{ \backslash sqrt\{3\}\backslash ,i\}\backslash over\{2\}\}\backslash right)\backslash ,\backslash left(\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum2\}\backslash over\{9\backslash ,}\mbox{}\\\mbox{ a\textasciicircum2\}\}+\{\{c\}\backslash over\{3\backslash ,a\}\}\backslash right)\}\backslash over\{\backslash left(\{\{\backslash sqrt\{27\backslash ,a\textasciicircum2\backslash ,d\textasciicircum2+}\mbox{}\\\mbox{ \backslash left(4\backslash ,b\textasciicircum3-18\backslash ,a\backslash ,b\backslash ,c\backslash right)\backslash ,d+4\backslash ,a\backslash ,c\textasciicircum3-b\textasciicircum2\backslash ,c\textasciicircum2\}\}\backslash over\{2\backslash ,3\textasciicircum\{}\mbox{}\\\mbox{ \{\{3\}\backslash over\{2\}\}\}\backslash ,a\textasciicircum2\}\}+\{\{\{\{b\backslash ,c\}\backslash over\{a\backslash ,a\}\}-\{\{3\backslash ,d\}\backslash over\{a\}\}\}\backslash over\{6}\mbox{}\\\mbox{ \}\}+\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum3\}\backslash over\{27\backslash ,a\textasciicircum3\}\}\backslash right)\textasciicircum\{\{\{1\}\backslash over\{3\}\}\}\}\}+}\mbox{}\\\mbox{ \{\{\backslash left(-1\backslash right)\backslash ,b\}\backslash over\{3\backslash ,a\}\} , x=\backslash left(\{\{\backslash sqrt\{27\backslash ,a\textasciicircum2\backslash ,d\textasciicircum2+}\mbox{}\\\mbox{ \backslash left(4\backslash ,b\textasciicircum3-18\backslash ,a\backslash ,b\backslash ,c\backslash right)\backslash ,d+4\backslash ,a\backslash ,c\textasciicircum3-b\textasciicircum2\backslash ,c\textasciicircum2\}\}\backslash over\{2\backslash ,3\textasciicircum\{}\mbox{}\\\mbox{ \{\{3\}\backslash over\{2\}\}\}\backslash ,a\textasciicircum2\}\}+\{\{\{\{b\backslash ,c\}\backslash over\{a\backslash ,a\}\}-\{\{3\backslash ,d\}\backslash over\{a\}\}\}\backslash over\{6}\mbox{}\\\mbox{ \}\}+\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum3\}\backslash over\{27\backslash ,a\textasciicircum3\}\}\backslash right)\textasciicircum\{\{\{1\}\backslash over\{3\}\}\}-\{\{}\mbox{}\\\mbox{ \{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum2\}\backslash over\{9\backslash ,a\textasciicircum2\}\}+\{\{c\}\backslash over\{3\backslash ,a\}\}\}\backslash over\{\backslash left(}\mbox{}\\\mbox{ \{\{\backslash sqrt\{27\backslash ,a\textasciicircum2\backslash ,d\textasciicircum2+\backslash left(4\backslash ,b\textasciicircum3-18\backslash ,a\backslash ,b\backslash ,c\backslash right)\backslash ,d+4\backslash ,a\backslash ,c\textasciicircum3-b\textasciicircum}\mbox{}\\\mbox{ 2\backslash ,c\textasciicircum2\}\}\backslash over\{2\backslash ,3\textasciicircum\{\{\{3\}\backslash over\{2\}\}\}\backslash ,a\textasciicircum2\}\}+\{\{\{\{b\backslash ,c\}\backslash over\{a\backslash ,a\}\}-\{\{3}\mbox{}\\\mbox{ \backslash ,d\}\backslash over\{a\}\}\}\backslash over\{6\}\}+\{\{\backslash left(-1\backslash right)\backslash ,b\textasciicircum3\}\backslash over\{27\backslash ,a\textasciicircum3\}\}}\mbox{}\\\mbox{ \backslash right)\textasciicircum\{\{\{1\}\backslash over\{3\}\}\}\}\}+\{\{\backslash left(-1\backslash right)\backslash ,b\}\backslash over\{3\backslash ,a\}\} \backslash right] \$ \$ }\mbox{}
\]
%%%%%%%%%%%%%%%

#参考資料(referrence)
「maxima 入門」入門(Macintosh編)
https://qiita.com/kaizen_nagoya/items/9eb552fcd9e1033c0879

「maxima 入門」入門(docker編)
https://qiita.com/kaizen_nagoya/items/5b4b4e09ee9e2fcf735b

sbcl 導入(docker/gcc編) エラー中
https://qiita.com/kaizen_nagoya/items/ad0e66cdbf4de0c3a5f5

maxima導入(docker/sbcl編) エラー中
https://qiita.com/kaizen_nagoya/items/3372c4a3f6ace6b55115

文書履歴(document history)

ver. 0.01 初稿 20191015 昼
ver. 0.02 追記 20191015 夕

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0