ecterrab

14702 Reputation

24 Badges

20 years, 241 days

MaplePrimes Activity


These are replies submitted by ecterrab

@John Fredsted 


 

We are talking about the same thing.

restart; with(PDEtools)

declare((f, g)(x, y))

f(x, y)*`will now be displayed as`*f

 

g(x, y)*`will now be displayed as`*g

(1)

pde := (diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x))

(diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x))

(2)

Your pde is already a divergence: it satisfies Euler's equations

Euler(pde)

{0}

(3)

It also admits a rather general integrating factor, an arbitrary function of y, f*g:

IntegratingFactors(pde)

[_mu[1](x, y, f(x, y), g(x, y)) = _F1(y, g(x, y)*f(x, y))]

(4)

Check it out:

PDE := rhs(%[1])*pde

_F1(y, g(x, y)*f(x, y))*((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)))

(5)

Euler(PDE)

{0}

(6)

Now on the conserved currents

ConservedCurrents(pde)

[_J[x](x, y, f(x, y), g(x, y)) = Int(-(diff(_F1(x, y), y)), x)+_F2(y, g(x, y)*f(x, y)), _J[y](x, y, f(x, y), g(x, y)) = _F1(x, y)]

(7)

The above is of the form: ["`J__1`= ..., `J__2`= ...]". In your reply you write this current as the right-hand sides only, it is the same:

J := map(rhs, %)

[Int(-(diff(_F1(x, y), y)), x)+_F2(y, g(x, y)*f(x, y)), _F1(x, y)]

(8)

This result is correct, check it out:

diff(J[1], x)+diff(J[2], y)

(D[2](_F2))(y, g(x, y)*f(x, y))*((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)))

(9)

You see that this is equal to 0: it is the product of two factors, one of which is proportional to pde itself.

 

So this current not "almost gibberish" but just more general than the one you mentioned: [f(x, y)*g(x, y), 0]. Maple's result is correct for any value of the arbitrary mappings _F1 and _F2. The solution you posted is the one you get for _F1 = 0, _F2(y, f*g) = f*g 

 

To mention but one, just another example could be

J_bis := value(eval(J, [_F1 = `*`, _F2 = `+`]))

[-(1/2)*x^2+y+g(x, y)*f(x, y), x*y]

(10)

diff(J_bis[1], x)+diff(J_bis[2], y)

(diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x))

(11)

ReducedForm(%, pde)

`casesplit/ans`([0], [])

(12)

Instead of testing manually you can always test using ConservedCurrentTest

ConservedCurrentTest([-(1/2)*x^2+y+f(x, y)*g(x, y), x*y], pde)

{0}

(13)

On the weak side: ConservedCurrentTest doesn't return 0 for the general result, because reduced form gets confused with the D construction:

ConservedCurrentTest([_J[x](x, y, f(x, y), g(x, y)) = Int(-(diff(_F1(x, y), y)), x)+_F2(y, f(x, y)*g(x, y)), _J[y](x, y, f(x, y), g(x, y)) = _F1(x, y)], pde)

{(D[2](_F2))(y, g(x, y)*f(x, y))*((diff(f(x, y), x))*g(x, y)+f(x, y)*(diff(g(x, y), x)))}

(14)

But you see by eye that this is proportional to pde itself, therefore equal to zero.

 

