[Maxima] newbie question about ev();

Juan Pablo Romero Bernal jromerobernal at gmail.com
Wed May 30 15:10:18 CDT 2007


Hi,

> # Hi!
> # This term I took a Linux course and so discovered the Maxima. Many thanks
> to developers!
> # Here's my question: I want to evaluate an expression which consists of
> other expressions. For example:
>
> u: x+y;
> x: m^2;
> y: m*n;
>
> ev(u);
> # gives m n + m^2. But, as I understand correctly, because u does depend on
> m and n implicity, ev(u, m=1); does not work. It's output is same as ev(u);
> # What should I do to overcome this problem? Thanks.
> -ugur guney-

In this case, u depends of x and y explicity and of m and n implicity
way. The ev
command evaluate an expression in the environment specified for a set
of arguments. In this case:

(%i5) ev(u,m=1);
(%o5) m*n+m^2

The u expression is only evaluated once. However, you can use the eval flag, to
cause an extra post-evaluation (see the documentation):

(%i6) ev(u,m=1,eval);
(%o6) n+1
(%i7) ev(u,m=1,n=1,eval);
(%o7) 2

For more information about ev command see:

http://maxima.sourceforge.net/es/docs/manual/en/maxima_4.html#IDX18

Bye,

-- 
Juan Pablo Romero Bernal
Grupo Linux Universidad Distrital
Blog: http://jpromerobx.blogspot.com/
Canal IRC (IRC Channel)
#glud (irc.freenode.org)

Visita el sitio web de Software Libre en Colombia:
http://www.el-directorio.org


More information about the Maxima mailing list