maxima

在传递给 sum() 之前强制评估索引表达式(Force evaluate index expression before passing to sum())

2021-09-23 09:43:33    分类:技术分享    symbolic-math   quote   maxima   computer-algebra-systems

如何将一个数字近似为小数位数？(How to approximate a number to a n number of decimal places?)

2021-09-05 11:48:44    分类:问答    complex-numbers   exponential   maxima   equation-solving   mandelbrot

How to assign the output of solve in maxima to a variable?

I am using xmaxima to solve two simultaneous non-linear equations using the 'solve' command.The answer displayed is x=[ans1, ans2,..], y=[ans1,ans2,...], But it is'int getting stored onto the variable 'x' and 'y' . How do I assign the output to a variable so that I can use the output for further calculations. The xmaxima code is as below: A:0.500000000000000$B:0.709506070053745$ C:0.242527534593605$D:0.719012140107490$ E: 0.357164044380080$F:-0.505315948652670$ G:0.181895650945204$H: 0.300000000000000$ [x,y]=solve([x^2*(A*y^3+B*y-C)-D*x*y^2+E*y^3,A*x^2+(x/y^2)*(H*y+G)+F],[x,y]),numer

2021-09-05 08:28:56    分类:问答    maxima

Show input in Symbolic form without computation in Maxima

In Maxima when I enter for example: I can see my input in a "readable" way, in order to verify everything I have typed in is interpreted the way I want. I want to be able to at first see my input in symbolic form and after that the result of my computation. For example when I define x as 5 I want the same result as above and after that the simplified form. Is that possible? I use wxmaxima. Another simple example for illustration: When I enter 5*5 I want an output saying 5 5 and then a second output with 25.

2021-09-04 00:32:05    分类:问答    maxima

I want to write an (somehow) enhanced sum function which takes a number of indices at once, but I cannot understand how to get it work. Here is what I currently have: (%i1) nsum(indexes, expr) := if indexes = [] then expr else nsum(rest(indexes), sum(expr, first(indexes),1, N)) $(%i2) nsum([i,j], i+j), nouns; sum: index must be a symbol; found intosym(first(indexes)) #0: nsum(indexes=[k,j],expr=k+j) I think this could be fixed by forcing Maxima expand first(indexes) into a symbol before passing to sum function. I tried ''(...) and ev(..., nouns), but without any success. 2021-09-03 18:48:01 分类:问答 symbolic-math quote maxima computer-algebra-systems maxima tex 输出以显示 sin 和 cos 的括号(maxima tex output to show brackets for sin and cos) 问题 我使用 maxima 的 tex 输出并想改变它输出 sin(x) 的方式。 它目前这样做： tex(sin(x)); $$\sin x$$ 但我想在 x 周围加上括号，但并非总是如此； 例如，如果我使用这个： sin(x/2) already has \left( and \right) tex(sin(x/2)); $$\sin \left({{x}\over{2}}\right)$$ 这可能吗，也许使用 texput 函数？ 回答1 好吧，如果您不反对放入一些 Lisp 代码： (%i1) :lisp (setf (get '%sin 'tex) nil) (%i1) :lisp (setf (get '%cos 'tex) nil) 这去掉了预定义的处理函数（将 sin 和 cos 视为前缀运算符）。 然后你得到： (%i1) tex (sin(x) + cos(y)); $$\cos \left(y\right)+\sin \left(x\right)$$ 回答2 如果您的上下文排除使用: lisp的替代方法可能是定义一个函数，如： psin(x):=sin(x); psintex:lambda([e],printf(false,"\\sin\\left(~a\\right)", tex1(e))) 2021-08-30 07:07:13 分类:技术分享 tex brackets maxima trigonometry 如何让Maxima的输出更干净？(How to make the output of Maxima cleaner?) 问题 我想利用 Maxima 作为后端来解决我的 LaTeX 输入文件中使用的一些计算。 我做了以下步骤。 步骤1 下载并安装千里马。 第2步 创建一个名为cas.bat的批处理文件（例如），如下所示。 rem cas.bat echo off set PATH=%PATH%;"C:\Program Files (x86)\Maxima-5.31.2\bin" maxima --very-quiet -r %1 > solution.tex 将批处理保存在下面的输入文件所在的同一目录中。 这只是为了简单起见。 第 3 步 创建名为main.tex的输入文件（例如），如下所示。 % main.tex \documentclass[preview,border=12pt,12pt]{standalone} \usepackage{amsmath} \def\f(#1){(#1)^2-5*(#1)+6} \begin{document} \section{Problem} Evaluate$\f(x)$for$x=\frac 1 2\$. \section{Solution} \immediate\write18{cas "x: 1/2;tex(\f(x));"} \input{solution} \end{document} 第四步 用pdflatex -shell-escape

2021-08-12 16:23:52    分类:技术分享    maxima

How to create a plot with sliders in maxima?

In order to illustrate a Cauchy problem for first order ode with infinite family of solutions, I would plot the parametrized solution and having the possility of control the value the parameter through a slider. To be complete the Cauchy problem is y'=sqrt(|y|), y(0)=0, and the parametric solution is y_c(x):={0, if c=>x; (x-c)^2/4, if x=>c}. So I would get a plotting of y=y_c(x) with a slider to control the value of c. Thank you.

2021-08-12 08:17:36    分类:问答    plot   slider   maxima