Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Sorry if this is stupid but How do I use the interactive debugger?   the button is greyed out for me and 
 

stopat(EAdd(x^3+2x+1,x, 13, 1, 2, 1, 2), 1);

Error, missing operator or `;`

 

stopat(EAdd, 1);

                             [EAdd]
 

debug button is still greyed out IDK what to do now


p.s. is there a way to set breakpoints in your code by clicking like in other programming?
 

I want to factor large numbers, for this purpose I want to utilize multi cores on my computer.

Anyone who can help me in solving this problem?

I am utilizing Lenovo Thinkpad T440s with specifications core i7-4600 CPU @ 2.19 GHz.

In addition I would like to ask if anyone can help me in integrating GPU's with Maplesoft 2019 for factorization.

 

I am having a cluster of 64 GPU's i.e. AMD RX-460.

 

Any help in this regard will be appreciated.

 

I am using a maple workbook to develop, test, and install a package I am developing.  Several days ago, I noticed that the workbook was not updating the package to reflect the most recent versions of my source code (.mpl). I initially assumed the problem caused by some unintentional change I made to the file, but in the end I found there is a general problem with the URIs in the maple workbook. Everything worked in 2019.1 and I hadn't made any changes after I updated to 2019.2.1.

To confirm the problem, I created a new directory(in fully updated Windows 10 ) and copied my source file into the directory. Then I created a worksheet in maple and saved it into the directory as xx.mw. Using the Navigator panel I then saved the worksheet as a workbook creating xx.maple in the directory.  I then tried to attach the mpl file to the workbook.  In the Navigator menu, the item "attach a file" is unavailable( greyed out).  This is also the case in any of the other earlier workbooks I have created.  I have confirmed the problem is not affecting worksheets because I was able to read my mpl file into a worksheet and load the module using a with(modulename) command.

Please advise.

Dear experts

I have a complex equation (eq=0) which is a function of K, Q, p and s. K and Q can be complex variables and pa and s are parameters.

equation is

eq:= (K*( Q*sinh(K)*cosh(Q)-K*cosh(K)*sinh(Q))*(1+s*K^2)
   +p*(-4*K^2*Q*(K^2+Q^2)
       +Q*(Q^4+2*K^2*Q^2+5*K^4)*cosh(K)*cosh(Q)
       -K*(Q^4+6*K^2*Q^2+K^4)*sinh(K)*sinh(Q)))/(K^2*Q*cosh(Q)) =0 :

and we know that Q:= sqrt(K^2-I*omega); where omega is complex variable

i) How can I study and plot K vs p if Q is 1) real and 2) pure imaginary. 3) complex variable and vice versa

ii) How can I study and plot p vs s

 

Hey there

I have noticed that after some time, Maple freezes and says in the bottom left corner that it is "evaluting" when I  copy something. This is becoming unbearable, as it makes every assignment take a lot longer. Why is this happening, and how can I prevent it?

I  can't seem to get a solution to the following problem.  Can anyone see where I am going wrong I thought I had correct IBC s but they may be wrong/ill-posed

Melvin
 

Two 1-D coupled Burgers equations - semiclassical case: remove O( `ℏ`^2) terms for u(x,t) but retain O( `ℏ`) terms for v(x,t):

In the quantum case, there are two coupled quantum Burgers equations, which each include the quantum potential terms.  As in the classical case above, we apply constant external forces Fuand Fv.  Our aim is to display the profiles of u(x, t) and v(x, t) as strings on x, t space.

#hBar := 'hBar': m := 'm':Fu := 'Fu': Fv := 'Fv': # define constants

hBar := 1:m := 1:Fu := 0.2:Fv := 0.1: # set constant values - same as above ...consider reducing

At O( `ℏ`^2) the real quantum potential term is zero, leaving the classical expression:

pdeu := diff(u(x,t),t)+u(x,t)/m*(diff(u(x,t),x)) = Fu;

diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = .2

(1)

On the otherhand, the imaginary quantum potential equation for v(x,t) has only O( `ℏ`) terms and so is retained as semiclassical

