Maple 2020 Questions and Posts

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

Does anyone here have experience with exporting Maple worksheets to LaTeX?  According to help page

?Export as latex

"You can change the Mathematics Formatting Width to align multi-line displayed formulas by modifying the option in the Export tab of the Options dialog."

That setting, however, seems to have no effect.  The image below shows the result, after setting the line width to (the extremely narrow!) 2 inches.  Long lines still overflow the left and right margins of the paper, rendering the result useless.

I see that this was pointed out in 2016 but there appears to have been no improvements since.  Does anyone know a workaround?  I am running Maple 2020 on Linux, if that matters.

This zip file z.zip contains a Maple worksheet, the exported *.tex file, and the compiled PDF.  Here is what that PDF looks like.

 

 

This Anti-derivative of  arccos(x)*arcsin(x), Maple  2020 cannot do that? It seems not difficult.

int(arccos(x)*arcsin(x),x)

In Mathematica, we can easily to get output :

2 x - Sqrt[1 - x^2] ArcSin[x] +  ArcCos[x] (Sqrt[1 - x^2] + x ArcSin[x])

When pressing !!! (Execute entire worksheet) it seems to me that startup code is executed.

Is that correct, and if - why is that so?

Today I Installed  Physics Updates" version "642 in Maple2020, why does it tell me  it has installed but is not active? How to active it?

Physics:-Version(latest)

`The "Physics Updates" version "642" is installed but is not active. The active version of Physics is within the library D:\\Program Files\\Maple 2020\\lib\\maple.mla, created 2020, March 5, 9:36 hours`

Hello,

is it possible to solve the attached partial differential equation with zero initial boundary condition?

If not by assuming diff(u(sigma, tau, phi, t), t, t)=0 is there an answer for the equation?

Thanks

lapla.mw

Hello I am trying to compute the following expression;

 

(x^2r+y^2+z^2) gamma^{0} partial_{x} (-xy(1-r)) gamma^{2} partial_{y} \Psi

 

in which r = sqrt(1-K(x^2+y^2+z^2)), K is a constant, the gamma's are the Dirac gamma matrices and \Psi is the wave function. Essentially I would like to have partial_{x} operate on the expression to the right of it and apply product rule where there will be three terms with the last one being partia_{x} partial_{y} \Psi where it evaluates on everything expect the partial and the wavefunction, combining into the term partial_{x} partial_{y} \Psi, and if the partials are the same they combine into a single second order derivative with respect to the given variable. I have done this calculation by hand but seeing that there is an extensive amount of terms I would like to automate it using Maple. I have tried using the D() calling sequence but it doesn't quite give me what I am looking for. Is there anything documentation which will give me what I am looking for?

Hello everyone. I want to know how I can extract terms with the lowest sum of the degree of x and of y in a multivariate polynomial (in x and y)?

For instance, if I've f(x) = 100x^2y^2 + 35x^2y + 45y, I want an output of 45y.

On the other hand, if I've g(x) = 13x^2y^2 + xy^2 + 2yx^2, I want an output of xy^2 + yx^2.

Hello,friends!

I try to calculate the limit of the function, 

sin(x*sin(1/x))/(x*sin(1/x))  at point x=0,maple gives answer:1

However,actually it does not have a limit at x=0,because for the limit to exist at a point,there needs to exist a neighbourhood at the point so that all x in the neighbour have definition.

It means f(x) should have have definition at point x=0's negihbourhood,however small the neighbourhood is.If I choose x=1/(n*Pi), n belongs to integers,the function doesn't have definition.As n increase,there doesn't exist such a neighbourhood.So is it something maple should correct?

 

seems_wrong_answer.mw

 

This is very strange problem, and it seems to happen at random times.

From my worksheet, I call a function in a local fille maple_proc.mpl. This function ends up calling int() command with a timeout.

I Have the int() call wrapped by try...catch:.. end try in order to catch timeout and any other error.

