Maple 2019 Questions and Posts

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

 I'm confused as to why Maple can't perform a certain integral for me. Please see my attached code - it get's stuck on the last step.

 

070919_ThetaIntegral.mw

Does anyone know how collect zero epsilon coefficient from follow expression?

coeff_test.mw

Is it possible?

Thank you!

I am able to generate random polynomials with non-zero coefficents, and define sets of all the positive divisors of the leading coefficient and the constant terms. My question is this, how may I apply the rational zeros theorem to generate the set of all possible rational zeros of the polynomial. I basically need to form all the possible quotients (positive and negative) with numerator in one set and denominator in the other set, ignoring duplicates. The attached worksheet has what I've done so far.rational_zeros.mw
 

attempt := 1; while attempt > 0 do q := randpoly(x, coeffs = rand(-9 .. 9), degree = 3, dense); if nops(q) = 4 then attempt := -2 end if; attempt := attempt+1 end do; q

5*x^3+3*x^2-4*x-8

(1)

NumberTheory[Divisors](coeff(q, x, 3))

{1, 5}

(2)

NumberTheory[Divisors](coeff(q, x, 0))

{1, 2, 4, 8}

(3)

``


 

Download rational_zeros.mw

 

The command eval allows to simplify a complicated expression

in a more compact form for a later output in LATEX

In the example which follows I was able to insert A and B but non C in the expression.

There is already a post on this kind of topic but I failed to understand the details.

Perhaps a Maple worksheet of answer on this topic  would be useful !

bye Lorenzo
 

restart;

expression:=exp(-b*x^c/2)*((x^(-(3*c)/2 + a/2 + 1/2)*(c + a + 1)*b^(-(3*c + a + 1)/(2*c)) + c*x^(a/2 + 1/2 - c/2)*b^(-(c + a + 1)/(2*c)))*c*WhittakerM((-c + a + 1)/(2*c), (2*c + a + 1)/(2*c), b*x^c) + b^(-(3*c + a + 1)/(2*c))*x^(-(3*c)/2 + a/2 + 1/2)*WhittakerM((c + a + 1)/(2*c), (2*c + a + 1)/(2*c), b*x^c)*(c + a + 1)^2)/((a + 1)*(c + a + 1)*(2*c + a + 1));

exp(-(1/2)*b*x^c)*((x^(-(3/2)*c+(1/2)*a+1/2)*(c+a+1)*b^(-(1/2)*(3*c+a+1)/c)+c*x^((1/2)*a+1/2-(1/2)*c)*b^(-(1/2)*(c+a+1)/c))*c*WhittakerM((1/2)*(-c+a+1)/c, (1/2)*(2*c+a+1)/c, b*x^c)+b^(-(1/2)*(3*c+a+1)/c)*x^(-(3/2)*c+(1/2)*a+1/2)*WhittakerM((1/2)*(c+a+1)/c, (1/2)*(2*c+a+1)/c, b*x^c)*(c+a+1)^2)/((a+1)*(c+a+1)*(2*c+a+1))

(1)

``

(2)

expression_ABC:=eval(expression,[x^(-(3*c)/2 + a/2 + 1/2)*(c + a + 1)*b^(-(3*c + a + 1)/(2*c))=A,c*x^(a/2 + 1/2 - c/2)*b^(-(c + a + 1)/(2*c))=B,((a + 1)*(c + a + 1)*(2*c + a + 1))=C]);

exp(-(1/2)*b*x^c)*((A+B)*c*WhittakerM((1/2)*(-c+a+1)/c, (1/2)*(2*c+a+1)/c, b*x^c)+b^(-(1/2)*(3*c+a+1)/c)*x^(-(3/2)*c+(1/2)*a+1/2)*WhittakerM((1/2)*(c+a+1)/c, (1/2)*(2*c+a+1)/c, b*x^c)*(c+a+1)^2)/((a+1)*(c+a+1)*(2*c+a+1))

(3)

 

 

 

 


 

Download maple_primes_eval.mw

 

Hi

 