pdev := diff(v(x,t),t)+u(x,t)/m*(diff(v(x,t),x))-hBar*(diff(u(x,t),x$2))/(2*m)+v(x,t)*(diff(u(x,t),x))/m = Fv;

diff(v(x, t), t)+u(x, t)*(diff(v(x, t), x))-(1/2)*(diff(diff(u(x, t), x), x))+v(x, t)*(diff(u(x, t), x)) = .1

(2)

By inspection of the derivatives in above equations we now set up the ICs and BCs for u(x, t) and "v(x,t)."

The quantum initial and boundary conditions are similar to the classical case, but also comprise additional boundary condition terms for v and for u, notably a 1st derivative BC term for u.

IBCu := {u(x,0) = 0.1*sin(2*Pi*x),u(0,t) = 0.5-0.5*cos(2*Pi*t),D[1](u)(0,t) = 2*Pi*0.1*cos(2*Pi*t)};# IBC for u

{u(0, t) = .5-.5*cos(2*Pi*t), u(x, 0) = .1*sin(2*Pi*x), (D[1](u))(0, t) = .6283185308*cos(2*Pi*t)}

(3)

IBCv := {v(x,0) = 0.2*sin((1/2)*Pi*x),v(0,t)=0.2-0.2*cos(2*Pi*t)};# IBC for v

{v(0, t) = .2-.2*cos(2*Pi*t), v(x, 0) = .2*sin((1/2)*Pi*x)}

(4)

IBC := IBCu union IBCv;

{u(0, t) = .5-.5*cos(2*Pi*t), u(x, 0) = .1*sin(2*Pi*x), v(0, t) = .2-.2*cos(2*Pi*t), v(x, 0) = .2*sin((1/2)*Pi*x), (D[1](u))(0, t) = .6283185308*cos(2*Pi*t)}

(5)

pds:=pdsolve({pdeu,pdev},IBC, time = t, range = 0..0.2,numeric);# 'numeric' solution

_m2606922675232

(6)

The following quantum animation is in contrast with the classical case, and illustrates the delocalisation of the wave form caused by the quantum diffusion and advection terms:

T:=2; p1:=pds:-animate({[u, color = green, linestyle = dash], [v, color = red, linestyle = dash]},t = 0..T, gridlines = true, numpoints = 2000,x = 0..0.2):p1;

2

 

Error, (in pdsolve/numeric/animate) unable to compute solution for t>HFloat(0.0):
matrix is singular

 

p1

(7)

Note that this plot also shows that there are regions in which pIm < 0,  pRe > 0.  Below, the 3D plot of u(x,t),v(x,t) also illustrates the quantum delocalisation of features:

T := 3; p1 := pds:-plot3d({[u, shading = zhue], [v, color = red]}, t = 0 .. T, x = -0.1e-2 .. 2,transparency = 0.0, orientation = [-146, 54, 0], title = print("Coupled quantum solution \n u(x, t) zhue, v(x,t) red", numeric),scaling=unconstrained):p1;

3

 

"Coupled quantum solution 
 u(x, t) zhue, v(x,t) red", numeric

 

Error, (in pdsolve/numeric/plot3d) unable to compute solution for t>HFloat(0.0):
matrix is singular

 

``


 

Download BurgersEqns.mw

Here it is:

#hBar := 'hBar': m := 'm':Fu := 'Fu': Fv := 'Fv': # define constants
hBar := 1:m := 1:Fu := 0.2:Fv := 0.1: # set constant values - same as above ...consider reducing
At O( 
`&hbar;`^2;
) the real quantum potential term is zero, leaving the classical expression:
pdeu := diff(u(x,t),t)+u(x,t)/m*(diff(u(x,t),x)) = Fu;
              / d         \           / d         \      
      pdeu := |--- u(x, t)| + u(x, t) |--- u(x, t)| = 0.2
              \ dt        /           \ dx        /      
