Simple example to illustrate the desired functionality:
Say we have a 2D vector function which describes the position of a particle
r := t -> <5*cos(Pi*t), 5*sin(Pi*t)>
We want to define the velocity and acceleration as functions, so we could do something like
v := t -> <diff(r(t), t), diff(r(t), t)>
The problem now is that we cannot call our velocity function with numeric arguments.
A simple solution is to call the function via "subs", as in
subs(t = 2, v(t))
but IMHO, this is not very elegant and I guess inefficient. Is there a command that enables for pulling out the evaluated result from diff such that it can be used directly as a functional expression ? I.e., I want to be able to call
directly, without having to do substitutions.
I found that you can do
v := <diff(r(t), t, diff(r(t), t)>
v := unapply(v, t)
but please provide your recommendations. Thanks