About your more complicated examples you mention, I suggest you give them a try. Remember the format of the output of the form ["`J__1`= ..., `J__2`= ...]" and if you prefer to not display the functionality in the left-hand sides use

ConservedCurrents(pde, displayfunctionality = false)

[_J[x] = Int(-(diff(_F1(x, y), y)), x)+_F2(y, g(x, y)*f(x, y)), _J[y] = _F1(x, y)]

(15)

``


 

Download ConservedCurrentsIsOK.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@John Fredsted 

Given an expression - EE - as a differential expression (say of differential order k), compute a first integral, so another expression of differential order k-1 such that its total derivative is equal to the original expression EE. This is the general idea, also applicable to PDEs of course. In the case of ODEs, the command is DEtools[firint]. Complementary command: DEtools[intfactor]; related (say inverse) command: DEtools[redode];

In the PDE case, replace "total derivative" in the paragraph above by "divergence" and the command you need to give a look is PDEtools:-ConservedCurrents. Complementary commands are PDEtools:-ConservedCurrentTest, PDEtools:-IntegratingFactors and  PDEtools:-IntegratingFactorsTest. I never wrote the equivalent to redode for PDEs, but I explained the idea I used in sufficient details in the help page for redode ; it is not difficult to extend it to the PDE case.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@umar khan 

I only executed your worksheet: it works perfectly when indexing wiht 0 or ~0. I now intercalated some comments and attached it to this reply.

right_file_(reviewed).mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@trace 

If what you want to do is to see the result of applying some transformation, then just pass that transformation to TransformCoordinates. Or, If what you want is to derive the transformation, see the help page of what's new in Physics in Maple 2017: I put an explicit example of that, ie resolving the equivalence bewteen two metrics.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@umar khan 

Maple results are correct. Your worksheet does not show a flow from top to bottom (if you execute it, you do not obtain what you show) so I do not know what you are doing, nor what of the many lines is supposed to be wrong.

So I produced a clean worksheet, attached to this reply (below) with only the computation you show in right_christoffel_symbol.pdf, showing that it suffices to enter the metric and the coordinates and you automatically get the right christoffel symbols and Ricci tensor.


 

restart

with(Physics)

Set the coordinates

Coordinates(spherical)

`Default differentiation variables for d_, D_ and dAlembertian are: `*{X = (r, theta, phi, t)}

 

`Systems of spacetime Coordinates are: `*{X = (r, theta, phi, t)}

 

{X}

(1)

Input your metric

`#msup(mi("ds"),mn("2"))` := exp(2*v(r))*dt^2-exp(2*lambda(r))*dr^2-r^2*(dtheta^2+sin(theta)^2*dphi^2)

exp(2*v(r))*dt^2-exp(2*lambda(r))*dr^2-r^2*(dtheta^2+sin(theta)^2*dphi^2)

(2)

Setup(metric = exp(2*v(r))*dt^2-exp(2*lambda(r))*dr^2-r^2*(dtheta^2+sin(theta)^2*dphi^2))

[metric = {(1, 1) = -exp(2*lambda(r)), (2, 2) = -r^2, (3, 3) = -r^2*sin(theta)^2, (4, 4) = exp(2*v(r))}]

(3)

This is not necessary, but makes the display be as the one you show in your pdf 'right_christoffel_symbol.pdf

CompactDisplay(%)

lambda(r)*`will now be displayed as`*lambda

 

v(r)*`will now be displayed as`*v

(4)

CompactDisplay(prime = r)

`derivatives with respect to`*r*`of functions of one variable will now be displayed with '`

(5)

This are all the Christoffel symbols you show in the pdf, they are the same here and there:

"Christoffel[~1,alpha,beta,matrix]"

Physics:-Christoffel[`~1`, alpha, beta] = Matrix(%id = 18446744078302813470)

(6)

An these are the covariant components you show of the Ricci tensor

Ricci[]

Physics:-Ricci[mu, nu] = Matrix(%id = 18446744078389689390)

(7)

Finally, this is relationship you show in your pdf

Ricci[3, 3]-Ricci[2, 2]*sin(theta)^2

-sin(theta)^2*((diff(v(r), r))*exp(-2*lambda(r))*r-(diff(lambda(r), r))*exp(-2*lambda(r))*r+exp(-2*lambda(r))-1)-sin(theta)^2*(-(diff(v(r), r))*exp(-2*lambda(r))*r+(diff(lambda(r), r))*exp(-2*lambda(r))*r-exp(-2*lambda(r))+1)

(8)

simplify(%)

0

(9)

``


 

Download Maple_results_are_correct.mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@umar khan 
To insert an equation label, you need to use the shortcut Ctrl + L (or Command + L on a Mac), followed by the equation number. For more details see the help page ?worksheet,expressions,equationlabels

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@nm 

What you see in Maple 2017 is the correct result, in connection with an issue fixed after the help page was ready (unfortunately we forgot to update the help page - I will make sure the page gets updated regarding this fix for 2017.1).

About your other question, progress is made at every release, and with priority for what pops up in discussions or people use more. By the way: regarding this or other suggestions for improvements, easy or difficult, it is always useful to give a reference to any method you suggest to be implemented. Work will mostly always start there.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi
Thanks for pointing this out, this is indeed a bug, and it is now fixed. The fix is available for download for everyone at the Maplesoft R&D Differential Equations and Special Functions webpage (the special functions updates are bundled with the Physics updates).

By the way, I didn't try the Mathematica app you mention but if it evaluates this to 311/312, that result is wrong. The correct result is the one mentioned by Preben Alsholm: 71/72.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions

@John Fredsted 
Where is Physics:-`^` used in your question? What copy and paste are you referring to? Generally speaking: a) yes, Physics:-`^` is used when you enter powers, because there may be noncommutative operands at play, but as soon as the command detects they are not present, it returns the power expressed using :-`^`, that is the standard power operator that only handles commutative operands, so it is not expected to appear in the output of a GR computation (unless you use noncommutative operands ...) nor in the output of copy and paste, unless you are delaying the power surrounding  with quotes, as in 'A^B' or the like.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@deniscr 
I thought your question was about how to enter the parameter E: it is TransformTetrads who enters the parameter, it uses the letter E, and if E is already in use it uses E__1, if it is in use it uses E__2, and so on.
If your question is about "how to give E a value after it was entered in the worksheet by TransformTetrads", the answer is to use the subs or the eval commands, as in subs(E = 5, <here you refer to the output_of_TransformTetrads for instance using `%` or the equation number>), or eval with the same arguments swapped, or just assign E := 5 and use the output of TransformTetrads that automatically will take E = 5.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@illuminates 