On the otherhand, the imaginary quantum potential equation for v(x,t) has only O( 
`&hbar;`;
) terms and so is retained as semiclassical
pdev := diff(v(x,t),t)+u(x,t)/m*(diff(v(x,t),x))-hBar*(diff(u(x,t),x$2))/(2*m)+v(x,t)*(diff(u(x,t),x))/m = Fv;
                                                     2         
         / d         \           / d         \   1  d          
 pdev := |--- v(x, t)| + u(x, t) |--- v(x, t)| - - ---- u(x, t)
         \ dt        /           \ dx        /   2    2        
                                                    dx         

              / d         \      
    + v(x, t) |--- u(x, t)| = 0.1
              \ dx        /      
By inspection of the derivatives in above equations we now set up the ICs and BCs for 
u(x, t);
 and 
v(x,t).;
The quantum initial and boundary conditions are similar to the classical case, but also comprise additional boundary condition terms for 
v;
 and for 
u;
, notably a 1st derivative BC term for 
u;
.
IBCu := {u(x,0) = 0.1*sin(2*Pi*x),u(0,t) = 0.5-0.5*cos(2*Pi*t),D[1](u)(0,t) = 2*Pi*0.1*cos(2*Pi*t)};# IBC for u
          IBCu := {u(0, t) = 0.5 - 0.5 cos(2 Pi t), 

            u(x, 0) = 0.1 sin(2 Pi x), 

            D[1](u)(0, t) = 0.6283185308 cos(2 Pi t)}
IBCv := {v(x,0) = 0.2*sin((1/2)*Pi*x),v(0,t)=0.2-0.2*cos(2*Pi*t)};# IBC for v
                   /                                 
          IBCv := { v(0, t) = 0.2 - 0.2 cos(2 Pi t), 
                   \                                 

                             /1     \\ 
            v(x, 0) = 0.2 sin|- Pi x| }
                             \2     // 
IBC := IBCu union IBCv;
         /                                 
 IBC := { u(0, t) = 0.5 - 0.5 cos(2 Pi t), 
         \                                 

   u(x, 0) = 0.1 sin(2 Pi x), v(0, t) = 0.2 - 0.2 cos(2 Pi t), 

                    /1     \  
   v(x, 0) = 0.2 sin|- Pi x|, 
                    \2     /  

                                           \ 
   D[1](u)(0, t) = 0.6283185308 cos(2 Pi t) }
                                           / 
pds:=pdsolve({pdeu,pdev},IBC, time = t, range = 0..0.2,numeric);# 'numeric' solution
                     pds := _m2606922675232
The following quantum animation is in contrast with the classical case, and illustrates the delocalisation of the wave form caused by the quantum diffusion and advection terms:
T:=2; p1:=pds:-animate({[u, color = green, linestyle = dash], [v, color = red, linestyle = dash]},t = 0..T, gridlines = true, numpoints = 2000,x = 0..0.2):p1;
                             T := 2
Error, (in pdsolve/numeric/animate) unable to compute solution for t>HFloat(0.0):
matrix is singular
                               p1
 

At first, I appology my poor English and I am a non-proessional on mathematics and programing. I am an old retired engineer/researcher.

I found strange phenomena with maple.
Could someone please verify this result?
This is sound like a stupid joke.
This queation is related to factorization of composite number N=p*q
p, q are large prime number respectively.

Degits:=200;
1.    Let p is large prime such as 50 degits
2.    Let R is small integer such as 3
3.    Let q is nearest prime R*p
4.    Let N=p*q
5.    Let f=frac(N/(q+s))

j:=1;
m:=2^b*2^c;
r:=m/2^b;
b:=8; c:=0;
F:=[ ];
for s from -m to m by r do
f:= frac(N/(q+s));
      if f=0 OR 1.0 then f:=100000; # zero dev exeption;
      elif f <= 0.5 then f:=log10(f);
      elif f > 0.5 AND f < 1.0 then f:=-log10(1.0-f);
      else print(“error”) break;
      end if:
F:=[F[ ], [s, f]];  # maple plot format
j::=j+1;
end do:

6.    Draw a Graph s vs F

