Hamzaan

5 Reputation

One Badge

11 years, 223 days

MaplePrimes Activity


These are replies submitted by Hamzaan

@Preben Alsholm 

Hi,

I've always found that different names work around the problem, but then that means working up to the 20th derivative needs 20 names when I just need to see if any of the derivatives a product (U(x)*V(x)) at zero contain both functions. If only one of one function (e.g. U(x)) appears at zero, the effect of the other (V(x)) is non-taylor expandable at 0. Or in more complicated case, attempt to make F(0),D(F)(0) and D^2(F)(0) >0 and all other derivatives vanish exactly.

 

Any way to get around the problem if they all had the same so I can use a loop?

 

Cheers,

Hamzaan

@Preben Alsholm 

 

Thanks for the help!

I can't use the form D(f)(x) as I'm trying to develop an ansatz which will give a constant at zero but cannot be seen via a standard Taylor series. In the above example V(x) would be a normal taylor expandable function but U(x) would be 1 at x=0 and all of it's derivatives would vanish.

 

Edit:

If I use unapply I now get:

______________________________________

>f(x)= x*U(x)

>FPrime:=unapply('eval(diff(f(y),y),y=x)',x):

>FPrime(0)

                 U(0)

>FPrime:=unapply('eval(diff(f(y),y),y=x)',x):
>FPrime(0)

Error, (in FPrime) too many levels of recursion

____________________________________

And if use

>FPrime:=unapply(eval(diff(f(y),y),y=x),x):

I get

Error, (in fPrime2) invalid input: diff received 0, which is not valid for its 2nd argument

Edit 2:

 

Using the code:

 

>FPrime:=unapply(PDEtools[dsubs](diff(U(x),x)=D(U)(x),diff(FPrime(x),x)),x)

 

Does work! I'm not hugely sure why Maple treats D(U)(x) different to d/dx(U(x)) and it is not very helpful if I wanted to generalise. Any other ideas?

 

Cheers,

Hamzaan

@Carl Love 

Firstly thank you and Preben Alsholm for your help. I feel I should apologise for the tone in my question, I was less maligned against Maple, more stressed after my original question was lost due to forum login timeout!

 

Regarding unapply, I had stopped using it in the code I was using because it was not working at the time. I can see the problem that (x)->f(x) is a procedure would definetly cause recursion. However, I just did some quick coding and got the following:

 

___________________________________________________________

>f:=U(x)*V(x):

>f:=unapply(f,x):

>FPrime1:=(x)->eval(diff(f(y),y),y=x):

>FPrime1(0)

                              (d/dy(U(y))|y=0)*V(0)+U(0)*(d/dy(V(y))|y=0)

>FPrime2:=unapply(eval(diff(f(y),y),y=x),x):

>FPrime2(0)

Error, (in FPrime2) invalid input: diff received 0, which is not valid for its 2nd argument

>FPrime3:=unapply(diff(f(x),x),x):

>FPrime3(0)

Error, (in FPrime3) invalid input: diff received 0, which is not valid for its 2nd argument

___________________________________________________________

 

Which was why I stopped using unapply in the first place. It is also looking a lot like the recursion is still occuring, how do I stop this?

 

Cheers,

Hamzaan

Page 1 of 1