ecterrab

13316 Reputation

24 Badges

18 years, 81 days

MaplePrimes Activity


These are answers submitted by ecterrab

Use dsolve's option useint and you get a solution. However, instead of combine, use simplify(solution, size). The solution is large in size. The reason for using this option: some integrals appear in the solution without the option useint, and those integrals make it difficult to solve for the integration constants to match the initial conditions.

I note as well that a solution involving the integrals (so without the option useint) is at reach if you pass only 4 of the 6 initial conditions, then you may want to compute the integral using value, finally adjusting the two remaining integration constants interactively.

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

This is as @acer said; for this problem, solve returns something that, unfortunately, results in RootOf(0) when simplified. The problem is caught now, and PDEtools:-Solve returns NULL. This change is distributed to everybody using Maple 2022 within the Maplesoft Physics Udpates v.1288 or newer.

About this other issue, PDEtools:-Solve(sin(t)^2 + cos(t)^2 - 1, t);, mentioned by @Carl Love, that is an entirely different problem, with no RootOf involved. This other problem is also fixed. The fix is distributed in the same Physics Updates v.1288 or newer.

By the way, PDEtoosl:-Solve does not have another solver within. What PDEtools:-Solve has is several additional strategies extending the applicability of solve and some other solving Maple commands. Recalling from it's help page,

The PDEtools:-Solve command computes the value of solving_variables that solves a system of equations sys. The system being solved can involve algebraic or differential equations, or both. You can request an exact (default), numeric, or series solution (respectively use the option numeric or series). In this sense, Solve is a unified command that understands when to call solve, fsolve, dsolve, or pdsolve according to your input, also facilitating the analysis of different types of solutions by just adding the keywords series or numeric.

In addition ....[etc].

 

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

Hi Rouben,

After with(Vectors), type(A_, PhysicsVectors) works as you expect. I need to document all the Physics:-Library:-PhysicsTypes ... for which nops(with(Physics:-Library:-PhysicsTypes)) -> 114. These are the types used internally by the Physics package routines and are made available for programming purposes together with the Physics:-Library (this one is documented), which contains the internal routines of the Physics package, also documented for programming with them.

By the way, this type should also be mentioned in the Physics:-Vectors help pages - at this moment, it is mentioned on the page ?convert,PhysicsVectors.

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

 

You know the form of Dirac matrices in a Minkowski space with metric  (+++-) , either in a flat spacetime or in the local system of references implemented as the tetrad system.

So take the transformation that transforms the eta_ Minkowski metric (+++-) into (++--), you asked about the same in a previous question I answered a week or so ago, and apply it to the standard form of each Dirac matrix; then use Physics:-Define to define a new tensor (with spacetime or tetrad indices, depending on your problem) whose components are those transformed Dirac matrices. See the page ?Physics,Define and ?Physics,Tensors for the different ways of defining such a tensor.

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

 

This is your example, showing the ODE explicitly

 

ode := sqrt(y(x))+(1+x)*(diff(y(x), x)) = 0; ic := y(0) = 1

y(x)^(1/2)+(1+x)*(diff(y(x), x)) = 0

(1)

To start with, whenever you see something like sqrt(y(x)) you could expect issues: the implicit solution is basically always correct and the explicit solution has problems, because isolating y(x) may require ignoring branch cuts and the like.

 

So let's first see the implicit solution

implicit_sol := dsolve([ode, ic], implicit)

y(x)^(1/2)+(1/2)*ln(1+x)-1 = 0

(2)

odetest(implicit_sol, [ode, ic])

[0, 0]

(3)

 

Good. Try isolating y(x)

solve(implicit_sol, {y(x)})

{y(x) = (1/4)*ln(1+x)^2-ln(1+x)+1}

(4)

odetest({y(x) = (1/4)*ln(1+x)^2-ln(1+x)+1}, [ode, ic])

[(1/2)*csgn(ln(1+x)-2)*ln(1+x)-csgn(ln(1+x)-2)+(1/2)*ln(1+x)-1, 0]

(5)