You wil find a oscillating graph with step at s=0;

7. b:=8 and c:=75; and try same caluclation.

You will find a graph with dip at s=0;
Caution! Resolution and Scanwidth can not go together.

8.    Let qx=q+10^25;
9.    Nx:=p*qx;
10.    Let ps:=sqrt(N/3.0) and let qs:=3.0*sqrt(N/3.0);
11.    fs:=frac(Nx/(qx+s));
Caution!  Nx not equal Ns:=p*qs
12.     Draw a graph s vs Fs with Nx, p, qs
You will find a similar graph dip point shifted from s=0
13. Verify qx=ps-dip point s

My questions are
1.    Is it a kaind of factorization of Nx?
2.    This phenomena hava posibirity to make a vulneravility for RSA crypto?
3.    Power spectrum of F( c=0) indicates R=q/p; with an peak
4.    Is it an rediscovery of “Wheel”?  Are thea any papers similar to this phenomena

I appreciate to read this questions.

Environment: Windows 10 for workstation and Maple 2019(64bit) CPU: Intel Xeon.

15 Dec 2019  some miss spelling corrected

                       A graph added   frac(N(q+s)) vs s b=8 c=75 

 

Hello,

I want to write a code about numerical solving N(for example N=150) coupled differential equations (ODE ) with M boundary conditions in Maple but I do not know how to do it and I cannot find anything useful. in particular, I have trouble inserting boundary conditions which are a lot for N coupled difrential equations.

Does somebody have a code script on this matter? please let me know.

Thanks a bounch in advance.

Hello everyone, thank you in advance

I am trying to plot two functions in the same graph. I didn't realize how to copy the real functions here but:

At the same 3D plot

I need to use the function F1(x,xi,k,B) for values of x*xi <6  and other function F2(x,xi,k,B) for values of x*xi  >= 6

Thank you again and sorry for my rusty English.
 

I attached a file with these 2 functions Functions_MAPLE_PLOT_TOGETHER.mw

Can you please explain which optimization package is better from your experience

1 maple

2 matlab

3. mathematica

4. gams studio

5. gurobi

or any other

I am reading a paper which has some useful two-dimensional Fourier transforms in the appendix: for example,

Fourier transform of 1/r = (1/k)*e^(-kz),

where r = sqrt(x^2 + y^2 + z^2) and k =  sqrt(k_1^2 + k_2^2).

My guess is that the author has computed these by taking contour integrals in the upper half-plane and I would like to compute some of these myself but I have many of them to compute and was wondering if it could be done with Maple instead.

For example, could I use Maple to verify that the above 2D Fourier transform is correct and that the inverse 2D Fourier transform takes you back to the original (or almost takes you back).  After that I would then like to feed in the functions which I have to get Fourer and inverse Fourier transforms.

combine(2^n*4, icombine);

2^(2+n)

(1)

combine(2^n*4);

4*2^n

(2)

combine(2^n/4, icombine); # BUG

Error, (in compat) invalid input: igcd received undefined, which is not valid for its 2nd argument

 

combine(2^n/4);

(1/4)*2^n

(3)

combine(2^n/2^m, icombine); # BUG

Error, (in compat) invalid input: igcd received undefined, which is not valid for its 2nd argument

 

combine(2^n*2^(-m), icombine);

2^(n-m)

(4)

combine(2^n/2^m);

2^(n-m)

(5)

is(2^n/4 = 2^(n-2)); # ???

false

(6)

 


Download bug-icombine-is.mw

Hi everyone, I'm having issues using Maple through the command line (I have reasons to be avoiding the GUI, namely I am trying to use Maple in a development environment that integrates other programs, e.g. Mathematica into the mix. This forces me to only be able to access Maple via the command line).

 

Here is my issue: for some functions, like diff(), which differentiates functions, Maple evaluates the function on the input:

 

> f:=x+2;                                                
                    f := x + 2

> g := diff(f, x);                                 
                      g := 1

 

For other functions though, such as SPolynomial() (from the Ore_algebra library), command-line Maple is lazy and just spits back the input:

> with(Ore_algebra) 

> A:=diff_algebra([D1, x1], [D2, x2]);     
A := diff_algebra([D1, x1], [D2, x2])

> T:=MonomialOrder(A, grlex(D1, D2));              
T := MonomialOrder(diff_algebra([D1, x1], [D2, x2]), grlex(D1, D2))

> L1:=D1;                                          
                     L1 := D1

> L2:=D2;                                          
                     L2 := D2

> L:=SPolynomial(L1, L2, T);                       
L := SPolynomial(D1, D2, MonomialOrder(diff_algebra([D1, x1], [D2, x2]), grlex(D1, D2)))

 

Let me know if you get the same error as well! The correct output (outputted by the worksheet version of Maple) should be:

 

L := 0

 

Hi, 

This is a question more or less related to this one Is it possible to define variables with unusual na... but I think it's better to open a new thread. If some think otherwise, please feel free to displace it to the link above.

I want to relabel the vertices of a graph by using special characters.
It happens that this works perfectly if I do not impose the style of the drawing but that it doesn't if I set, for instance, spring=style.
In the attached file you will see that the subsitution of the old vertex names by the new ones doesn't work if apply it directly on the many operators of the PLOT command contains.

Is this behaviour fixed in more recent versions of Maple or it's still present?


Strange-Behaviour-with-SpringStyle.mw

Hi! I have been trying to calculate the value of theClenshaw derivative. I can get the regular clenshaw to work but not the derivative. I'm going off of the thread (https://scicomp.stackexchange.com/questions/27865/clenshaw-type-recurrence-for-derivative-of-chebyshev-series). (P.s notice I have halfed the A[z+1] term. I have tried both ways but the overall result is wrong so I am guessing something more important is wrong).

This is my code so far

Clenshaw_Dx_1D:=proc(z,C,Nm,s)
local i,k,A,B: global Clen1D_Dx: 

A := Vector(z..Nm+1+z);
B := Vector(z..Nm+1+z);

for k from Nm-1+z by -1 to 1+z do
A[k] := C[k] + 2*s*A[k+1] - A[k+2]:
od:

for k from Nm-1+z by -1 to 1+z do
B[k] := 2*A[k+1] + 2*s*B[k+1] - B[k+2]:
od:
Clen1D_Dx :=  A[z+1]/2 + s*B[1+z] - B[2+z]:

end:

Where z could be 0 or 1 depending on what index your C array starts at. C is the array of chebyshev coefficients of a Chebyshev series appromating u(x) for example. The Chebycoeff1D procedure calculates the Chebyshev coefficients  and the code below calls the procedure for a specific function. Try it with some values of xM, for example 4-10.
 

Chebycoeff1D:=proc(express,Nn,C2,A,B)
local Cfac,fac1x,fac2x,k,K;

fac1x:=Pi/Nn;
  for k from 1 to Nn do 
  Cfac(k):=eval(subs(x=evalf(cos(fac1x*(k-0.5)))*A+B,evalf(express))); 
  od; unassign('k'):                    
  for K from 1 to Nn do
    fac2x:=Pi*(K-1)/Nn;
    C2[K-1]:=(2/Nn)*add(Cfac(k)*evalf(cos(fac2x*(k-0.5))),k=1..Nn);
  od:
end:
nn := 1.0:
Lc := 0.0: Rc := 1.0:
func:=nn*sin(2*Pi*x)+0.5*nn*sin(Pi*x):
Chebycoeff1D(func,xM+1,C,0.5*(Rc-Lc),0.5*(Rc+Lc)):

Once you have the C array call Clenshaw_Dx_1D. For example
 

Clenshaw_Dx_1D(0,C,xM+1,0.0);  # Evalutes f'(x) in the middle of the domain.

Check with

subs(x=0.5, diff(func,x));

The overall "pattern/shape" of the derivative values is correct, just not the amplitude/values. Any help here? Where is the Clenshaw derivative procedure going wrong.

First 10 11 12 13 14 15 16 Last Page 12 of 1709