Maple 2017 Questions and Posts

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

Dear Users,

I have difficulty in finding numerical integration of a function f(r,t) which is a function of position r and time t. Function f(r,t) consists 100 terms (for example : BesselJ(0, 151.5793716314014*r)+BesselJ(0, 151.5793716314014*r)*r^2+......100 terms). For a particular time t=t1, f(r,t1) is calculated and then integrated as follows:

I am using evalf(Int(f(r,t1),r=0..1)

Maple takes a lot of time  to evaluate it as it is integrating it in one shot!  Is there a way to

a) pick the terms individually and integrate it

b) then sum these individual terms up together

c) How reliable is evalf(int(f(r,t1),r=0..1)) is? Is evalf (Int()..)  the best way to evaluate integration?


Hey there,


I'm trying to build a procedure that can function as an adapted form of Prim's algorithm. The idea is that on a graph with just vertices, the procedure has a starting point, and from there will find out which vertex is the cheapest to connect to (currently expressed purely by the lowest distance). Once this is found, the connected vertex is removed from a list that has vertices that aren't connected yet, and added to a list of vertices that are in the minimal spanning tree.

My problem is that I get an error returned that says "invalid Boolean expression", and I'm not sure how to solve it. Can anybody here point me in the right direction?

The procedure is defined as follows:

Primmetje := proc (aantal, posities, begin)
local knopenover, knopeninmst, huidig, V, kaart, e, a;
knopenover := [seq(i, i = 1 .. aantal)];
knopeninmst := {};
huidig := [0, 0];
if begin <> {} then
  V := [begin];
knopeninmst := knopeninmst union {V}
end if;
remove(V, knopenover);
kaart := Graph(aantal);
SetVertexPositions(kaart, posities);
while nops(knopeninmst) < aantal
do for e in knopeninmst
   do for a in knopenover
     do if huidig = [0, 0] or Distance(posities[e], posities[a]) < Distance(posities[huidig[1]], posities[huidig[2]]) then
   huidig := [e, a];
knopeninmst := knopeninmst union {a};
remove(a, knopenover);
AddEdge(kaart, huidig)
end if
end do
end do
end do
end proc

When I try to execute it with some parameters the return is this:

vp := [2.5, 21], [6, 13.5], [8, 10], [11, 24.5], [14.3, 19.4], [16.8, 26], [22, 21.5], [22, 17], [22.2, 12.5], [26.8, 23], [28, 20.5], [30, 25.5], [32, 21], [29.5, 16];
Primmetje(14, vp, 1);
Error, (in Primmetje) invalid boolean expression: [[6, 13.5]]

I think it has something to do with the double brackes, but I'm not sure how to solve it.

How to change the numbers shown in the diagram shapes from y=0.5- to rigth form








For an Array A, say, and some positive integer n, say, Maple interpretes A^n as raising each entry separately to the same power n. Without the Physics package loaded, A^n can also be written as A . A . ... . A (n times). But with the Physics package loaded, this equality is broken (at least in Maple 2017): If A is a 2D square Array, A . A all of a sudden is no longer equal to A^2, but rather to convert(A,Matrix)^2, i.e., to the square of the Array considered as a Matrix. The presence of the dot operator seems to make the Physics enviroment convert A to a Matrix. This seems to me to be a bug.

Dear users,

I have an issue with finding real part of a complex variable function. In calculating the real part I see two arguments and the plot is not smooth. How to get real part correct. The worksheet is attached.




##Toya complex variable method










z := exp(I*theta)




k := beta_c/(1+nu_c)



nu_c := (kappa2*mu+mu2)/(kappa*mu2+mu)



d_1c := (N_infty+T_infty)*(1/2)



lambda := -evalf(ln(nu_c)/(2*Pi))




beta_c := mu*(1+kappa2)/(kappa*mu2+mu)



zeta_c := ((z-a*exp(I*alpha))/(z-a*exp(-I*alpha)))^(I*lambda)/((z-a*exp(I*alpha))^.5*(z-a*exp(-I*alpha))^.5)




c0_c := G_c+I*H_c









































