how to import a math command "df(x,y)/dx + int_a^b f(x,z) f(y,z) dz" in sage when f is an unknown function of two variables in 3d space?
Hi,
As a newbie to sage and python I asked a question here around two days ago, and had a chat about it in sage's IRC channel, however, after I learned more from the guys therein and checking different situations by myself I understood my previous question somewhat nonsense, so I am now editing it!
I am working on a multipoint theory of turbulence in fluid mechanics, so I have functions that are simultaneously defined on multi point of space, like f(x,y,z; x1,y1,z1; ), however these functions --which are my main unknowns to be found from a set of many (I mean from some ten to maybe some millions!) coupled nonlinear integro-partial differential equations-- sometimes live as integrand to some integrals and sometimes are differentiated and the important thing is that their arguments vary from place to place in an equation and/or in different equations. Maybe I should classify my difficulties into two cases:
how to define many functions automatically and symbolically without specifying their arguments?
how to not specify the arguments to a function and at the same time be able to differentiate it or take its integral?
the answer to the first equation according to what I have read in this website and has been told from the guys in IRC channel is either of the followings:
reset
var('x,y,z,t, x1,y1,z1,t1, x2,y2,z2,t2, x3,y3,z3,t3')
for k in range(10):
function('f%s' %k, nargs=2)
# one can even refuse to determine the number of arguments and let it open by omitting nargs!
or
reset
var('x,y,z,t, x1,y1,z1,t1, x2,y2,z2,t2, x3,y3,z3,t3')
for k in range(10):
s = 'def f%d(*args):\n print args\n' % k
exec(s)
at the end of each of these codes one would have 10 functions f0,f1, ,f9 which can be given their arguments and be worked with. For example one can write f2(x,y)+f2(y,z1) which introduce once x and y and another time y and z1 to the same function f2 in one logical line in sage! This is why the second problems seems not to be solvable using the above methods as e.g. f2.diff(x) is nonsense as long as a specific law is not defined for f2, like f(x,y)=2xy^3 ! And it is nonsense to sage as it gives error when one tries to write f2.diff() before defining such a prescribed law for f2, it says function object and NewSymbolicFunction object have no attribute 'diff'
The only way that I can think about is to give my functions a set of dummy variables and replace them with the variables of interest in each equation or differentiation and integration, however, I am not sure it would work as the function is unknown and I don't know if the procedure of ...