Hi,
As a general rule, I recommend against using 'ev', which is a
hodge-podge of special cases and funny semantics.
In this case, though, the semantics are pretty clear: ev(xxx,t=0) does
not mean "evaluate xxx then substitute 0 for t in the result", but
rather "evaluate xxx in an environment where t is set to 0". So
ev(diff(xxx,t),t=0) means the same as diff(ev(xxx,t=0),0) and
differentiating by 0 is of course meaningless.
Instead of ev, I would recommend using subst, e.g.
subst(t=0, diff(x_sho,t) )
Hope this helps,
-s
On Mon, Nov 16, 2009 at 2:23 PM, Conrad Schiff <gravmath at yahoo.com> wrote:
> I need some help interpreting the behavior of the ev command.
>
> I enter the expression:
> (%i1) ?x_sho : A*sin(w*t) + B*cos(w*t)$
>
> and then I want to setup equations for A and B in terms of x_sho(t=0) and vx_sho(t=0), where vx_sho = diff(x_sho,t).
>
> A straightforward application of ev leads immediately to one of the two equations I want:
> (%i2) ?IC1 : ev(x_sho,t=0) = x0;
> (%o2) ?A=x0
>
> however, my next attempt fails
> (%i3) ?IC2 : ev(diff(x_sho,t),t=0);
> diff: second argument must be a variable; found 0
> ?-- an error. ?To debug this try debugmode(true);
>
> I tried ev( ev(diff(x_sho,t),diff) , t=0 ), which also fails. ?A trivial workaround is available by defining an intermediate expression vx_sho = diff(x,t) and then using ev(vx_sho,t=0) so this isn't a serious problem however it is annoying and the process looks so much cleaner if I don't have to define vx.
>
> Thanks,
> Conrad
>
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>