Ask Your Question

mirk's profile - activity

2015-12-23 10:49:05 +0200 received badge  Famous Question (source)
2014-11-10 16:52:57 +0200 received badge  Notable Question (source)
2013-11-20 13:54:25 +0200 received badge  Popular Question (source)
2012-10-29 07:06:08 +0200 marked best answer functions with vector inputs

I don't understand the question. Are you asking if it's possible to use the special notation like f(x) = x^2 for the creation of vector valued functions? If so, the answer is currently no, but it could probably be added to the Sage preparser without much problem. Of course you can always define the function rot the ordinary way to take a vector and return a vector:

sage: rot = lambda v: vector([1/v[0],1,1]) 
sage: rot(vector([2,1,1]))
(1/2, 1, 1)
2012-10-29 07:06:08 +0200 received badge  Scholar (source)
2012-10-29 07:06:06 +0200 received badge  Supporter (source)
2012-10-01 17:40:09 +0200 received badge  Editor (source)
2012-10-01 17:39:11 +0200 commented answer functions with vector inputs

My mistake: the problem arises while calculating the divergence. It was a copy/paste failure. I will edit the question. I don't think this is the answer I was looking for.

2012-10-01 15:48:52 +0200 asked a question functions with vector inputs

Are vector functions supported in sage?

as in:

f1(r,phi,theta) = 1/r
f2(r,phi,theta) = 1
f3(r,phi,theta) = 1
F = vector([f1, f2, f3])
G=rot(F) # vector function

An ancient post seems to suggest that rot has to be defined with a positional python-argument like rot(*F).

Is there a way for "rot" to take the vector symbolically as an argument?