Maple 2021 Questions and Posts

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

Why did the last line is(ysol2[1]>0) give false?

Maple does not recognize the assumption?

Thanks in advance.
























case0; x = 0, y = 0, z = 0


Vector[column](%id = 36893490685786064044)


"case1: z=0 ,  h(x,y)=0,  f(x,y)=0 :   From y=(theta*x-1)*(1-x)=y -> 1/(theta)<x and x<1"

xsol1:=solve(h=0,x) assuming x>1/theta and x<1;
ysol1:=solve(subs(x=xsol1,f)=0,y)assuming xsol1>1/theta and xsol1<1;

xsol1 := sigma1/alpha


ysol1 := -(-sigma1*theta+alpha)*(alpha-sigma1)/alpha^2


Vector[column](%id = 36893490685786055012)


case2; g(y) = 0, h(x, y) = 0

ysol2:=simplify(subs(sigma2=delta*eta,ysol)) assuming (1-4*beta*eta^2>0 and eta>0);

Warning, solve may be ignoring assumptions on the input variables.


[(1/2)*(delta+(-4*beta*sigma2^2+delta^2)^(1/2))/(beta*sigma2), -(1/2)*(-delta+(-4*beta*sigma2^2+delta^2)^(1/2))/(beta*sigma2)]


[(1/2)*(1+(-4*beta*eta^2+1)^(1/2))/(beta*eta), (1/2)*(1-(-4*beta*eta^2+1)^(1/2))/(beta*eta)]












The command for doing syntactical exact-match substitutions is subs, however, subs applies transformation rules throughout an expression only once. The documentation of eval claims that the (recursive) evaluation is repeated until either the result does not change, the documentation of applyrule claims that applyrule … applies the rules until no rule can be applied any more, and the documentation of MmaTranslator[Mma][ReplaceRepeated] claims that the single ReplaceRepeated command performs replacements until expression no longer changes.
So, if I comprehend correctly, 

x := [[[[]]]]: # Remove empty lists from x repeatedly.
(*⒈*) eval['recurse'](x, [[] = 'NULL']);
(*⒉*) applyrule([[] = 'NULL'], x);
(*⒊*) MmaTranslator:-Mma:-ReplaceRepeated(x, [[] = NULL])

should all return NULL, but in fact, 

eval['recurse'](x, [[] = 'NULL']);

applyrule([[] = 'NULL'], x);
Error, (in PatternMatching:-AlgStruct:-TableLookup) invalid input: unknown uses a 1st argument, x, which is missing
MmaTranslator:-Mma:-ReplaceRepeated(x, [[] = NULL]);
                            () = ()

In other words, none of these replacements is feasible. 

Have I missed something? (It seems to me that an explicit procedural do...until loop can be actually avoidable here!) 



