confused about assume()

2 views
Skip to first unread message

ben

unread,
Feb 3, 2008, 8:17:12 AM2/3/08
to sage-newbie
I've just started playing with sage and am getting stuck. What I want
to do is to have two variables, a relationship between them, and be
able to get the derivative of either with respect to the other. My
initial attempt was:

sage: var('x y')
(x, y)
sage: y=2*x
sage: y.diff(x)
2
sage: x.diff(y)
...
<type 'exceptions.TypeError'>: arguments must be integers or
SymbolicVariable objects

which doesn't work because y is a SymbolicArithmetic instance rather
than a SymbolicVariable. So I then tried

sage: var ('x y')
(x, y)
sage: assume(y==2*x)
sage: x.diff(y)
0

which doesn't work presumably because I don't understant what assume()
is doing. How should I go about doing something like this in sage?

mhampton

unread,
Feb 5, 2008, 10:48:43 AM2/5/08
to sage-newbie
I'll take a stab at helping although I might be missing something. As
far as I know, Sage is currently lacking a really easy implicit
differentiation command, which would be close to what you want. There
was a recent discussion on sage-devel that relates to this that you
might find helpful:

http://groups.google.com/group/sage-devel/browse_thread/thread/f374f76bb3cd0361/5ae6d176db62fbac?lnk=gst&q=implicit

I expect this will become easier in some future version of sage.

-M. Hampton

ben

unread,
Feb 7, 2008, 12:38:55 PM2/7/08
to sage-newbie
Yep, that was helpful. Thanks a bunch. I think the main problem is
that I need to play around with sage a bit more to get the hang of it!
Cheers,
Ben

On Feb 5, 4:48 pm, mhampton <hampto...@gmail.com> wrote:
> I'll take a stab at helping although I might be missing something. As
> far as I know, Sage is currently lacking a really easy implicit
> differentiation command, which would be close to what you want. There
> was a recent discussion on sage-devel that relates to this that you
> might find helpful:
>
> http://groups.google.com/group/sage-devel/browse_thread/thread/f374f7...
Reply all
Reply to author
Forward
0 new messages