Maple 2018 Questions and Posts

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

The following product gives 0

restart;

product(1-1/k, k = 2 .. infinity);


                               0

However when I expand the product

1 - 1/2 - 1/3 - 1/4 - ... + 1/2*1/3 + 1/2*1/4 + ... + 1/3*1/4 + ... + triple products + quadruple products + and so forth...

Now the double, triple, quadruple, and so forth sums of products converge.

The 1/2 + 1/3 + 1/4 + ... nevertheless diverges, so why does maple give me 0?

question.mw

Hello there,

I am trying to solve a pretty simple Cauchy Problem:

PDE := diff(u(t, x, y), t)+.5*(diff(u(t, x, y), x, x))+diff(u(t, x, y), x, y)+.5*(diff(u(t, x, y), y, y))+diff(u(t, x, y), x)+diff(u(t, x, y), y)+(1+(x+y)^2)*u(t, x, y) = 0

bc := u(0,x,y)=1;

with pdsolve and I get a result.

But surprisingly, Maple's pdetest applied to this result doesn't yield zero.

Hence, Maple solves my problem, but it also says that this solution is not right?

How is that possible?

 

Thanks a lot for your help. (btw: this is my first post here :))

Best regards,

utcyp

 

Maple 2018 memory usage increases as I try to display or manipulate the expression presented in  test_maple2018.mw. The same worksheet works perfectly in Maple 18

I've tried both in Maple 2018.1 and Command Line Maple 2018 obtaining the same result

Maple 2018.1, X86 64 WINDOWS, Jun 8 2018, Build ID 1321769

From command line maple 2018 when trying to evaluate

memory used=3.6MB, alloc=40.3MB, time=0.14
memory used=4.7MB, alloc=72.3MB, time=0.19
memory used=33.3MB, alloc=107.3MB, time=0.45
memory used=109.2MB, alloc=143.1MB, time=1.37
memory used=217.7MB, alloc=185.6MB, time=2.60
memory used=292.6MB, alloc=217.6MB, time=3.87
memory used=328.0MB, alloc=254.6MB, time=5.16
memory used=437.3MB, alloc=299.9MB, time=7.44
memory used=549.8MB, alloc=335.9MB, time=13.60
memory used=630.9MB, alloc=375.4MB, time=17.07
memory used=686.9MB, alloc=401.8MB, time=19.61
memory used=785.6MB, alloc=431.9MB, time=22.31
memory used=944.8MB, alloc=427.9MB, time=26.74
memory used=1150.1MB, alloc=427.9MB, time=32.37
Interrupted

I was wondering if my Maple 2018.1 installation is corrupted. Since I have no acces to other Maple licenses, can anyone try to execute it? test_maple2018.mw

Hello my friends

I have some problems with maple 18. I try to consider and extract some things about tensor such as contraction.

for instance, suppose we have metric=-exp(alpha(r))*(dt^2)+exp(beta(r))*(dr^2)+r^2*(dtheta^2)+r^2*(sin(theta)^2)*(dphi^2). how we can find all Riemann tensor and corresponding contraction, Ricci tensor and its contraction and even Weyl tensor and its contraction. unfortunately, I attempt to find them by using some other examples on the net but they don't help me to calculate them when time is the first element in coordinate, not last ( t,r,theta,phi) not (r,theta,phi)

thanks with the best regard

 

singular(ln(y^2+1),y);

        {y = -I}, {y = I}, {y = infinity}, {y = -infinity}.

But if "y" was real, then there are no finite singularities, since y^2 is always positive and hence y^2+1>0 always. Adding assumptions did not help

singular(ln(y^2+1),y) assuming y::real;

gives same result. RealDomain does not support singular.  But I am no longer using RealDomain as it seems bugy.

I know I could filter out these complex results using remove(), but it would be nice if there was a way to singular supports assumptions. Is there a way to do it?

Why are the following 2 commands produce different result?

restart;
RealDomain:-solve({y=y,y<>0},y);
solve({y=y,y<>0},y);

                            [y = 0]
                            {y <> 0}
 

Should not the result be the same?

solve({y=y,y<>0},y) assuming y::real;
                           {y <> 0}


Maple 2018.1. 

Dear friends,

I noticed that the function numbcomb from the package combinat fails to calculate a value properly.

Let's try to calculate the example from the function's help page:

combinat[numbcomb](7, 3);
combinat[numbcomb](5, 4);

returns 35, 5 correspondingly, whereas should be 15 and 4.

Please, check this in your systems. Maybe, this is a bag in my installation?

 

Suppose I have a subset of R^2, say (x,y) € [0,1] x [0,1]

Now I map

x=r*exp(t)

y=r*exp(-t)

