Maple 2020 Questions and Posts

These are Posts and Questions associated with the product, Maple 2020

In the OrthogonalExpansions package, how can I change the summation variable to be n instead of i?

According to Wikipedia, Abel's first order odes have general analytical solutions, due to "Panayotounakos, Dimitrios E.; Zarmpoutis, Theodoros I. (2011)" where the claim is that, if I understand it right, all Abel ode's can be solved analytically.

https://en.wikipedia.org/wiki/Abel_equation_of_the_first_kind

"Construction of Exact Parametric or Closed Form Solutions of Some Unsolvable Classes of Nonlinear ODEs (Abel's Nonlinear ODEs of the First Kind and Relative Degenerate Equations)"

Maple is very good on solving ODE's, but some Abel ode's it can not solve. For example

restart;
ode:=diff(y(t),t)= y(t)^3+exp(-5*t);#_Abel
ode:=diff(y(x),x) = (1+x^3*y(x))*y(x)^2;#_Abel
ode:=diff(y(x),x) = y(x)^2-a*x*(1-x^(n-1))*y(x)^3;#_Abel
ode:=diff(y(x),x) = a*y(x)^2+x*y(x)^3*(b+c*x^(n-1));#_Abel
ode:=diff(y(x),x) = f0(x)+f1(x)*y(x)+f2(x)*y(x)^2+f3(x)*y(x)^3;#_Abel
ode:=(tan(x)*sec(x)-2*y(x))*diff(y(x),x)+sec(x)*(1+2*y(x)*sin(x)) = 0;#_Abel, `2nd type`, `class A`
ode:=x*(a+y(x))*diff(y(x),x)+b*x+c*y(x) = 0; #[_Abel, `2nd type`, `class B`]
ode:=(g0(x)+y(x)*g1(x))*diff(y(x),x) = f0(x)+f1(x)*y(x)+f2(x)*y(x)^2+f3(x)*y(x)^3;#_Abel, `2nd type`, `class C`

etc..

All the above Abel ode's are from Book: Ordinary differential equations and their solutions. By George Moseley Murphy. 1960

I am just asking what is the status of this. Is it true there is now a method to solve all these exactly and may be Maple's implementation is not in yet for this? 

btw, I found the description of solution methods in https://fr.maplesoft.com/support/help/Maple/view.aspx?path=odeadvisor/Abel much easier to follow to learn how to solve Abel ode's. That paper mentioned on Wikipeida, I had hard time following after the 3rd page. (need more time to study it).

Could someone please comment on the status of solving Abel's first order ODE's in Maple and if it possible now to solve them all analytically?

 

 

 

 

 

Why when trying to substitute a term in denominator, subs does not work, when this term is product. But it works when this term is single variable?

subs((x*y)=t,1/(x*y));

does not work. i.e. it does not return 1/t

But this works

subs(z=t,1/z);

and returns 1/t

algsubs does not work either on the first example above. 

Just wondering why, that is all.

 

I do not think Maple help on the subject is easy to follow as the exampels are not clear. I was hoping someone can give a very simple example.  

Now, I run long script, over say 1,000 problems. This takes long time each time I run it. Since each problem is completely independent of others, and there is no shared data at all (for each problem, its output is written to separate file), I am thinking of using the parallel programming in Maple, and hoping this will speed it up. I have an intel PC, with modern CPU. I think it has may be 10 or 16 cores, not sure now, so in theory it should be faster to complete.

For a very basic example, suppose I have this sequential program

foo:=proc(i::integer)
   return i^2;
end proc;

for i from 1 to 10 do
   foo(i);
od;

Where foo() is now called 10 times, one after the other. How would one change the above to make it run in parallel?

I know I need to call Threads:-Task:-Start and then use Threads:-Task:-Continue 

But I am not sure how to use Threads:-Task:-Continue to tell it to call foo in parallel passing each task 1,2,3,.... in turn, and wait until they are all done. This is the part not clear to me how to do even after looking at the help example under Task Programming Model

Could someone show how to do the above for this simple example?   

Since I have 1,000 problems, do I need to create 1,000 tasks at once, one for each problem and wait for them to all be done? what if I have 10,000 problems, creating 10,000 tasks at once might not work, would it? or will Maple handle this internally by queuing the creation of tasks as needed? This part is also not clear to me.

 

