generating functions with maxima



The output of this function is similar to the result you want:

(%i33) f(x,a,b):=listify(setify(exp(flatten(args(transpose(a).x^b)))))$
(%i34) f(x, coeff, power);
                                                   2     2
                         - 1        - x    x    - x     x
(%o34)             [1, %e   , %e, %e   , %e , %e    , %e  ]


This works with cvs-Maxima.

Mario.


El Jueves, 4 de Agosto de 2005 01:23, Kamaraju Kusumanchi escribió:
> I would like to have an array of the following functions.
>
> [exp(-1), exp(0), exp(1), exp(-x), exp(x), exp(x^2), exp(-x^2)]
>
> I used the following the following procedure to generate these functions.
>
> coeff : [-1, 0, 1]
>
> power : [0, 1, 2]
>
> f(x, a, b) := exp(a * x**b)
>
> f(x, coeff, power)
>
> But the output of last command is
>
> [exp(-1), 1, exp(x^2)]
>
> What am I doing wrong? Is there any way to achieve what I want using a
> this or some other method. The brute force way of doing this is to
> define my own array with required functions. But I want to generate
> the functions automatically as that gives me more flexibility.
>
> thanks
> raju

-- 
--------------------------
Mario Rodriguez Riotorto
www.biomates.net