sys := {diff(r(t),t)=p(t)/m,

{diff(p(t), t) = l^2/(m*r(t)^3)-n*k*r(t)^(n-1), diff(phi(t), t) = l/(m*r(t)^2), diff(r(t), t) = p(t)/m}



{diff(p(t), t) = l^2/(m*r(t)^3)-1, diff(phi(t), t) = l/(m*r(t)^2), diff(r(t), t) = p(t)/m}




Error, (in DEtools/DEplot) system must have same number of dependent variables as DE's.



Error, (in conv) invalid argument



Could you help how to fix the code?


I just downloaded maple 2021 (I get i free from my school). I used maple for the last 4 years but, now when i opdatede to maple 2021 from version 2020, its just keep freezing i have try to uninstall 3 times by now and it still keep freezing. 

What should I fix my code in order to work?

Thanks in advance,

Can Maple carry around an unevaluated/inert  Matrix-Vector product(A matrix product without executing the matrix multiplication)? See Maple sheet.




Can Maple carry around an unevaluated/inert explicit Matrix-Vector product?


Define a matrix K and vector U as:


U := `<,>`(u1, u2)

Vector[column](%id = 36893490583464982996)


K := Matrix(2, 2, symbol = k)

Matrix(%id = 36893490583464975884)


I can take their product using MatrixVectorMultiply( ) I get,

MatrixVectorMultiply(K, U)

Vector[column](%id = 36893490583464964812)


however output I am really looking for is


(Matrix(2, 2, {(1, 1) = k[1, 1], (1, 2) = k[1, 2], (2, 1) = k[2, 1], (2, 2) = k[2, 2]})).(Vector(2, {(1) = u1, (2) = u2}))


In the later case, K.U is still a product however the actual matrix multiplication is not carried out. Sure, eventually I will want to evaluate the matrix-vector product but sometimes when setting up a problem I want to look at the explicit matrix equation before any explicit matrix multiplication is carried out.NULL


Here I show some ideas that don't work but may give a sense of what I am going for. I am essentially trying to mute the computation of the product while keeping the elements of the product together for further substitutions elsewhere. This there a standardized way to complish this? Or do I have to write my own procedure for something like this?


`&MatrixVectorMultiply`(K, U)

`&MatrixVectorMultiply`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))


%MatrixVectorMultiply(K, U)

%MatrixVectorMultiply(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))


`&.`(K, U)

`&.`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))



`&.`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))*Matrix(%id = 36893490583464939756).Vector[column](%id = 36893490583464982996)




After a long hiatus I have come back to the issue of null tetrads in the physics package in light of the updates to  Maple in 2021. I have uploaded a document file to illustrate. See below. My first question concerns the labelling of elements of a null tetrad. After calling the metric 27,37 from Stephani et al, and using Setup to specify a null tetrad, Maple's choice is such that the elements labelled m and bar m are not complex. Rather, both these elements are in fact real, while the elements lablled l and n are complex, with one being the negative complex conjugate of the other. While these are just labels, they don't agree with the usual conventions for the Newman-Penrose formalism, which is disorienting. What convention is Maple using to label the elments of a null tetrad?

Next, I try to specify the null tetrad used by Stephani et al., first by converting it into covariant form (which I did by hand rather than in Maple). In Maple's default null tetrad, the order in which Maple listed the elements of the null tetrad is n, m, bar m, l (as rows in the matrix display for e_[ ]), so I followed that convention (in the conventions of Stephani et al., the first and fourh element should have scalar product -1, the second and third scalar product 1, and all other scalar products zero, which is the case). After entering the matrix and using Setup to specify the null tetrad by the matrix, I get an error message saying that the components of the metric with respect to my tetrad are not just 0, 1, and -1. Yet,  executing eta_[ ]  does not confirm this warning; nor does a computation by hand.

Finally, IsTetrad asserts the tetrad is not null, contrary to the fact that it is a null tetrad.

Since I have followed the conventions implicit in Maple's default null tetrad for this metric, I am puzzled as to what has gone

On the other hand, taking into account how Maple 2019 orders the coordinates in Stephani et al 27.37 and labels the null vectors in a null ttetrad, if I translate accordingly what I have in the 2021 Maple file, Maple 2019 confirms Stephani et al.'s null tetrad is indeed a null tetrad, as one would expect. See the following

Consider this example:

    h := proc(x)
        printf("h says: %a evaluates to %a.", x, eval(x));
    end proc:
    f := proc()
        local z, g;
        g := proc(x)
            printf("g says: %a evaluates to %a.\n", x, eval(x));
        end proc;
        z := 2;
    end proc:

    > f()
    g says: z evaluates to 2.
    h says: z evaluates to 2.

I can't figure out, whats going on here. Now it comes as no surprise, of course, that g would be able to see z. After all, its definition is within the lexical scope of z. But how can h possibly see z?

When eval is called in h, does eval somehow look into the call stack, and find out it was called by h, which was in turn called by f and then inspect the local variables of f?

Could you explain, what's going on here, please?