thanks

 

Hello!

I just want to try plot a conformal map for better understanding how it works.

For example, I want to plot a conformal map, so I do this:

restart;
assume(y, real);
assume(x, real);
f := z -> I + z*exp(1/4*I*Pi);
w := f(x + y*I);
u := Re(w);
v := Im(w);
A := array(1 .. 2);
A[1] := plots:-conformal(z, z = 0 .. 1 + I/2, grid = [16, 16], numxy = [16, 16], scaling = constrained);
A[2] := plots:-conformal(f(z), z = 0 .. 1 + I/2, grid = [16, 16], numxy = [16, 16], scaling = constrained);
plots:-display(A);

It works fine. But if I want to map more complecated region, I have lot's of problem. Could you help me please.

For example:

how to map a triangle [0,0], [1,0], [0,i] or half-plane Im z> 1, excluding the circle | z - 2i | <= 1.

Thank you!

Maple seems to suffer from too many levels of recursion issues. Here is another just found

restart;
current_solution:=y(x)-3/2 = 1/(x+2)^4*(-(x+2)^5*RootOf(-2+(x^5*C[1]^5+10*x^4*C[1]^5+40*x^3*C[1]^5+80*x^2*C[1]^5+80*x*C[1]^5+32*C[1]^5)*_Z^25+(5*x^5*C[1]^5+50*x^4*C[1]^5+200*x^3*C[1]^5+400*x^2*C[1]^5+400*x*C[1]^5+160*C[1]^5)*_Z^20)^20*C[1]^5+1)/RootOf(-2+(x^5*C[1]^5+10*x^4*C[1]^5+40*x^3*C[1]^5+80*x^2*C[1]^5+80*x*C[1]^5+32*C[1]^5)*_Z^25+(5*x^5*C[1]^5+50*x^4*C[1]^5+200*x^3*C[1]^5+400*x^2*C[1]^5+400*x*C[1]^5+160*C[1]^5)*_Z^20)^20/C[1]^5;

candidate_sol := limit(current_solution,C[1] = infinity);

Error, (in depends) too many levels of recursion

The problem with these is that they can not be cought by a try/catch. So the whole program/script comes to halt since error can not be cought.

Similar ones I found can be found here

https://www.mapleprimes.com/questions/229988-Error-in-Toolsmap-Too-Many-Levels
Error, (in tools/map) too many levels of recursion

https://www.mapleprimes.com/questions/229872-Error-in-Discontzero-Too-Many-Levels
Error, (in discont/zero) too many levels of recursion

https://www.mapleprimes.com/questions/229951-Random-Error-Error-in-EngineDispatch
Error, (in Engine:-Dispatch) too many levels of recursion

 

I am  not sure why these happen too often. Maple 2020.1 on windows 10. Physics version 724

 

 

 

restart;
expr:=a^2*(2*a^2*p^3-a^2*((p^2+1)^2*(a^2-1))^(1/2)-((p^2+1)^2*(a^2-1))^(1/2)*p^2+2*p*a^2-2*p^3+((p^2+1)^2*(a^2-1))^(1/2)-2*p)/((p^2+1)^2*(a^2-1))^(1/2)/(p^3-((p^2+1)^2*(a^2-1))^(1/2)+p)/(a^2-p^2-1);
int(expr,p)

Gives

why does Maple give division by zero?

Here is the result from integration package on Mathematica

ClearAll[a, p];
expr = a^2*(2*a^2*p^3 - 
       a^2*((p^2 + 1)^2*(a^2 - 1))^(1/2) - ((p^2 + 1)^2*(a^2 - 1))^(1/
           2)*p^2 + 2*p*a^2 - 2*p^3 + ((p^2 + 1)^2*(a^2 - 1))^(1/2) - 
       2*p)/((p^2 + 1)^2*(a^2 - 1))^(1/
        2)/(p^3 - ((p^2 + 1)^2*(a^2 - 1))^(1/2) + p)/(a^2 - p^2 - 1)
