Dear all,
Here I am still fighting to get the lagrangean module that I want.
I have two unrelated questions which I will put in two different
e-mails. The first one, placed here, is about how to define properties
of a function that is yet to be defined.
Let me give you an example.
Let say there is a function f that returns a scalar, but we do not
know the functional form of it.
I am trying to define that function in the following way, (that can be wrong)
f: apply(f,[t]);
I am doing this because then,
diff(f,t)
gives the proper output (or it seems to be right, I do not yet
understand the lisp representation)
I would like to get the predicates (or equivalent ones, that I could't find)
scalarp(f);
scalarp(diff(f,t))
evaluate to true.
I got a solution in the following way (this also works on bigger
expressions, like lagrangians etc,etc,)
kill(all);
f: apply(f,[t]);
declare(t,scalar);
This produces true for all this predicates
scalarp(f);
scalarp(diff(f,t));
scalarp('diff(f,t));
I cannot get this result if instead of the apply line, I use depends(f,t).
At the same time, Mario, from the spanish mailing list, pointed out
that what I am doing does not adds f to the infolist functions (is it
an infolist?) then it may be just a lucky event.
So, How can one define that a symbol depends on a variable, without
explicitly stating the dependency, and define that the output of that
function is a scalar, or a nonscalar?
Thank you very much