Thank you all!

I was looking at symbolically solving a second-order differential equation and it looks like the method=laplace method has a sign error when the coefficients are presented in a certain way.  Below is a picture of some examples with and without method=laplace that should all have the same closed form.  Note that lines (s6) and (s8) have different signs in the exponential than they should have (which is a HUGE problem):


s1 := dsolve([diff(x(t), t, t)+2*a*(diff(x(t), t))+a^2*x(t)], [x(t)])

{x(t) = exp(-a*t)*(_C2*t+_C1)}


s2 := dsolve([diff(x(t), t, t)+2*a*(diff(x(t), t))+a^2*x(t)], [x(t)], method = laplace)

x(t) = exp(-a*t)*(t*(D(x))(0)+x(0)*(a*t+1))


s3 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/b+x(t)/b^2], [x(t)])

{x(t) = exp(-t/b)*(_C2*t+_C1)}


s4 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/b+x(t)/b^2], [x(t)], method = laplace)

x(t) = exp(-t/b)*(t*(D(x))(0)+x(0)*(b+t)/b)


s5 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/sqrt(L*C)+x(t)/(L*C)], [x(t)])

{x(t) = exp(-(L*C)^(1/2)*t/(L*C))*(_C2*t+_C1)}


s6 := dsolve([diff(x(t), t, t)+2*(diff(x(t), t))/sqrt(L*C)+x(t)/(L*C)], [x(t)], method = laplace)

x(t) = (t*(D(x))(0)+3*C*L*x(0)*t/(L*C)^(3/2)+x(0))*exp((L*C)^(1/2)*t/(L*C))


s7 := dsolve([L*C*(diff(x(t), t, t))+2*sqrt(L*C)*(diff(x(t), t))+x(t)], [x(t)])

{x(t) = exp(-(L*C)^(1/2)*t/(L*C))*(_C2*t+_C1)}


s8 := dsolve([L*C*(diff(x(t), t, t))+2*sqrt(L*C)*(diff(x(t), t))+x(t)], [x(t)], method = laplace)

x(t) = exp(t/(L*C)^(1/2))*(t*(D(x))(0)+x(0)*(L*C+3*(L*C)^(1/2)*t)/(L*C))


s9 := dsolve([diff(x(t), t, t)+2*z*wn*(diff(x(t), t))+wn^2*x(t)], [x(t)])

{x(t) = _C1*exp((-z+(z^2-1)^(1/2))*wn*t)+_C2*exp(-(z+(z^2-1)^(1/2))*wn*t)}


s10 := dsolve([diff(x(t), t, t)+2*z*wn*(diff(x(t), t))+wn^2*x(t)], [x(t)], method = laplace)

x(t) = exp(-wn*t*z)*(cosh((wn^2*(z^2-1))^(1/2)*t)*x(0)+(x(0)*wn*z+(D(x))(0))*sinh((wn^2*(z^2-1))^(1/2)*t)/(wn^2*(z^2-1))^(1/2))


s11 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)])

{x(t) = _C1*exp((-z+(z^2-1)^(1/2))*wn*t)+_C2*exp(-(z+(z^2-1)^(1/2))*wn*t)}


s12 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)], method = laplace)

x(t) = exp(-wn*t*z)*(cosh((wn^2*(z^2-1))^(1/2)*t)*x(0)+(x(0)*wn*z+(D(x))(0))*sinh((wn^2*(z^2-1))^(1/2)*t)/(wn^2*(z^2-1))^(1/2))


s13 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)])

{x(t) = _C1*exp((-z+(z^2-1)^(1/2))*wn*t)+_C2*exp(-(z+(z^2-1)^(1/2))*wn*t)}


s14 := dsolve([(diff(x(t), t, t))/wn^2+2*z*(diff(x(t), t))/wn+x(t)], [x(t)], method = laplace)