assume((1/6)*Pi < theta, theta < 2*Pi-(1/6)*Pi)


-0.8815855810e-10*((((1.000000000*cos(theta)^7+(0.5294827753e-2+.5671599115*sin(theta))*cos(theta)^6-4.533186669*cos(theta)^5+(-11.80630620+4.886343937*sin(theta))*cos(theta)^4+3.402782742*cos(theta)^3+(9213180122.+0.9866808100e-1*sin(theta))*cos(theta)^2+(-0.1055437876e11+0.1595769608e11*sin(theta))*cos(theta)-5794103792.*sin(theta)+1760041721.)*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(-.5600908440*cos(theta)^7+(0.6523625301e-2+1.134319823*sin(theta))*cos(theta)^6+4.644568297*cos(theta)^5+(-0.2905669688e-1+10.20004207*sin(theta))*cos(theta)^4-0.1774243515e-1*cos(theta)^3+(0.1595769609e11-9.082306669*sin(theta))*cos(theta)^2+(-7023191163.-9213180109.*sin(theta))*cos(theta)-3154310102.*sin(theta)-7408031461.)*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037)))*cos(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))+(-.5600908440*cos(theta)^7+(1.134319823*sin(theta)+0.4756356038e-2)*cos(theta)^6+4.644568284*cos(theta)^5+(11.37920491*sin(theta)-0.2640575516e-1)*cos(theta)^4-0.1774243890e-1*cos(theta)^3+(-11.39571957*sin(theta)+0.1595769607e11)*cos(theta)^2+(-9213180108.*sin(theta)-7023191160.)*cos(theta)-7408031458.-3154310086.*sin(theta))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(-1.000000000*cos(theta)^7+(-.5671599115*sin(theta)-0.5294826902e-2)*cos(theta)^6+4.531921682*cos(theta)^5+(-4.886343941*sin(theta)+11.76153292)*cos(theta)^4-3.358186195*cos(theta)^3+(-0.9866807692e-1*sin(theta)-9213180122.)*cos(theta)^2+(-0.1595769609e11*sin(theta)+0.1055437877e11)*cos(theta)-1760041726.+5794103798.*sin(theta))*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037)))*cos(0.314104002e-1*ln(1492820323.-1292820323.*cos(theta)+746410161.*sin(theta))-0.314104002e-1*ln(-1292820322.*cos(theta)-746410161.4*sin(theta)+1492820322.))+(((-.5600908440*cos(theta)^7+(1.134319823*sin(theta)+0.4756356038e-2)*cos(theta)^6+4.626658979*cos(theta)^5+(-0.2905667760e-1+10.24488508*sin(theta))*cos(theta)^4-.1341529536*cos(theta)^3+(0.1595769608e11-9.127079936*sin(theta))*cos(theta)^2+(-7023191161.-9213180109.*sin(theta))*cos(theta)-3154310089.*sin(theta)-7408031435.)*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(-1.134319823*cos(theta)^7-.5671599115*sin(theta)*cos(theta)^6+4.531921682*cos(theta)^5+(11.80860365-4.107288978*sin(theta))*cos(theta)^4-3.402959469*cos(theta)^3+(-9213180123.+0.1774243833e-1*sin(theta))*cos(theta)^2+(0.1055437876e11-0.1595769608e11*sin(theta))*cos(theta)+5794103807.*sin(theta)-1760041748.)*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037)))*cos(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))+(-1.000000000*cos(theta)^7-.5671599115*sin(theta)*cos(theta)^6+4.537223485*cos(theta)^5+(-4.886343950*sin(theta)+11.80860366)*cos(theta)^4-3.358186195*cos(theta)^3+(-0.9866807250e-1*sin(theta)-9213180123.)*cos(theta)^2+(0.1055437876e11-0.1595769608e11*sin(theta))*cos(theta)-1760041739.+5794103821.*sin(theta))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037))*cos(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))+(.5600908440*cos(theta)^7+(-1.134319823*sin(theta)-0.4756356038e-2)*cos(theta)^6-4.644554360*cos(theta)^5+(-10.21771474*sin(theta)+0.2905668928e-1)*cos(theta)^4+0.1774243685e-1*cos(theta)^3+(9.082306650*sin(theta)-0.1595769608e11)*cos(theta)^2+(9213180109.*sin(theta)+7023191165.)*cos(theta)+7408031453.+3154310085.*sin(theta))*sin(.5*arctan(sin(theta)+.5000000002, cos(theta)-.8660254037))*sin(.5*arctan(sin(theta)-.5000000002, cos(theta)-.8660254037)))*sin(0.314104002e-1*ln(1492820323.-1292820323.*cos(theta)+746410161.*sin(theta))-0.314104002e-1*ln(-1292820322.*cos(theta)-746410161.4*sin(theta)+1492820322.)))/((-sin(theta)+2.-1.732050807*cos(theta))^(1/4)*(sin(theta)+2.-1.732050807*cos(theta))^(1/4))