Yet, when I run my worksheet, looping over hundreds of integrals, for each one, calling the function in maple_proc to integrate it, and after running for many many integrals, then sometimes, the worksheet terminates with error, at some iteration with error

Error, (in OrProp) too many levels of recursion |maple_proc.mpl:45|
 

So the try/catch I have in place are not catching the above error, wherever it is coming from.  

line 44 in maple_proc.mpl, just does this (it is the line with cpu_time := .... below

try
print(`before calling int`); 
cpu_time := timelimit(180,CodeTools[Usage](assign('result_of_int',int(lst[i,1],lst[i,2])),output='realtime')):   
print(`after calling int`); 
catch "time expired":
   #...
catch: 
   #...
end try;

Again, this works for sometimes for hundreds of iterations, and then on some entry, it gives this error.

I do not use recursion myself at all. i.e. I have no place where the function calls itself. Worksheet does a loop, and in each interation calls this function in maple_proc.mpl.

Sometimes, when I run the worksheet again, the error do not show up again. I have print statements in the catch above, and these do not show up at all, which means this error is not cought.

What should I do to find why this happens? This did not happen in Maple 2019.2. Is there any other way to trap this error so my loop does not terminate like this and I have to restart it again each time? 

I am using Physics 642 and Maple 2020 on windows 10.

Update

I was able to strip all the code and make a MWE. There is a zip file attached.

one worksheet, which calls a maple_proc() function now in the same worksheet. 

This function reads a plain text file in same folder, which contains list of integrals. The function maple_proc() does a "read" which reads all problems into a variable called lst

Now it simply does a LOOP over all entries in lst calling int() on each integral (one integral per line) with a timeout. You see there is catch() there.

I get the erorr 

At iteration number 188 each time.

I will attach a ZIP file now, which contains one folder which contains the worksheet and the input plain textfile. All what you need to do to reproduce this is open the worksheet and evaluate the call there. You might want to edit the hardcoded folder in the worksheet to your own folder where you unzipped the zip file.
 

currentdirName :="C:/MAPLE_BUG";
currentdir(currentdirName);

I hope someone will be able to repoduce this. It looks like a real bug in Maple 2020.

The problem is not in the integral 188 itself. Because if the loop starts at say 100 or 120, instead from 1, the integral now is processed OK and no error is generated.

MAPLE_BUG.zip

Hello,

All too often I encounter an annoying issue, and when it happens it makes Maple slower than just scribbling on paper.  Unfortunately I don't understand why it happens or when it is going to happen so it creates a huge waste of time.

While most of the time expressions behave as expected, other times the exact same expression behaves as if it is something other than what is shown on screen.  I just ran into such an issue as an example:

What am I missing here? Why would phi not be interpreted as phi?

The only thing I could think of not being a Maple expert is assumptions.  I found I have an assumption earlier on phi (assume(phi>0,phi<45) so I removed it, but inexplicably(to me) that only fixes the first 2 lines, the last 2 lines still have the same issue, why I can't understand.  Why would having an assumption on phi, prevent me from evaluating the expression at some value of phi? The provided value is even within the assumed range.  And in either case, why can't I declare a value for phi and have that be understood?

Sorry for what I suspect is a dumb question, and thanks in advance.

EDITED to correct = -> :=

 

"with(LinearAlgebra):  T := proc(n::integer)  local t0, tn, i, t, t1;  if (n>0) then t0 := Matrix(1, 1, 1); tn := Matrix(1,1,0);  for i from 1 to n do local z := 2^i;  t := Matrix([[Add(t0, tn), x .~ t0], [t0, ZeroMatrix(z/(2))]]);  t1 := Matrix([[y .~ t0, ZeroMatrix(z/(2))], [ZeroMatrix(z/(2)), ZeroMatrix(z/(2))]]);  t0 := t; tn := t1;  end do;  else 'T'(n) end if; t0; end proc;"

Error, unterminated loop

"with(LinearAlgebra):  T := proc(n::integer)  local t0, tn, i, t, t1;  if (n>0) then t0 := Matrix(1, 1, 1); tn := Matrix(1,1,0);  for i from 1 to n do local z := 2^i;  t := Matrix([[Add(t0, tn), x .~ t0], [t0, ZeroMatrix(z/2)]]);  t1 := Matrix([[y .~ t0, ZeroMatrix(z/2)], [ZeroMatrix(z/2), ZeroMatrix(z/2)]]);  t0 := t; tn := t1;  end do;  else 'T'(n) end if; t0; end proc;"

 

T(2)

T(2)

(1)

``

 

Download G2.mw

Hello everyone. I was trying to code the recurrence relation given in the image below (without taking the mth power):

 

But, as I run the program, I am getting an "unterminated loop" error. Can someone please point out the mistake(s)?

rfin := proc(m::integer) 
local c, i, flg := 0;
for i from 0 to m do
	local b := i;
	do 
		c := b mod 3;
		if (c <> 2) then next else flg := 1; 
		end if;
		b := 1/3*b - 1/3*c;
	until b = 0;
	if evalb(flg = 0) then print(i); 
	end if; 
end do;
end proc;

Hello everyone. I've written a procedure that outputs all numbers <= a given user I/P whose ternary representation has no 2.

However, I get an "Error, unterminated loop" message. Can someone please out the mistake(s)?

Update:This bug ONLY occurs when the file title containing Chinese Characters.

 

The .mw files have already been associated with Maple 2020, but when clicking on any of them, Maple 2020 won't launch as expected and nothing actually will happen.
I have tried to reinstall Maple 2020, but the problem just keep existing.

The Windows version where the bug occurs is Windows 10 version 1909.

I'm using the 15 day trial as a Computer Science student. For my first project, Maple worked very well. I've been using the ApproximateInt() command. This command worked in the first assignment, and so I created a new document to start on my second assignment, and suddenly:

Entering the same ApproximateInt() command in a prompt line will not execute the command. Where it should display a plot of Riemann sums, it only displays the text I had entered. If I open the first document in which it was working properly, it also breaks upon re-iterating the command lines.

Image of expected behaviour:

Image taken right after pressing enter:

Is anyone familiar with this Maple behaviour? Thank you for any help. Meanwhile, I will attempt a reinstallation. The maple file is attached, as well.

P.S: Interestingly, the plot() command does work, as well as simple commands such as 1+2 (Displays "3")

Hello!

Using a geometry package, I ran into a problem: the area() function returns the wrong value for square elements.

What am I doing wrong?

_local(D)

with(geometry)

b := 2

h := 1

square(sq1, [point(A, 0, 0), point(B, b, 0), point(C, b, h), point(D, 0, h)])

evalf(area(sq1))

2.500000000

(1)

draw([sq1, A(printtext = true), B(printtext = true), C(printtext = true), D(printtext = true)])

 

triangle(tr1, [point(A, 0, 0), point(B, b, 0), point(C, b, h)])

evalf(area(tr1))

1.

(2)

draw([tr1, A(printtext = true), B(printtext = true), C(printtext = true)])

 

NULLNULL

NULL

b := .1

h := 1

square(sq2, [point(A, 0, 0), point(B, b, 0), point(C, b, h), point(D, 0, h)])

evalf(area(sq2))

.5050000000

(3)

draw([sq2, A(printtext = true), B(printtext = true), C(printtext = true), D(printtext = true)])

 

triangle(tr2, [point(A, 0, 0), point(B, b, 0), point(C, b, h)])

evalf(area(tr2))

0.5000000000e-1

(4)

draw([tr2, A(printtext = true), B(printtext = true), C(printtext = true)])

 

``


 

Download GeometryAreaTest.mw

First 12 13 14 15 Page 14 of 15