Atvalue for subscripted variables.



Hi Dan, you wrote:

> has anyone looked at what it would take to modify
> atvalue so that it works for subscripted variables?

Well, subscripts are carried around like excess baggage
in some parts of Maxima, without interacting with anything,
so I was inspired to disable the test in atvalue which
disallows subscripted variables ...

(%i1) atvalue (f(x,y), [x = 0, y = 1], a^2);
                                2
(%o1)                          a
(%i2) f(0,1);
                                2
(%o2)                          a
(%i3) f(0,2);
(%o3)                        f(0, 2)

OK, this is all as expected.

(%i5) :lisp (defun improper-arg-err (a b) t) /* DISABLE TEST HERE */

(%i5) atvalue (g(x,y), [x[1] = 0, x[2] = 1], b^2);
                                2
(%o5)                          b
(%i6) printprops (all, atvalue);
                                     2
                          f(0, 1) = a

                                      2
                         g(@1, @2) = b

Oops, the atvalue for g is broken. Rats.

(%i7) g(0,1);
                                2
(%o7)                          b

OK.

(%i8) g(0,2);
                                2
(%o8)                          b

Uh, nope, that's not it -- should be g(0,2) for %o8.

It just gets worse from here ...

(%i9) atvalue ('diff (f(x,y), x), x = 0, 1 + y);
(%o9)                        @2 + 1

As expected.

(%i10) atvalue ('diff (g(x[1], x[2]), x[1]), x[1] = 0, 1 + x[2]);
(%o10)                       x  + 1
                              2

No, should be like %o9.

(%i11) printprops (all, atvalue);
                                !
                  d             !
                 --- (f(@1, @2))!       = @2 + 1
                 d@1            !
                                !@1 = 0

                                     2
                          f(0, 1) = a

                                      2
                         g(@1, @2) = b

                            @2
                          @1   = x  + 1
                                  2

(%o11)                        done

Rats, this is a mess. I guess we have some work to do.

Hope this helps,
Robert Dodier

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com