[Maxima] Basic question on verbifying expressions
rswarbrick at gmail.com
Thu Apr 19 08:01:14 CDT 2012
Stavros Macrakis <macrakis at alum.mit.edu> writes:
> On Thu, Apr 19, 2012 at 07:07, Rupert Swarbrick <rswarbrick at gmail.com>wrote:
>> ...The easiest way to do this sort of thing is syntactically: instead of
>> saying to Maxima "please resimplify the expression, knowing also that
>> x(t)=1", just say "replace all occurrences of x(t) with 1 in here".
> Well, that works if it's literally x(t) in the expression; but what if it's
> x(t-1) or x(t^2)?
> For *local* substitution of f, you can also do
> expr: f(t-1)
> block(local(f), f(x):=x^3, ev(expr) )
> ev( expr , f(x):=x^3 )
Ah that's a good point. I have done things like this in the past:
(%i9) f(x + 1);
(%o9) f(x + 1)
(%i10) subst(f=lambda([x], x^2), %o9);
(%o10) (x + 1)
but I agree that it's not necessarily any more obvious what's going on.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 315 bytes
Desc: not available
More information about the Maxima