Function with other function as argument and other functions as output



There are several technical problems with your definition:

    * Function and block arguments should be symbols, not expressions like
x(t).
    * ''(...) evaluates at the time the expression is *read*, not the time
it is evaluated, so this almost certainly doesn't do what you want,

But actually you don't need any of that.  Instead of defining "functions",
it is easier just to define *expressions*, e.g.

test(expr) := block([vi,ve,T,vu],
          vi: diff(expr,'t),
          ve: sqrt(vi . vi)
          vu : ...,
          T: subst(vu, 't , ...)
          etc.

           -s

On Sun, May 13, 2012 at 8:28 AM, Miguel Marinho <miguelmarinho at seoutopia.com
> wrote:

> Dear Sir/Madam,
>
> I would like to creat a function with other function as argument, example:
>
> test(x(t)):=block([**VelocidadeInst(t),**VelocidadeEsc(t),T(t),vector_**
> unit(u)],
>                define(VelocidadeInst(t), diff(x, t)),
>                define(VelocidadeEsc(t), sqrt(VelocidadeInst(t).**
> VelocidadeInst(t))),
>                vetor_unit(u):=((1/(sqrt(u.u))**)*u),
>                T(t):=''(vetor_unit(**VelocidadeInst(t))));
>
> where x(t) could be something like: x(t):=[t,cos(t)], so when I ran the
> function test(x(t)) it should return the functions: VelocidadeInst(t),**VelocidadeEsc(t)
> and T(t), instead of "define: in definition of test, found bad argument
> x(t)".
>
> Thank you,
> Yours faithfully,
> Miguel Marinho
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>;
>