You see the problem. In fact, if you insert (4) into (2) you see (4) is not really a solution of (2) but for some regions only

simplify(eval(implicit_sol, {y(x) = (1/4)*ln(1+x)^2-ln(1+x)+1}))

(1/2)*(csgn(ln(1+x)-2)+1)*(ln(1+x)-2) = 0

(6)

In the above I would expect 0, but the above is zero only when csgn(ln(1+x)-2) = -1

eval((1/2)*(csgn(ln(1+x)-2)+1)*(ln(1+x)-2) = 0, csgn = -1)

0 = 0

(7)

Now that the problem is understood, let's see your solution``

your_sol := y(x) = (1/4)*(ln(1+x)-2)^2

y(x) = (1/4)*(ln(1+x)-2)^2

(8)

simplify(eval(implicit_sol, your_sol))

(1/2)*(csgn(ln(1+x)-2)+1)*(ln(1+x)-2) = 0

(9)

As expected, it has the same problem, valid only when csgn(ln(1+x)-2)+1 = -1, More important: the "implicit form" of your_solution that you construct taking lhs-rhs is also not-a-solution, let's show it

(lhs-rhs)(your_sol) = 0

y(x)-(1/4)*(ln(1+x)-2)^2 = 0

(10)

Compare with the actual solution computed by dsolve

implicit_sol

y(x)^(1/2)+(1/2)*ln(1+x)-1 = 0

(11)

You see that you can go from (11) to (10) by squaring, but not the other way around taking square roots

sqrt(y(x)) = -(ln(1 + x)/2 - 1)

y(x)^(1/2) = -(1/2)*ln(1+x)+1

(12)

map(`^`,(12), 2);  # going from (11) to (10)

 

y(x) = (-(1/2)*ln(1+x)+1)^2

(13)

map(sqrt, (13));   # going back taking sqrt you do not get (11)

y(x)^(1/2) = ((-(1/2)*ln(1+x)+1)^2)^(1/2)

(14)

The reason being that x <> sqrt(x^2), as we know.

 

So your question could be reformulated as "when testing not-a-solution to an ODE + IC, why am I receiving different not-zero output from odetest depending on how I sent the not-a-solution ?"

 

The literal answer is the one you gave, of course, different sectors of the program are used when you pass an explicit instead of an implicit solution. The rationale for that: it is frequently the case that implicit solutions test OK, while explicit forms of them obtained e.g. thinking that x = sqrt(x^2) of course do not test OK. We want to be able to distinguish between these two cases. And for that we use different computational strategies: when testing implicit solutions we do not isolate the unknown, in that way avoid hitting wrong assumptions like NULLx = sqrt(x^2).

 

In summary: in cases like this one you post, when testing not-a-solution, you can expect different not-zero output from odetest depending on whether you pass the not-a-solution in explicit form or taking lhs-rhs

 

One could further ask: "Why is solve returning a solution that assumes NULLx = sqrt(x^2)? " The answer, I imagine, is historical reasons. Check for instance Mathematica: it also returns a solution that assumes  NULLx = sqrt(x^2) (although it presents a Warning message indicating the solution may be not valid for some values of x ). Maple's solve could present a warning too

solve(sqrt(x^2) = X^2, {x});  # this is ok

{x = X^2}, {x = -X^2}

(17)

This next is ok too in that it is better than NULL, but could present a warning: the solution is not valid for all values of X2.

solve(sqrt(x2) = X2, {x2});

{x2 = X2^2}

(18)

NULL


 

Download Your_problem.mw

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

The default signatures implemented in the Physics package have only one sign different, corresponding to the timelike component of the metric. However, it is possible to work with an arbitrary signature, where by that I mean an arbitrary (symmetric) form of the tetrad metric eta[a, b] of a local flat system of references. In particular, you mentioned the signature "(++--)", so below I derive that case but the procedure shown is the way to go in general.

 

with(Physics); with(Tetrads)

_______________________________________________________

(1)

Not necessary, but to simplify steps, set the signature as close as possible to the one you want

Setup(signature = "+++-")

 

