「maxima 入門」入門(Windows編)

数式処理ソフト　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](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/fa0cda6f-0edb-ccda-7901-4969e5cf43f9.png)

「Download」を押す

![maxima.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/c9c5e265-81f8-9c8c-aedb-fc0f754068df.png)

「保存」を押す。

![maxima2.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/6894d22b-a4eb-e8f7-d7c4-5a85deb1be9f.png)

「実行」を押す。

![maxima3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/3abe3793-8cb4-bc84-dc70-18f58b156551.png)

「次へ」を押す。

![maxima4.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/938efa49-af2f-f6cf-0d27-ca2d9b109694.png)

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

![maxima5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/a6021c0e-c931-dabf-5fd6-3a8a8434412d.png)

「次へ」を押す

![maxima6.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/f93dd3a7-14c1-a39f-4c4c-e0754251a98d.png)


「次へ」を押す

![maxima7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/535eac99-3b84-af2f-f3b3-bd88d8d72446.png)

「完了」を押す


![maxima8.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/b05a540c-39cd-b44a-9107-0f72f7108449.png)

「wxMaxima」を起動する。

![maxima9.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/47a139c9-ecd8-9ee6-2096-8b2d24c8518d.png)

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

![maximaa.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/21bdacab-1f06-98bd-822b-f8fe9bec9e05.png)

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

![maximab.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/51423/d0a3db79-4b47-cc31-3697-26924ebd9fce.png)

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

#text としてコピー

```tex
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としてコピー

```mathml
<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 としてコピー

```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.