plot(%, theta = (1/6)*Pi .. 2*Pi-(1/6)*Pi)




I am trying to put a number of related 2-d plots into a 3-d frame so I can see them stacked up in the third dimension (which follows a parameter) and rotate things around.

The way I once did this successfully was to create the 2-d plots and then use plottools:-transform to move the individual plots in the third dimension, like so:


tr:=plottools:-transform((x,y) -> [x,2,y]); # the "2" gets changed for the other plots (not shown here).


The only effect I can get is that the GUI gets confused and I have to close and reload the sheet to get it back again. I have a (complicated) sheet where this actually works, but I am not able to make it work even in the small example I am posting below.

Any hint of where I am going off trail is appreciated. Incidentally, this problem is what led to the corrupted sheet I had maybe a week ago.


Mac Dude.


I got bit by Maple when I tried to combine a number of 2-d plots into one 3-d plot, using plottools:-transform to space the plots out in the third dimentsion. I have done such things before. This time, the first time I executed the final plot statement the GUI got clobbered and somehow also the whole worksheet (I may have saved it). Now, when I load it nothing shows up and worse, I cannot enter anything in the worksheet, it is completely screwy. I looked at the XML code in Emacs and it validates and I cannot find anything obviously wrong with it, i.e. no dangling tags or similar.

I used Maple 2017. In Maple 2015 the same worksheet overprints itself & makes a big mess on the screen. It is similarly unuseable.

Can one of the experts have a look at this? Although rare I have experienced similar issues on occasion before & would like to know how to get this into a sane state.


Mac Dude

I am having problems when trying to sue de colorscheme opiton. I always get an error message. The example below is from the Maple homepage:

plot3d(sin(x)*cos(y), x = 0 .. 4*Pi, y = 0 .. 4*Pi, view = [default, default, -3 .. 3], colorscheme = ["xgradient", ["Green", "Purple", "Blue"]]);
Error, (in plot3d) unexpected option: colorscheme = ["xgradient", ["Green", "Purple", "Blue"]]

Any hint?

I'm using the differential operator D to differentiate variables and look at the structure of the equations, i.e. turn things like

D[1]u-vt+v^2=0 into


However, it is assumed that this is a commutative operator, i.e. D[1,2]=D[2,1]. Can I use an option to have it not commute, or should I look into using the DETools package?



I am implementing the Extended Euclides Algorithm in Maple for arbitrary domains.

This is my function so far:

    "Extended Euclidean Algorithm"
    "INPUT: an Euclidean Domain ED and two elements from said domain"
    "OUTPUT: r,s,t such that r = gcd(a,b) = s*a + t*b ";
    local r_0, r_1, r_aux, s_0, s_1, s_aux, t_0, t_1, t_aux, q;
    # Domain checks
    # TODO: check that ED is an euclidean domain
    if not ED[Type](a) then error "1st argument must be of type ED" end if;
    if not ED[Type](b) then error "2nd argument must be of type ED" end if;
    # Initialization
    r_0 := a; r_1 := b; # gcd series
    s_0 := 1; s_1 := 0; # 1st cofactor series
    t_0 := 0; t_1 := 1; # 2nd cofactor series

    # Loop
    while r_1 <> 0 do;
        print("All is fine before the Quo");
        print(r_0); print(r_1);
        q := ED[Quo](r_0, r_1);
        print("All is fine after the Quo");
        r_aux := r_0 - q * r_1;
        r_0 := r_1; r_1 := r_aux;
        s_aux := s_0 - q * s_1;
        s_0 := s_1; s_1 := s_aux;

        t_aux := t_0 - q * t_1;
        t_0 := t_1; t_1 := t_aux;

    # Result
    return r_0, s_0, t_0;
    end proc:

Where ED is a Domain object passed as a parameter to the function.

When I call the function with certain arguments, it goes once through the loop and then in the second iteration crashes between the second and third print statement.

Concretely, upon making the call:

with(Domains): GI := Gaussian(Z); a := GI[Input](-87+47*I): b := GI[Input](-90+43*I): r, s, t := EEA(GI, a, b); evalb(a*s+b*t = r)

I get the following output:


        "All is fine before the Quo"
                              -87 + 47 _i
                              -90 + 43 _i
                      "All is fine after the Quo"
                      "All is fine before the Quo"
                              -90 + 43 _i
                                3 + 4 _i
    Error, (in E[Domains:-Rem]) cannot determine if this expression is true or false: 0 <= -90*`domains/Gaussian/badge0`(-87, 47)-43*`domains/Gaussian/badge0`(1, 0)*`domains/Gaussian/badge0`(-90, 43)

From this we should infer that calling `Gaussian(Z)[Quo]` on arguments `-90 + 43 _i` and `3 + 4 _i` should produce this error, right?

Well, think again, because when I try reproducing that from the notebook it decides to stop crashing. Calling:

    with(Domains): GI:=Gaussians(Z): a := GI[Input](-90+43*I); b := GI[Input](3+4*I); GI[Quo](a, b);

Produces the output:

                            a := -90 + 43 _i
                b := 3 + 4 _i
               -4 + 20 _i

What is going on? Why does it crash inside the function but not in the workbook?

My goal is to generate incremental values of a function to plot using dataplot. Why does the first example generate numeric values in the Vector and the second example does not?

fenq := f -> 2.1^(f+1):
pf := Vector(5, fenq)
                             [  4.41   ]
                              [  9.261  ]
                         pf := [ 19.4481 ]
                              [40.84101 ]
fseqn := (Se, f) -> Se^(f+1):
psf := Vector(5, fsenq(2.1, j))

I can plot the first data set using dataplot(pf). I cannot plot the second data set.

The command print placed within a while loop does not produce any printout. How do I  make MAPLE to produce  it?

I am trying to animate two variables in a 3D plot. Basically I would like to combine these two animations into one simultaneous animation:

animate(plot3d, [[y, x, (1/3)*Pi], x = 0 .. 2*Pi, y = 0 .. R, coords = spherical, scaling = constrained], R = 0 .. 5)


animate(plot3d, [[y, x, (1/3)*Pi], x = 0 .. p, y = 0 .. 5, coords = spherical, scaling = constrained], p = 0 .. 2*Pi)

so that both animations start and end simultaneously. Is this possible?

Thanks in advance.


M := `<,>`(`<|>`(1, 2, 3), `<|>`(4, 5, 6), `<|>`(7, 8, 9))

Matrix(%id = 18446745804653824710)


b := `<|>`(10, 11, 12)

Vector[row](%id = 18446745804653819654)



Error, (in rtable/Sum) invalid input: dimensions do not match: Matrix(1 .. 3, 1 .. 3) cannot be added to Vector[row](1 .. 3)



Of course the above addition will throw an error because M and b have different dimensions. But if broadcasting was allowed, then the row vector b is added to each row in the matrix M. For example, in Python:



Is there a similar feature in Maple?




      I need to compute something involved with the pseudo differential operators.

Specifically, I need to calculate the inverse of a pseudo differential operator, the multiplication of two pseudo differential operators, and the n-th root of a pseudo differential operator. 

I don't know whether Maple could handle these. 


First 9 10 11 12 13 14 15 Last Page 11 of 40