Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ok, According to the codes I gave in my last edit above I checked the following code and it worked:

reset
var('x,y,z,t')
U=[U0,U1,U2,U3]
for i in range(4):
    U[i]=function('U%s' %i, x,y,z,t)

now trying the command "show( diff(U[0],x,1,y,3) + integral(U[0],x,-oo,oo) )" works nicely! However, it is not beautiful to use the command "U=[U0,U1,U2,U3]" when the number of unknowns gets large, so that I rewrote the above code like the following and it worked again:

reset
var('x,y,z,t')
U=[]
for i in range(4):
    U.append(function('U%s' %i, x,y,z,t))

Ok, According to the codes I gave in my last edit above I checked the following code and it worked:

reset
var('x,y,z,t')
U=[U0,U1,U2,U3]
for i in range(4):
    U[i]=function('U%s' %i, x,y,z,t)

now trying the command "show( diff(U[0],x,1,y,3) + integral(U[0],x,-oo,oo) )" works nicely! However, it is not beautiful to use the command "U=[U0,U1,U2,U3]" when the number of unknowns gets large, so that I rewrote the above code like the following and it worked again:

reset
var('x,y,z,t')
U=[]
for i in range(4):
    U.append(function('U%s' %i, x,y,z,t))

Also I checked and see if nargs=2, as an example, was used instead of specifying the arguments, it was then not going to give anything as result other than an error. So still I think one should use dummy variables to define the functions, then try substituting them by real variables whenever needed, it is only important to know the number of each function argument (I am not sure if one can also define more than required, if not sure exactly how many may be required, and after differentiation and integration assume the extra ones as parameter and equate them with unity, I mean at the end!)