I've just installed Maple latest + MapleSim with the license provided by my university (I use VPN with a secure key to remotely access server license. Everything works fine, except for the context menu. It seems that the context menu module is missing! I tried uninstalling and reinstalling, but did not help.

 

I went back to the campus and checked Maple installation on computers there, and this problem is absent (context menu is working fine).

 

I can only use the context menu toolbar on the right... but this is not very convenient. 

What could be the problem? See the attached image.

 

Thanks

---------------------

 

Hi!

How to calculate  a value in MAPLE:

My code:

evalf(eval(diff(n*Zeta(n, 3), n), n = 3)); give me:

#-0.3740436824 + 3.*eval(diff(Zeta(n, 3), n), {n = 3}) ,it should be only:-0.3740436824

OR:

fdiff(n*Zeta(n, 3), [n], n = 3);

#fdiff(n -> n*Zeta(n, 3), [1], [3]) ???

It's a Bug  or (As Designed / Not a Bug) ?

Thanks in advance.

 

Mathematica code:

D[n*Derivative[n][Zeta][3], n] /. n -> 3 // N;

(* -0.374044*)

 

 

I just used Maple for the first time to find the roots of an equation, the problem they give me imaginary solutions every time I put a (ln); even for ln (1) it proposes me -265.745524189222 + 0.785398163397448 * I as a solution. Could you help me to solve this problem?

Why doesn't

f:=ln(s + 2)^2 + 2*polylog(2, -1 - s) + 2*polylog(2, (1 + s)/(s + 2))

simplify to zero assuming s>0?

I solved this PDE by hand to verify Maple's solution. I think Maple solution is wrong. This PDE is the heat PDE on a bar (1D) with boundary coditions on both ends are function of time and zero initial conditions.

unassign('A,B,x,t,L,k,f');
pde := diff(u(x,t),t)= diff(u(x,t),x$2):
bc := u(0, t) = A(t), u(1, t) = B(t):
ic := u(x, 0) = 0:
sol1:=pdsolve([pde, ic, bc], u(x, t));

#now try when A(t)=sin(t),B(t)=t, use 20 terms for the sum
sol2:=simplify(subs([infinity=20,B(tau)=tau,A(tau)=sin(tau),A(0)=0,B(0)=0,A(t)=sin(t),B(t)=t],sol1)):
sol3:=simplify(value(subs(t=1,sol2))):
evalf(subs(x=0.5,sol3))

 

Also doing pdetest(sol1,pde); on the above solution does ot return zero as expected.

To verify more, I solved the same PDE again, but now using an explicit values for the boundary conditions A(t), B(t). Using A(t)=sin(t), B(t)=t. Then found the value again of the solution u at x=0.5 and t=1 like in the above, and it gives different value:

unassign('A,B,x,t,L,k,f');
pde := diff(u(x,t),t)= diff(u(x,t),x$2):
bc := u(0, t) = sin(t), u(1, t) = t:
ic := u(x, 0) = 0:
sol4:=pdsolve([pde, ic, bc], u(x, t));
sol5:=simplify(subs(infinity=20,sol4)):
sol6:=simplify(value(subs(t=1,sol5))):
evalf(subs(x=0.5,sol6))

Then I typed my hand solution into Maple and for the same values x=0.5, t=1 and same number of terms, I also get the same value 0.819. 

I do not see at all where the function sin integral should come into play in this solution. 

Could some Maple expert please check to see what is going on with this solution to Maple? 

Using Maple 2019.1 and Physics version 370

 

I do not understand why Maple can simplify this expression below when told that n is integer and also positive using a "," to separate the assumptions, but does simpify the same expression when using "and" to build the assumptions.

Here is an example

restart;
result:=int(x*cos(n*Pi/5*x),x=0..5)
simplify(result) assuming n::integer and n>0

But this works

simplify(result) assuming n::integer, n>0

What are the semantic differences between writing assuming "n::integer and n>0" and "n::integer,n>0" ? I thought these would be the same, but clearly they are not.

Maple 2019.1 on windows.