Is it possible to do a 2d contourplot to just see where [0,1]x[0,1] is mapped onto ?

Are these errors to be expected? Why do they happen?

restart;
solve({x<>10, -infinity<x , x<infinity, -infinity<y , y<infinity},{x,y});

Error, (in solver) invalid input: SolveTools:-Inequality:-LinearUnivariateSystem expects its 1st argument, eqns, to be of type ({list, set})({`<`, `<=`, `=`}), but received {x <> -infinity, x < 10}

But it works when replacing x<>10 by y<>10

restart;
solve({y<>10,-infinity<x , x<infinity, -infinity<y , y<infinity},{x,y});

            {10 < y, x < infinity, y < infinity, -infinity < x}, {y <> -infinity, x < infinity, y < 10, -infinity < x}

What is the difference in the above two?

It also work when replacing x<>10 by x=10

solve({x=10, -infinity<x, x<infinity, -infinity<y , y<infinity},{x,y});
               {x = 10, y < infinity, -infinity < y}

It also works when removing the y parts by keeping x<>10

solve({x<>10, -infinity<x , x<infinity},{x,y});
           {y = y, 10 < x, x < infinity}, {y = y, x < 10, -infinity < x}

it also works when removing x<>10 and putting back the y stuff

solve({-infinity<x , x<infinity, -infinity<y , y<infinity},{x,y});
              {x < infinity, y < infinity, -infinity < x, -infinity < y}

Why Maple gives an error for some cases and not the others?

Maple 2018.1

I have an 8*5 matrix, and i'd like to replace elements of it that are >20 with 20. For those interestedm, the matrix comes from this question.

M := Matrix(8, 5, {(1, 1) = 1.266, (1, 2) = .734, (1, 3) = .656, (1, 4) = .735, (1, 5) = 1.843, (2, 1) = 2.859, (2, 2) = 5.625, (2, 3) = 5.188, (2, 4) = 5.453, (2, 5) = 10.765, (3, 1) = 3.281, (3, 2) = 9.000, (3, 3) = 5.516, (3, 4) = 5.828, (3, 5) = 6.156, (4, 1) = 7.718, (4, 2) = 34.125, (4, 3) = 5.453, (4, 4) = 5.344, (4, 5) = 5.453, (5, 1) = 8.703, (5, 2) = 6.515, (5, 3) = 6.125, (5, 4) = 6.641, (5, 5) = 6.734, (6, 1) = 17.766, (6, 2) = 8.578, (6, 3) = 8.765, (6, 4) = 9.875, (6, 5) = 32.610, (7, 1) = 22.156, (7, 2) = 15.640, (7, 3) = 15.610, (7, 4) = 15.187, (7, 5) = 23.735, (8, 1) = 20.140, (8, 2) = 20.156, (8, 3) = 20.266, (8, 4) = 19.344, (8, 5) = 21.078})

I tried to create a logical matrix that i could input into M (this is how it works in maple) to select the elements so i could replace  them, but this didn't work 

Hello MaplePrime users,

Yesterday, I posted my MagicPuzzles package to the MapleCloud. It is a collection of tools I have written for manipulating, solving, and visualizing puzzles like Magic Squares and Magic Stars. Here's a sample solution for each:



For the Magic Square, the numbers on each horizontal and vertical line, along with the numbers on each of the two diagonals, add up to 65.

The inaugural version has separate sub-packages for:

  • Magic Annulai (my own name)
  • Magic Hexagons
  • Magic Squares
  • Magic Stars

Moreover, each sub-package contains these commands:

  • Equations(), to return the linear equations for the variables based on the Magic Sum;
  • Constraints(), to return the conditions that prevent redundant solutions found by reflections and rotations;
  • VerifySolution(), to confirm if a list of numbers is a solution;
  • EquivalentSolutions(), to determine solutions equivalent to a given solution;
  • PrimarySolution(), which takes a solution and returns the associated primary solution;
  • Reflection() and Rotation(), to reflect and rotate a solution; and
  • Draw(), to provide a visualization (like the ones above).

There is also a command, MagicSolve(), which is used to find solutions, which take the form of permutations of [1,...n] for some positive integer n, to the equations. Essentially, it solves the linear equations, and cycles through all permutations for the free variables, and selects those that give "magic" solutions.

In future versions, I intend to add:

  • Other specific classes of problems;
  • More sample solutions; and
  • Known algorithms for finding particular solutions.


To install the package, you can do so from here, or just execute the following within Maple 2017+:

PackageTools:-Install( 5755630338965504, 'overwrite' );

There are many examples in the help pages.

I think others will find this package interesting and useful, and I encourage you to check it out.

Hello,

      I've found that, occasionally, solve won't work if the solving variables are specified---but it will work if the variables aren't specified. For instance:

eqns:=
[x=1, -1/(exp(h)+1/exp(h))^(1/2)/(exp(h)-1/exp(h))^(1/2)*(exp(h)^2-2+1/exp(h)^2)^(1/2)*x = tanh(h)^(1/2)]:

# Works
solve(eqns);

# Doesn't work
solve(eqns, x);

I was wondering why this is, and if there is a workaround?

(I want to specify the solving variables so that solve doesn't attempt to solve for parameters---like h in this case. Also, I'm using solve as opposed to a consistency checker because, in general, I'm applying the same code to larger systems with additional variables to solve for).

Thanks!

I have a say sum(F(k) ,k=1..n)  It fails unless n is an actual integer.  But sum(F(k), k=1..a) works. Then then eval(%,a=n) completes it. That is probably correct but not necessarily a valid assumption. Details in attached. Also it is hard to understand the error message.
 

restart

``

``

Sinta := (k^2+n^2-k)*n/((k^2+n^2-2*k+1)*(k^2+n^2))

(k^2+n^2-k)*n/((k^2+n^2-2*k+1)*(k^2+n^2))

(1)

Ai := sum(Sinta, k = 1 .. n)

-((1/2)*I)*(2*n^2+I*n)*Psi(n-I*n)/(4*n^2+1)+((1/2)*I)*(2*n^2-I*n)*Psi(n+I*n)/(4*n^2+1)+((1/2)*I)*(-2*n^2+I*n)*Psi(n+1-I*n)/(4*n^2+1)-((1/2)*I)*(-2*n^2-I*n)*Psi(n+1+I*n)/(4*n^2+1)+((1/2)*I)*(2*n^2+I*n)*Psi(-I*n)/(4*n^2+1)-((1/2)*I)*(2*n^2-I*n)*Psi(I*n)/(4*n^2+1)-((1/2)*I)*(-2*n^2+I*n)*Psi(1-I*n)/(4*n^2+1)+((1/2)*I)*(-2*n^2-I*n)*Psi(1+I*n)/(4*n^2+1)

(2)

Souta := n/(k^2+n^2-k)

n/(k^2+n^2-k)

(3)

NULL

sum(Souta, k = 1 .. n)

Error, (in assuming) when calling 'Dfnt_4'. Received: 'when calling 'Dfnt_4'. Received: 'when calling 'unknown'. Received: 'invalid input: Dfnt_4 expects its 3rd argument, fpts, to be of type Or(list, piecewise), but received 0'''

 

"(->)"

Error, invalid input: evalf[10] expects 1 argument, but received 0

 

 

 

This works

sum(Souta, k = 1 .. a)

n*Psi(a+1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(a+1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)+n*Psi(1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)

(4)

Ao := eval(%, a = n)

n*Psi(n+1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(n+1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)-n*Psi(1/2-(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)+n*Psi(1/2+(1/2)*(-4*n^2+1)^(1/2))/(-4*n^2+1)^(1/2)

(5)

"(->)"

n*Psi(n+.5000000000-.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)-1.*n*Psi(n+.5000000000+.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)-1.*n*Psi(.5000000000-.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)+n*Psi(.5000000000+.5000000000*(-4.*n^2+1.)^(1/2))/(-4.*n^2+1.)^(1/2)

(6)

````

``


 

Download Summation_problem.mw

I am currently trying to evaluate the performance of different methods for the same calculation and use codegen:cost to give me an overview on the rough computational effort for the results. I stumbled over the function counts not matching my own count in the optimized Matlab code generated by Maple.

Minimal example:

with(codegen):
Fcn1 := sqrt(a):
cost(Fcn1);
Fcn2 := sqrt(sin(q)):
cost(Fcn2);

The first expression gives me "2*functions+multiplications", the second one "3*functions+multiplications".

So my question: Does anyone know, why the square root is counted as two functions while the sine is counted correctly as one?

Hello,

      I've been using frontend in conjuction with pdsolve to handle a very large system of PDEs; namely the system has many irrelevant functions that can be frozen with frontend, allowing pdsolve to solve it much quicker.

     However, I ran into a strange case, which I've included in the attached file. Namely, for this particular system of equations, the system is a PDE with respect to t, so I freeze functions of x. However, doing so produces incorrect results (labelled bad) compared to the unfrozen case (labelled good). The frontend command is working as expected (this can be verified by uncommenting the frontend/print commands); it seems that pdsolve is treating the frozen and unfrozen cases differently.

     Any idea why this behavior is occuring? (The obvious solution is to simply not use frontend here; again, I'm using this same code for much larger PDEs and frontend speeds up exceution by an order of magnitude).

Thanks!

MWE.txt

First 30 31 32 33 34 35 36 Last Page 32 of 43