# [Maxima] Expanion of vector expressions

Volker van Nek volkervannek at googlemail.com
Thu Apr 26 06:57:19 CDT 2012

```Hello Michael,

I cannot reproduce what you experience. Not in 5.25.1, 5.26.0 and 5.27.0.

Your output (%o1) is 1-dimensional, which normally isn't. Do you use
maxima-init.lisp to set any environment for Maxima?

Anyway here is a workaround for your problem. Mapping a lambda expression

(%i1) display2d : false\$

(%i2) map(lambda([i], i/(a+b+c+d+e+f)), [x,y,z]);

(%o2) [x/(f+e+d+c+b+a),y/(f+e+d+c+b+a),z/(f+e+d+c+b+a)]
(%i3) map(lambda([i], i/(a+b+c+d+e+f)), [x,y,z])[1];

(%o3) x/(f+e+d+c+b+a)

HTH
Volker van Nek

2012/4/26 Soegtrop, Michael <michael.soegtrop at intel.com>

> Dear Maxima Users,
>
> I came across a problem with vector simplification (using maxima 5.25.1, I
> have problems with maxima 5.26). For products of a scalar and a vector, it
> depends on the length of the scalar expression, if it is distributed over
> the vector or not.
>
> E.g. with a 5 element denominator I get
>
> (%i1) [x,y,z]/(a+b+c+d+e);
>
> (%o1) [x/(e+d+c+b+a),y/(e+d+c+b+a),z/(e+d+c+b+a)]
>
> And with a 6 element denominator I get
>
> (%i2) [x,y,z]/(a+b+c+d+e+f);
>
> (%o2) [x,y,z]/(f+e+d+c+b+a)
>
> I found no way to expand such a vector*scalar expression, e.g. expand,
> vectorsimp with expandall:true don't work. This is especially inconvenient
> when I want to retrieve an element of the vector as in
>
> (%i3) ([x,y,z]/(a+b+c+d+e))[1];
>
> (%o3) x/(e+d+c+b+a)
>
> but
>
> (%i4) ([x,y,z]/(a+b+c+d+e+f))[1];
>
> (%o4) ([x,y,z]/(f+e+d+c+b+a))[1]
>
> Is there a way of doing this without writing my own function for this?
>
> Thanks & best regards,
>
> Michael
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120426/fa2e454e/attachment-0001.html>
```