Hello! I have a Maple sheet that is functional in some versions of Maple but not others. It works perfectly in Maple 18 (which is the version with which it was written), but when running it in Maple 2019, I see the following error:

  • "Error, (in Matrix) cannot determine if this expression is true or false: Distance(Vector[row](3, {(1) = 0., (2) = 1.313799622, (3) = 0}), Vector[row](3, {(1) = 0., (2) = -1.313799622, (3) = 0})) < 99999999999999999999/100000000000000000000"

And believe that it is related to the following lines of code:

  • R := Matrix(N, (i, j) -> Distance(coords[i], coords[j]) ;
  • S := Matrix(N, (i, j) -> if i = j then 1 elif R[i, j] < 3 then (1+C*R[i, j]+(2/5)*C^2*R[i, j]^2+(1/15)*C^3*R[i, j]^3)*exp(-C*R[i, j]) else 0 end if)

It seems as if it cannot compute a distance between two points (as given in the form of two vectors). I have imported the Student:-Precalculus package, along with ArrayTools and LinearAlgebra, at the start of the sheet, but am wondering if there is an issue with this package in other versions of Maple. The full sheet can be provided if more information is needed, but I'm pretty sure that portion is the problem. Any help would be greatly appreciated.

 

Sheet: testsheet.mw

Hi everybody and thank you all in advance.

This is my question. Suppose I have a list of lists like this:

[[1,2,3],[7,8,9],[13,12,11]]

I want to select all 3rd element from the list of lists and get:

[3,9,11]

Another example:

[1, [2, 3], [4, [5, 6], 7], [8, 3], 9] and select the first element from the list of lists and get:

[1, 2, 4, 8, 9]

Additionally suppose I want to sort a list of lists but base on the 3rd element of every sublist. Example:

From this list:

[[1,2,3],[7,8,2],[13,12,1]] sorted by the  3rd element I would get:

[[13,12,1], [7,8,2], [1,2,3]]

 

So, I am trying to write a method for array interpolation. I have a Matrix that is X by 3, where each column holds specific data (column 1 holds independent data 1, column 2 holds independent data 2, column 3 holds dependent data).

This data comes from a function with 2 independent variables, and I am creating a graph of this function, basically, with both independent variables going from 0 to 1 (approximately 300 values per variable, giving me a matrix with 90k values already). My goal is to use interpolation to get a lot of values in between the points I already calculated.

That being said, I don't know how to use the ArrayInterpolation command to achieve this. I will post my code below if anyone can help me out!

Code:

Interpolate := proc(M::Matrix)
  local i; local j;
  local M1 := Matrix(RowDimension(M),1);
  local M2 := Matrix(RowDimension(M),1);
  local M3 := Matrix(RowDimension(M),1);
  for i from 1 to RowDimension(M) do
    M1(i) := M(i,1);
    M2(i) := M(i,2);
    M3(i) := M(i,3);
  end do;
  print(M1,M2,M3);
  local M4 := Matrix(1000,1);
  local M5 := Matrix(1000,1);
  for j from 1 to 1000 do
    M4(j,1) := 0.001*j;
    M5(j,1) := 0.001*j;
  end do;
  ArrayInterpolation([M1,M2],M3,[M4,M5]);
end proc;

Hello everyone, here i Denmark we are using comma as a separator for decimal numbers. I have looked in the forum and found that if i changed my region in windows settings, but it is Denmark. When i use number formatting it tells me the output will be with comma as a separator,  but the output comes out with period as the separator. Is there a way to change it manually ?

 

 

Hi, 

I am trying to derive solutions for cubic equation using Maple.

Problem I encountered is it automatically cancles and simplifies, I cannot reach to the final form using Maple commands except modifying the equation by myself.

like, 

(-108*q - 12*sqrt(12*p^3 + 81*q^2))^(1/3)/6 into (-q/2 + sqrt(p^3/27 + q^2/4))^(1/3)

Another one, even though I want this fractional form, it becomes other form automatically

(-q/2 + sqrt(p^3/27 + q^2/4))^(1/3) into (-q/2 + sqrt(12*p^3 + 81*q^2)/18)^(1/3)

Thank you.

First 38 39 40 41 42 43 44 Page 40 of 44