At this point I could do all what follows with a Minkowski metric - the procedure is the same - but it would look artificially easy, so let's complicate only one bit by introducing some curvature, the Schwarzschild

metric, so that the metric (setting it and showing it at the same time via "g_[sc])", tetrad and tetrad metric have for components

g_[sc]

Physics:-g_[mu, nu] = Matrix(%id = 36893488151970552996)

(2)

   

The tetrad

e_[]

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 36893488153385360668)

(3)

The orthonormal tetrad metric, a.k.a "the signature"

eta_[]

Physics:-Tetrads:-eta_[a, b] = Matrix(%id = 36893488153385350796)

(4)

We want the latter, (4), to be "something else". In particular, you asked for `&eta;__a,b` = (Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = -1})). This case is easy, everything is diagonal. If not, the form of A that follows needs to be more general. So for this case search for a transformation matrixA of this form

A := Matrix(4, symbol = a, shape = diagonal)

Matrix(%id = 36893488153385343204)

(5)

The "new" `&eta;__a,b` is computed via

A.rhs(eta_[]).LinearAlgebra:-Transpose(A)

Matrix(%id = 36893488153385329836)

(6)

By eye, the solution A you are looking for involves the imaginary unit I and is

A := Matrix(4, {(1, 1) = 1, (2, 2) = 1, (3, 3) = I, (4, 4) = 1})

Matrix(%id = 36893488153385314052)

(7)

Check it out: this is the new eta

Eta[a, b] = A.rhs(eta_[]).LinearAlgebra:-Transpose(A)

Eta[a, b] = Matrix(%id = 36893488153385305380)

(8)

Not necessary, but to facilitate a posterior verification, define this Eta[a, b], as a tensor

"Define(?)"