x(t) = exp(-wn*t*z)*(cosh((wn^2*(z^2-1))^(1/2)*t)*x(0)+(x(0)*wn*z+(D(x))(0))*sinh((wn^2*(z^2-1))^(1/2)*t)/(wn^2*(z^2-1))^(1/2))




Hello Everyone, 

My questions is about a straight forward as my title suggests. I know how to compute the variation by hand and of course it is in plently of books, but I would like to know how I could possibly do it in Maple as I have some terms with non-trivial contributions where I infact need that specific variation. 

I have attached my file I have been working with that has more comments.

Thank you


I am trying to solve the self similarity problem for external natural convection which is the following coupled problem

  •     3/4*F(eta)*Theta(eta)'  = Theta(eta)''
  •     1/2 (F(eta)')^2 - 3/4 F(eta)*F(eta)'' = Pr*(Theta(eta) - F(eta)''')

where Pr is a constant and  ()' denotes differentiation with respect to eta. The boundary conditions are:

  •     at eta = 0, F = 0, F'=0, Theta = 1
  •     at eta -> infinity, F' = 0, Theta = 0

I tried the following but I cannot obtain a solution





etamax := infinity




eq:= 3/4*F(eta)*diff(theta(eta),eta) = diff(theta(eta),eta,eta),1/Pr*(1/2*diff(F(eta),eta)^2 - 3/4*F(eta)*diff(F(eta),eta,eta)) = -diff(F(eta),eta,eta,eta) + theta(eta)

(3/4)*F(eta)*(diff(theta(eta), eta)) = diff(diff(theta(eta), eta), eta), (1/2)*(diff(F(eta), eta))^2-(3/4)*F(eta)*(diff(diff(F(eta), eta), eta)) = -(diff(diff(diff(F(eta), eta), eta), eta))+theta(eta)





bcs := F(0) = 0, theta(0)=1, D(F)(0)=0,theta(etamax)=0,D(F)(etamax)=0

F(0) = 0, theta(0) = 1, (D(F))(0) = 0, theta(infinity) = 0, (D(F))(infinity) = 0






_EnvHorizontalName = 'x':
_EnvVerticalName = 'y':
EQ := proc(M, N) 
local eq, sol; 
eq := simplify(expand((y - M[2])/(x - M[1]) - (N[2] - M[2])/(N[1] - M[1]))); 
sol := solve(eq, y); 
RETURN(y = sol); end proc:
point(A, [-2, 7]):
point(B, [-5, -2]):
point(C, [8, -7]):
point(E, [1, 4]):
EQ([-5, -2], [8, -7]):
point(D, [1, subs(x = 1, rhs(%))]):
dsegment(sgAD, [A, D]):
BD := distance(B, D):
DC := distance(C, D):
triangle(ABC, [A, B, C]):
triangle(ABD, [A, B, D]):
triangle(ADC, [A, D, C]):
is(area(ABD)/area(ADC) = BD/DC):
triangle(EBD, [E, B, D]):
triangle(EDC, [E, D, C]):
triangle(AEC, [A, E, C]):
triangle(ABE, [A, B, E]):
is(area(ABE)/area(AEC) = BD/DC):
display*([draw*[A(color = black, symbol = solidcircle, symbolsize = 6), 
B(color = black, symbol = solidcircle, symbolsize = 6), 
C(color = black, symbol = solidcircle, symbolsize = 6), 
ABC(color = blue)], 
textplot*([[coordinates(A)[], "A"], 
[coordinates(B)[], "B"], 
[coordinates(C)[], "C3"]], 
align = [above, right])], 
axes = none, 
title = "Lemme du Chevron");
The program simply reproduces display...Why; Thank you.
display*([draw*[A(color = black, symbol = solidcircle, symbolsize = 12), B(color = black, symbol = solidcircle, symbolsize = 12), C(color = black, symbol = solidcircle, symbolsize = 12), ABC(color = blue)], textplot*([[-2, 7, "A"], [-5, -2, "B"], [8, -7, "C3"]], align = [above, right])], axes = none, title = "Lemme du Chevron")

