# [Maxima] Function with other function as argument and other functions as output

Stavros Macrakis macrakis at alum.mit.edu
Sun May 13 16:51:22 CDT 2012

```subst(2,'t,vi)

On Sun, May 13, 2012 at 5:42 PM, Miguel Marinho <miguelmarinho at seoutopia.com
> wrote:

>  Dear Stavros Macrakis,
>
> First of all , I would like to thank you for your reply.
>
> Secondly, your way is working fine, but there is just a little problem,
> doing this I'm defining "vi" without any argument, imagine I want to
> calculate vi(2) , is there any way?
>
> Once again, thank you!
>
> Yours Sincerely,
> Miguel Marinho
>
>
> Em 13-05-2012 22:26, Stavros Macrakis escreveu:
>
> 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:
>
>>
>> I would like to creat a function with other function as argument, example:
>>
>>
>>                vetor_unit(u):=((1/(sqrt(u.u)))*u),
>>
>> 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:
>> 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
>>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20120513/c9678d7a/attachment.html>
```