{Physics:-D_[mu], Physics:-Dgamma[mu], Eta[a, b], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-Tetrads:-e_[a, mu], Physics:-Tetrads:-eta_[a, b], Physics:-g_[mu, nu], Physics:-gamma_[i, j], Physics:-Tetrads:-gamma_[a, b, c], Physics:-Tetrads:-l_[mu], Physics:-Tetrads:-lambda_[a, b, c], Physics:-Tetrads:-m_[mu], Physics:-Tetrads:-mb_[mu], Physics:-Tetrads:-n_[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(9)

Now, from the relationship that defines the tetrad `&efr;`[a, mu] in terms of the tetrad metric eta[a, b]

e_[definition]

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[b, `~mu`] = Physics:-Tetrads:-eta_[a, b]

(10)

you see that the transformation defining your new tetrad is

E[a, mu] = A.rhs(e_[])

E[a, mu] = Matrix(%id = 36893488151943554100)

(11)

Again, not necessary, but to facilitate manipulations, define it

"Define(?)"

{Physics:-D_[mu], Physics:-Dgamma[mu], E[a, mu], Eta[a, b], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], Physics:-Tetrads:-e_[a, mu], Physics:-Tetrads:-eta_[a, b], Physics:-g_[mu, nu], Physics:-gamma_[i, j], Physics:-Tetrads:-gamma_[a, b, c], Physics:-Tetrads:-l_[mu], Physics:-Tetrads:-lambda_[a, b, c], Physics:-Tetrads:-m_[mu], Physics:-Tetrads:-mb_[mu], Physics:-Tetrads:-n_[mu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(12)

So this is the relationship that must be satisfied by the new tetrad and new tetrad metric

"E[a, mu] * E[b,~mu] = Eta[a,b]"

E[a, mu]*E[b, `~mu`] = Eta[a, b]

(13)

TensorArray(E[a, mu]*E[b, `~mu`] = Eta[a, b])

Matrix(%id = 36893488153401475188)

(14)

Now that everything matches, just set the tetrad and the tetrad metric as these ones derived above, equations (8) and (11)

"Setup(tetradmetric= rhs(?), tetrad = rhs(?))"

[tetrad = {(1, 1) = -I*r^(1/2)/(2*m-r)^(1/2), (2, 2) = r, (3, 3) = I*r*sin(theta), (4, 4) = -I*(2*m-r)^(1/2)/r^(1/2)}, tetradmetric = {(1, 1) = 1, (2, 2) = 1, (3, 3) = -1, (4, 4) = -1}]

(15)

Now your tetrad and tetrad metric are set as you want, you are working with a signature "(++--)". You can check it out as follows

e_[]

Physics:-Tetrads:-e_[a, mu] = Matrix(%id = 36893488153401440124)

(16)

eta_[]

Physics:-Tetrads:-eta_[a, b] = Matrix(%id = 36893488153385358508)

(17)

e_[definition]

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[b, `~mu`] = Physics:-Tetrads:-eta_[a, b]

(18)

TensorArray(Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[b, `~mu`] = Physics:-Tetrads:-eta_[a, b])

Matrix(%id = 36893488153377682244)

(19)

Likewise,

e_[a, mu]*e_[a, nu] = g_[mu, nu]

Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu] = Physics:-g_[mu, nu]

(20)

TensorArray(Physics:-Tetrads:-e_[a, mu]*Physics:-Tetrads:-e_[`~a`, nu] = Physics[g_][mu, nu])

Matrix(%id = 36893488153356963580)

(21)

NULL


 

Download arbitrary_signature.mw

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

dsolve(ode, useInt);  # tests OK, the output involves uncomputed Int(1/(y^2 - 1)^(2/3), y)
value(%);                     # the solution you show, it is problematic

Summarizing, the issue is with the value of Int(1/(y^2 - 1)^(2/3), y).

By the way, dsolve's options useInt and implicit are the ones that help disentangling an issue in dsolve from issues in int or solve.

The latex command got entirely rewritten, from scratch, everything, in Maple 2021. Unfortunately, as a side effect, the latex performance in previous Maples is now out of target. If you post the worksheet you are "Exporting to LaTeX," one could try exporting it using a more modern Maple and post the result here.

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

See FunctionAdvisor(WeierstrassP) and the Digital Library of Mathematical Funtions - Chapter 23, Weirstrass Elliptic and Modular Functions. By clicking the plot section that you see when calling the FunctionAdvisor and comparing it with the plots shown by clicking Graphics in the DLMF you see it is the same function. Comparing 23.2.4 of the DLMF with the first formula shown on the Wikipedia page you posted, you see the Wikipedia one is the same. You can also compare with the definitions shown in the Maple help page for WeierstrassP.

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

Hi Rouben
This is about a new error message in convert/piecewise not caught in time within the internal routines after having computed a solution (for the piecewise form, not the Heaviside form, which requires an optional argument with a method). It is fixed, and the fix is distributed to everybody using Maple 2022 within the Maplesoft Physics Updates v.1257.

PS1: there are other methods that solve the same equation, it is an easy equation; try for instance dsolve(de, [exact]).

PS2: if you find something unclear on the page ?dsolve,parametric, please post the issue, thanks; I will then give it a look.

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

Your code above executes to the end on my computer. You receive, as you ask, the form of the determining PDE system whose solutions are the symmetries of the ODE system. According to the help page for DeterminingPDE, to search for a special form of the generator you can use its third argument, S described as an "(optional) list with the functional form of the infinitesimals of a symmetry generator". Examples (17) and (18), then (20) and (21) illustrate that.

So what is the special form of the generator you are saying in your question, that you can't figure out how to express it on the computer?

PS: this is your worksheet: Executes_fine.mw

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

I do not reproduce your problem. This is what I see:

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1254 and is the same as the version installed in this computer, created 2022, June 21, 12:46 hours Pacific Time.`

(1)

with(Physics); with(Vectors)

Your first input is `#mover(mi("u"),mo("&rarr;"))`(t, x, y, z).%Nablatimes `#mover(mi("u"),mo("&rarr;"))`(t, x, y, z)

Typesetting[delayDotProduct](u_(t, x, y, z).%Nabla, u_(t, x, y, z), true)

Physics:-`*`(Physics:-Vectors:-`.`(u_(t, x, y, z), %Nabla), u_(t, x, y, z))

(2)

lprint(%);

Physics:-`*`(u_(t,x,y,z) . %Nabla,u_(t,x,y,z))

 

Your second input means something different: the application of `#mover(mi("u"),mo("&rarr;"))`(t, x, y, z).%Nabla to `#mover(mi("u"),mo("&rarr;"))`(t, x, y, z), which in the context of Physics:-Vectors is handled by the dot operator, so you get this output

(u_(t, x, y, z).%Nabla)(u_(t, x, y, z))

Physics:-Vectors:-`.`(Physics:-Vectors:-`.`(u_(t, x, y, z), %Nabla), u_(t, x, y, z))

(3)

lprint(%);

(u_(t,x,y,z) . %Nabla) . u_(t,x,y,z)

 

It works fine using 1D input too

(u_(t, x, y, z) . %Nabla) * (u_(t, x, y, z))

Physics:-`*`(Physics:-Vectors:-`.`(u_(t, x, y, z), %Nabla), u_(t, x, y, z))

(4)

(u_(t, x, y, z) . %Nabla) . (u_(t, x, y, z))

Physics:-Vectors:-`.`(Physics:-Vectors:-`.`(u_(t, x, y, z), %Nabla), u_(t, x, y, z))

(5)

(u_(t, x, y, z) . %Nabla)(u_(t, x, y, z))

Physics:-Vectors:-`.`(Physics:-Vectors:-`.`(u_(t, x, y, z), %Nabla), u_(t, x, y, z))

(6)

NULL

 

Download It_works_fine.mw

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


 

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1236 and is the same as the version installed in this computer, created 2022, May 24, 16:31 hours Pacific Time.`

(1)

f := proc (x, y) options operator, arrow; 1/(2+x*y^2) end proc

(D[`$`(1, j), `$`(2, k)](f))(x, y)

pochhammer(-j, j)*(Sum(binomial(k, _k1)*(Sum(pochhammer(2*k-_k1+1, 2*_k1-2*k)*pochhammer(j-k+1, k)*(y^2)^(j-k)/(factorial(_k1-k)*(2*y)^(_k1-2*k)), k = 0 .. _k1))*(Sum(pochhammer(2*k__1-k+_k1+1, 2*k-2*_k1-2*k__1)*pochhammer(-j-k__1, k__1)*x^k__1*(x*y^2+2)^(-1-j-k__1)/(factorial(k-_k1-k__1)*(2*y)^(k-_k1-2*k__1)), k__1 = 0 .. k-_k1)), _k1 = 0 .. k))

(2)

eval(eval(eval(pochhammer(-j, j)*(Sum(binomial(k, _k1)*(Sum(pochhammer(2*k-_k1+1, 2*_k1-2*k)*pochhammer(j-k+1, k)*(y^2)^(j-k)/(factorial(_k1-k)*(2*y)^(_k1-2*k)), k = 0 .. _k1))*(Sum(pochhammer(2*k__1-k+_k1+1, 2*k-2*_k1-2*k__1)*pochhammer(-j-k__1, k__1)*x^k__1*(x*y^2+2)^(-1-j-k__1)/(factorial(k-_k1-k__1)*(2*y)^(k-_k1-2*k__1)), k__1 = 0 .. k-_k1)), _k1 = 0 .. k)), [j = 2, k = 4]), Sum = add), y = 0)

6

(3)

NULL


 

Download DoubleDerivativeComputed.mw

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

Hi
Note there is a green arrow in the toolbar of the window you use to post. Clicking it you can upload a worksheet with the problem. That helps others help you.

Independent of that, take a look at the help page for "?Physics:-ExteriorDerivative"; from what you show, the Physics command is a simpler approach.
 

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

Hi
This is an issue of the integrator, apparently in the piecewise handler. I added a workaround to it directly in the subroutine for integrating Dirac functions which is part of the Physics package. That resolves the isue and the change is included in the latest Maplesoft Physics Updates (v.1234) for Maple 2022.

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

5 6 7 8 9 10 11 Last Page 7 of 55