Hi MaplePrimes, 

I am interested in obtaining some gravitational field equations from an action using the FunDiff command. I have been able to write what I think is a pretty short and quick worksheet(with an arbitrary metric) and I am easily able to obtain the Einstein Field Equations. However, when I introduce some new more complicated terms into the action and apply the Simplify command maple does not appear to be able to evaluate and I end up halting the computation. When I specify a metric Maple, for example Schwarzschild, Maple will easily be able to Simplify my expression but it will use metric components during the process. Where what I am interested in is just the Tensor expression with respective indices. 

I was wondering if anyone had any thoughts on how I could resolve this. 

I have attached the worksheet that I am working with. I look forward to your thoughts/comments.

Thank you.

This figure refuses to turn
Fig := proc(t) local a, b, P, Q, N, R, TG, x0, y0, p1, p2, p3, po, tp, sol; a := 11; b := 7; R := sqrt(a^2 + b^2); P := [R*sin(t), R*cos(t)]; x0 := P[1]; y0 := P[2]; TG := (a^2 - x0^2)*(y - y0)^2 + (b^2 - y0^2)*(x - x0)^2 + 2*y0*x0*(x - x0)*(y - y0) = 0; p1 := implicitplot(x^2/a^2 + y^2/b^2 - 1, x = -11 .. 11, y = -7 .. 7, color = blue); p2 := implicitplot(x^2 + y^2 - a^2 - b^2, x = -15 .. 15, y = -15 .. 15, color = blue); p3 := implicitplot(TG, x = -15 .. 15, y = -15 .. 15, color = red); sol := solve({x^2/a^2 + y^2/b^2 - 1 = 0, TG}, {x, y}, explicit); Q := [subs(sol[1], x), subs(sol[1], y)]; N := [subs(sol[2], x), subs(sol[2], y)]; po := plot([P, Q, N], style = point, symbolsize = 15, symbol = solidcircle, color = red); tp := textplot([[P[], "P"], [Q[], "Q"], [N[], "N"]], 'align' = {'above', 'left'}); display([p1, p2, p3, po, tp], scaling = constrained); end procnFig := 60;
Figs := seq(Fig(2*Pi*i/nFig), i = 0 .. nFig);
Error, (in Fig) invalid subscript selector
display(Figs, insequence = true);
NULL; Why this error message. Thank you.

How to make this program more effective ?

A := [-3, 1, 2];
B := [-2, -1, 1];
C := [0, 3, -3];
                        A := [-3, 1, 2]

                        B := [-2, -1, 1]

                        C := [0, 3, -3]

alpha[1] := 2;#weight
alpha[2] := -1;
alpha[3] := 1;
                         alpha[1] := 2

                         alpha[2] := -1

                         alpha[3] := 1

x[1] := A[1];
x[2] := B[1];
x[3] := C[1];
                           x[1] := -3

                           x[2] := -2

                           x[3] := 0

y[1] := A[2];
y[2] := B[2];
y[3] := C[2];
                           y[1] := 1

                           y[2] := -1

                           y[3] := 3

z[1] := A[3];
z[2] := B[3];
z[3] := C[3];
                           z[1] := 2

                           z[2] := 1

                           z[3] := -3

sum(alpha[i], i = 1 .. 3);

xG := sum(alpha[i]*x[i], i = 1 .. 3)/sum(alpha[i], i = 1 .. 3);
                            xG := -2

yG := sum(alpha[i]*y[i], i = 1 .. 3)/sum(alpha[i], i = 1 .. 3);
                            yG := 3

zG := sum(alpha[i]*z[i], i = 1 .. 3)/sum(alpha[i], i = 1 .. 3);
                            zG := 0
Thank you.

1 2 3 4 5 6 7 Last Page 3 of 34