<< Rubi`
Int[expr, p]

Which it can integrate. Result is a little long. (removed since looks too long)

But my question really is not why Maple could not integrate it, but why the division by zero? 

Maple 2020.1

(Context: As part of a EU consumer watchdog report I've been asked to re-validate a number of publically stated APR rates for various consumer loan. )

(Apologize if this should have been posted to some bug-tracker but I was unable to find such a forum.)

System: MacOS 10.14.6, Maple 2020.1

Summary: Some simple exponential summations entered in 2D Input seems to crash the kernel and it is dependent on the numerical value of the exponent. The same expressions entered in 1D plaintext Maple Notation works fine. The numerically/expression evaluations are also significantly slower in 2D Input in a Document (x10) as compared to 1D Maple Notation in a Worksheet.

The attached worksheet is a "killer" worksheet and will on OSX 10.14.6 + Maple 2020.1 kill the kernel connection (crash the kernel).

kernel-crash.mw

Example:

A trivial example, entering 2D Math (assume PV & C are positive real numbers), say

will cause a lost connection to the kernel after 40-50s entering the epression and the UI being busy (unclear what it is doing since no real calculation is performed) which I assume is a sign that the kernel crashed. It seems to dependent on the exponent in the divisor. So for example the following variation will not crash the kernel

Doing the exact same calculation with a worksheet in old plain maple notation both varianta are both significantly faster in the numerical operation (solving for 'r') and assigning 'eq2' and never crashes (regardless of numerical value of exponent).

The workaround is of course obvious but it would be nice if this bug could be adressed.

It seems that whenever I try to give the 2D-UI a chance (since it is actally easier to visually view complex expressions)  something always comes back and bites me...

Update: The crash is only repeatable with the "sum()" command and not the "add()" command.

 

 

 

This is a programming question.

The goal is to solve an equation such as eq:=x^2+2*x-1=0; and obtain the solution as list with x= on each solution, like this

                       sol := [x = sqrt(2) - 1, x = -1 - sqrt(2)]

The command  to start with is sol:=solve(eq,x) which gives 

                       sol := sqrt(2) - 1, -1 - sqrt(2)

But to have x= show up, the command is modifed to be sol:=solve(eq,{x}) by adding {} around the variable to solve for, and now Maple gives 

                       sol := {x = sqrt(2) - 1}, {x = -1 - sqrt(2)}

Which is not yet the goal.. Changing the command to sol:=[solve(eq,{x})]  gives 

                       sol := [{x = sqrt(2) - 1}, {x = -1 - sqrt(2)}]

Which is still not the goal. Changing the command to sol:=solve(eq,[x])  gets closer to the goal.  it gives

                      sol := [[x = sqrt(2) - 1], [x = -1 - sqrt(2)]]

To remove the extra pair [ ] the list is Flattened like this

eq:=x^2+2*x-1=0;
sol:=solve(eq,[x]);
sol:=ListTools:-Flatten(sol)

Which gives me what I want, which is one list (not list of lists), and with x= in there

                             sol := [x = sqrt(2) - 1, x = -1 - sqrt(2)]

Is there a better way to obtain the above form of result than what I have above?

 

I need to check if expression is "special" kind of polynomial. Where powers are allowed to be non-integers and can be fractions. This is not polynomial in the mathematical sense ofcourse so can not use type(expr,polynom) on it, and did not see a way to tell type(expr,polynom) to accept non-integer exponents.

For an example, given p(x):=x^2+x^(1/3)+3+sqrt(x)+x^Pi+1/x*sin(x): it will return false, due to sin(x) term there. Without this term, it will return true, since all other terms have the form x^anything.

Currently, this is what I do

expr:=x^2+x^(1/3)+3+sqrt(x)+x^Pi+1/x*sin(x):

if type(expr,polynom(anything,x)) then
   print("Yes, normal polynomial");
else
   what_is_left:=remove(Z->type(Z,{`^`('identical'(x),algebraic),'identical'(x)}),expr);
   if has(what_is_left,x) then
      print("Not special polynomial");
   else
      print("Yes, special polynomial");
   fi;
fi;

While with

expr:=x^2+x^(1/3)+3+sqrt(x)+x^Pi+1/x:

It will print "Yes, special polynomial"

Is the above a good way to do this, or do you suggest a better way? It seems to work on the few tests  I did on it so far.

It is always "polynomial" in one symbol, such as x. So if it contains any function of x, other than  x^exponent, where exponent can only be numeric, or other symbol, it will fail the test. So this below will pass the a above test as well

expr:=x^2+x^(1/3)+3+sqrt(x)+x^a+1/x:

 

I was just praising Maple for not rewriting/simplifying  expressions automatically without the explicit user asking for it, when I found the following strange result

expr:=arccos(a-p) does not cause any change in the input. Good.

But when I change the letter ordering to expr:=arccos(p-a) now Maple changed it to Pi - arccos(a - p)

I have no idea why. Is there an option to tell Maple not to do that, even if it is mathematically correct? 

restart;
expr:=arccos(a-p);

restart;
expr:=arccos(p-a);

It seems to use lexicographical ordering to re-write things. Is it possible to turn that off?  Notice that I did not ask for simplification or anything. 

Maple 2020.1, Physics 724

I was checking my solution against Maple. Maple gives solution with integral and RootOf. I am not able to simplify it to better compare.

restart;
ode:=y(x)=ln(cos(diff(y(x),x)))+diff(y(x),x)*tan(diff(y(x),x));
sol:=dsolve(ode);

It is the second solution above I want to simplify/evaluate. So I tried

restart;
ode:=y(x)=ln(cos(diff(y(x),x)))+diff(y(x),x)*tan(diff(y(x),x));
sol:=dsolve(ode);
sol:=[sol][2];
DEtools:-remove_RootOf(sol)

But this did nothing. Then I tried adding useint in the dsolve command

restart;
ode:=y(x)=ln(cos(diff(y(x),x)))+diff(y(x),x)*tan(diff(y(x),x));
sol:=dsolve(ode,useint);

But this also kept the integral there. Then I tried eval

restart;
ode:=y(x)=ln(cos(diff(y(x),x)))+diff(y(x),x)*tan(diff(y(x),x));
sol:=[dsolve(ode,'explicit')];
eval(sol[2])

The solution I obtained is 

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

Which does verify to zero OK using odetest.

Any suggestions/tricks to use to get an more explicit solution from Maple I am overlooking?

Maple 2020.1 , Physics 724

I can post/attach my full solution if needed. 

 

 

Hello,

I have a particular problem that I haven't managed to find the solution to by googling.

9/10 times that I open Maple 2020 I can't seem to open any of my saved documents. it opens the start tab, and I'm still able to open a new document or worksheet, but then when I try to change to text instead of math, it won't let me. I can type, but I can't press backspace or enter.

I have tried restarting and shutting down my computer, but every time I have to just force quit Maple because it won't respond half of the time and it won't quit normally.

I'm running the latest version of Maple and using macOS Catalina version 10.15.5.

I have no problems assigning simple plots to variables and then displaying all in a single plot using the display command.

However, I am now trying to do the same using implicitplot without success.

This is my code;

restart;
f := 3*(x^2 + y^2)^2 = 100*x*y;

with(plots, implicitplot);
p1 := implicitplot(f, x = -4 .. 4, y = -4 .. 4, rangeasview = true):

p2 := pointplot([[1, Pi/2], [-1, -Pi/2]], color = red):

display({p1,p2})

What I get is a small implicit plot and the code for the pointplot back at me.

Is there any way to make this work?

Thank you for your help.

Jose

 

I solved this ODE and got a solution and wanted to compre it with Maple. This is initial value first oder ODE. So it should have no constants in it. But Maple's solution contains something I never seen before _B1~

I wonder what it means? And odetest did not verify Maple's solution. 

restart;
ode:=diff(y(x),x)-y(x)/x+csc(y(x)/x)=0;
sol:=dsolve([ode,y(1)=0]);
simplify(odetest(sol,ode));

odetest does not gives zero.

This is my solution

mysol:=y(x)=x*arccos(ln(x)+1);
odetest(mysol,ode)

   0

Any idea what _B1~ means? The ~ looks like it is an assumed variable? may be leaked from inside Maple.

Maple 2020.1 on windows 10

 

First 42 43 44 45 46 47 48 Last Page 44 of 55