Re: [sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-25 Thread Nils Bruin
On Monday, January 25, 2021 at 7:16:00 AM UTC-8 ... wrote: > Is this the same as derivative(f(xp(x, y, z, t), yp(x, y, z, t), zp(x, y, > z, t), tp(x, y, z, t)) , x, 2)? > > No, it is not. Look up "Multivariable Chain rule". -- You received this message because you are subscribed to the Google

Re: [sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-25 Thread Christian Seberino
> > Secondly, what are you trying to collect? The D[0,0] terms or > f(xp, yp, zp, tp), x, 2) which are two different things? What is the difference between those 2? > Given > what you are trying to do I guess it is the first one, in which > case you should have tried > > sage: term =

Re: [sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-24 Thread Christian Seberino
What are computed operators? Are those the D[0, 0] things? How avoid those? Is that same as second derivative of 1st variable? On Sun, Jan 24, 2021, 11:33 AM Emmanuel Charpentier < emanuel.charpent...@gmail.com> wrote: > Probably because “the given second derivative” has a “computed operator”…

[sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-24 Thread Nils Bruin
I suspect you want to collect wrt. the second partial derivatives of f(x,y,z,t) with respect to x,y,z,t ; evaluated at xp,yp,zp,tp. Those are not the same as the partial second derivatives of f(xp,yp,zp,tp) with respect to (x,y,z,t). If you inspect what derivative(f(xp, yp, zp, tp), x, 2)

Re: [sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-24 Thread Vincent Delecroix
Dear Christian, Given the specifications, I suspect that the function collect only works for variables. And indeed sage: expr = (x+y)*(z+t) + (x+y)*(1+z^2) + 2 sage: expr (z^2 + 1)*(x + y) + (t + z)*(x + y) + 2 sage: expr.collect(x+y) (z^2 + 1)*(x + y) + (t + z)*(x + y) + 2 Instead

Re: [sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-24 Thread Emmanuel Charpentier
Probably because “the given second derivative” has a “computed operator”… BTW : var("x,y,z,t,v,c") f=function("f") xp=(t-v*x)/sqrt(1-v^2/c^2) yp=y zp=z tp=(t-v*x/c^2)/sqrt(1-v^2/c^2) foo=(sum(map(lambda u:derivative(f(xp,yp,zp,tp),u,2), (x, y,

Re: [sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-24 Thread Christian Seberino
Emmanuel But my question is more simple than that. I just want to know why the collect method was not able to collect all the terms with the given second derivative. On Sun, Jan 24, 2021, 2:15 AM Emmanuel Charpentier < emanuel.charpent...@gmail.com> wrote: > Sage has recently acquired a large

[sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-24 Thread Emmanuel Charpentier
Sage has recently acquired a large set of tools relative to manifolds . A look at these tools and related tutorials/references may be in order… HTH, Le samedi 23 janvier 2021 à 23:17:26 UTC+1, cseb...@gmail.com a écrit : > What you intend to do isn’t really

[sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-23 Thread Christian Seberino
> > What you intend to do isn’t really clear… Could you try and clear your > goals ? > Emmanuel Thanks so much for your help. I'm trying to show that the wave equation (https://en.wikipedia.org/wiki/Wave_equation) is invariant under a certain coordinate transformation called the Lorentz

[sage-support] Re: Trouble getting *collect* to work with derivatives.

2021-01-23 Thread Emmanuel Charpentier
I think that your code doesn’t do what you think it does. Note for example that your declarations are self-contradicting : Pasting code; enter '--' alone on the line to stop or use Ctrl-D. :function("xp yp zp tp f") :var("x y z t v c") :-- (xp, yp, zp, tp, f) (x, y, z, t, v, c) sage: