Ask Your Question

Is there any way to define an as-yet-unknown function?

asked 2012-03-23 08:11:38 -0500

jdpipe gravatar image

updated 2012-03-23 08:13:32 -0500

I'd like to know if there's a way of declaring functions in sage that are as-yet unknown. For example, let's say I have a function

p = R*T/v - a(T)/v/(v+b)

And I would like to be able to take a derivative like this


and be given something back a partial derivative something like

R/v - diff(a(T),T)/v/(v+b)

However at present I can't seem to put an abstract function a(T) into my expression or find anything in the documentation that says how this is done.

As I recall there was a way to do this with wxMaxima, so maybe I just haven't found the trick in Sage yet.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-03-23 08:17:30 -0500

Shashank gravatar image

You can define a function using the keyword function. The script below gives the answer you expect.

p = R*T/v - a(T)/v/(v+b)
edit flag offensive delete link more


Great. seems to work fine. The output is a bit weird though, in typeset sage, the diff(a(T),T) is written as D [ 0 ] ( a ) ( T ), not particular intuitive. But it works! Thank you.

jdpipe gravatar imagejdpipe ( 2012-03-23 12:53:03 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools


Asked: 2012-03-23 08:11:38 -0500

Seen: 277 times

Last updated: Mar 23 '12