110 Reputation

6 Badges

6 years, 150 days

MaplePrimes Activity

These are questions asked by rahinui


     The following system of ODEs is handled correctly by dsolve, but PDEtools:-Solve raises an error:

ranking := [{A(), B(x)}]:
eqn_sys := {D(B)(x) = 0, A()* D(B)(x) = 0}:
dsolve(eqn_sys, ranking);
# {A() = A(), B(x) = _C1}
PDEtools:-Solve(eqn_sys, ranking);
#Error, (in dsolve) found many possible indications of the solving variables as [{B(x)}, [{A(), B(x)}]]

In particular, it seems the error is raised when 1) the ranking is a nested list and 2) at least one of the ranking elements is a function without any arguments.

Admittedly, this is a very strange case, but I did run into this earlier today. Of course, the example here is contrived (the nested-list ranking is completely unnecessary for this example), but it illustrates the error.

As a workaround, I found replacing the function A() with its name A in the ranking solves this problem (it can be left as a function in the system of equations). Nevertheless, I thought I would point this out as it seems dsolve handles this just fine even without the workaround, and presumably PDEtools/Solve should be able to as well.

This seems similar to a previous bug; this bug was fixed in Maple 2018. Unfortunately, I haven't updated yet, so I can't verify if the patch solves this problem as well.


     So, dsolve is able to pass arguments through to casesplit. Further, PDEtools/Solve is able to pass arguments through to dsolve. However, it appears PDEtools/Solve isn't able to pass arguments through dsolve to casesplit? For instance, consider the following differential equation:

eq := {diff(A(t),t) = A(t)*x}:
dsolve(eq, {A(t)}, ivars={x,t});
PDEtools:-Solve(eq, {A(t)}, ivars={x,t});

Here, I'm considering both x and t to be independent variables (hence, A(t) should not depend on x).

In that case, dsolve correctly gives the only solution as A(t) = 0. However, PDEtools/solve doesn't seem to pass-through the ivars option and incorrectly gives A(t) = _C1*exp(x*t) as a solution.

Is there another way to have PDEtools pass this option through to casesplit?



     I'm attempting to solve a rather trivial trigonometric equation, but solve seems to be behaving rather inconsistently. If I attempt this equation

eq := G*cos(x+C1) = A*sin(x):
vars :=  {G, C1, x}:

solve(eq, vars);

it returns the correct, expected result

{C1 = -1/2*Pi, G = A, x = x}, {C1 = 1/2*Pi, G = -A, x = x}, {C1 = C1, G = G, x = arctan(cos(C1)*G/(G*sin(C1)+A))}

However, if I remove x from the list vars of variables for which to solve, I expect it to return the first two elements, {C1 = -1/2*Pi, G = A}, {C1 = 1/2*Pi, G = -A}. However, this isn't what happens. Instead, solve returns {C1 = C1, G = A*sin(x)/cos(x+C1)}; it's true that this is a valid solution, but it seems to be missing the two I want. Is there a way to recover the desired solutions?

And a related question: even without removing x from vars, solve appears to have trouble with the equation. Simply changing sin to cos, as so

eq := G*cos(x+C1) = A*cos(x):
vars :=  {G, C1, x}:

solve(eq, vars);

Now only returns

{C1 = C1, G = G, x = arctan((G*cos(C1)-A)/sin(C1)/G)}, {C1 = C1, G = G, x = arctan((-G*cos(C1)-A)/sin(C1)/G)}

That is, it is missing the expected solutions {C1 = 0, G = A}, {C1 = Pi, G = -A}. Is there a reason for this difference?

Thank you very much!

Hello, I have a simple system that I'm attempting to solve:

eq:={r*cos(c) = a, r*sin(c) = 0}:

If I pass this system to solve(eq, {r,c}), it correctly returns the results {c = 0, r = a}, {c = Pi, r = -a}. However, PDEtools:-Solve(eq, {r,c}) does not find a solution. Even adding the option 'solver'='solve' doesn't help.

According to its help page, PDEtools/Solve is a unified command for solving algebraic or differential equations, so I would expect it to easily handle this system. Is there an additional option I should be passing PDEtools/Solve to make it work like solve in this case?


Say I have an expression like


and I want to evaluate it where the function f(x)=0 (without a priori knowing f(x)). Since cos(0)=1, I expect the answer to be simply diff(f(x),x); in general this won't be identically zero. However, if I try


it replaces f(x) with zero everywhere, including in the derivative (as expected from the documentation) and returns 0.

So, my question: is there a way to evaluate an expression at a known value of a function (f(x)=0) without knowing the function?

It seems using convert/D manages to solve it, but I imagine there's a better way to do this. I've tried using RootOf(f(x)), but can't seem to make that work.

1 2 3 4 5 Page 4 of 5