Psigma[mu] is a tensor (4-vector), you can work with it as with any other tensor, and if uppercaselatin represents spacetime indices and you defined p as a tensor (Define(p)), then Psigma[A] p[A] is a valid tensorial expression with contracted indices. Try for instance SumOverRepeatedIndices(Psigma[A] p[A]) and you see the four Pauli matrices around

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@illuminates 
In the help, search for 'labels' and you will see the third entry is about equation labels; scan the page with your eyes looking for enumerated items, the one with number 3 is the answer to your question: use Ctrl + L (or Command+L in the mac) to open a window where you write the number (not the opening and closing parenthesis - just the number), then press enter and in that way you insert an equation label. I find these equation labels one of the best features of the Maple GUI.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

If I remember correctly, you posted this somewhere else ... Anyway, the reply I gave: this is a weakness in asympt, not in FunctionAdvisor. So try asympt(EllipticE(z, k), k) and you see where the time is taken.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Hi

It helps if you could please post the worksheet (note also that the images with formulas are not visible).

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

@vv 

What you got from Maple is what you asked to it. Look closer: when g is a rigid instruction mapping as the one you posted 


g := a -> int(f(x+a),x=a..2*a) 

by entering g(x) you can only expect the letter a replaced by the letter x, regardless of mathematics. You entered a programming instruction (the arrow operator). Anything else in the output different from replacing a by x would be just wrong, a corruption of the programming language.

Now, if what you wanted is what you refer to as 'mathematically correct substitution', then the g procedure you use should have been written differently, for instance as in

g := a -> eval(int(f(x+_a), x = a .. 2*a), _a = a)

so that eval could take care of the 'mathematically correct substitution' you expect, precisely because eval is the command that takes into account mathematical meaning at the time of making substitutions, instead of performing rigid blind substitutions (as subs or the mapping g that you posted do). 

Hope this clarifies your question?

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft
Editor, Computer Physics Communications

First 37 38 39 40 41 42 43 Last Page 39 of 65