How to define a generic function?

36 views
Skip to first unread message

Mattia Villani

unread,
Oct 4, 2020, 4:15:43 AM10/4/20
to sage-support
I am trying to calculate the general expression of the Kretschmann scalar of  metric depending a non specified function m(r): how do I define such a function? II have tried with
def m(r)
but it is wrong since it expects a definition of the function

Dima Pasechnik

unread,
Oct 4, 2020, 5:54:34 AM10/4/20
to sage-support, sage-devel
just added some keywords to the subject.

Eric Gourgoulhon

unread,
Oct 4, 2020, 10:52:06 AM10/4/20
to sage-support
Simply use

mr = function('m')(r)

See
for a full example.

Best wishes,

Eric.
Reply all
Reply to author
Forward
0 new messages