We now have definitions for both position and vel. Are they the
same kind of thing?
Click here for the answer
Fortunately, Maple provides a built-in function called unapply to
transform an expression into a function. For example, if we want a function
called velocity to compute velocity as a function of time, we need only
do
| velocity := unapply(vel, t); |
The idea behind unapply is this. If we have an expression containing
some variables, we can tell unapply to create a function in which the
expression is the body and one (or more) of the variables are the arguments.
Of course, we could have done without unapply in this instance. Instead,
we could have simply typed the entire function definition into Maple by hand.
Even though unapply is only a convenience, it is a very useful
convenience when we are trying to convert very complicated expressions into
functions. It is instructive to note that unapply gets its name because
it is the opposite of applying a function to arguments.
Can you use diff and unapply to produce an acceleration
function in one step?
Click here for the answer
Oddly, Maple doesn't put the result in what looks like a function form.
Nevertheless, you can evaluate expressions such as acceleration(t).
Joseph L. Zachary
Hamlet Project
Department of Computer Science
University of Utah