## How to plot vector fields?...

 > restart;
 > with(Physics):with(plots):with(DETools):
 > 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)};
 (1)
 > sys1:=subs({n=1,k=1},sys);
 (2)
 > conv:=plottools:-transform((a,b)->[a*cos(b),a*sin(b)]):
 > p1:=DEplot(sys1,[r(t),phi(t)],t=0..30,r=0..10,phi=0..2*Pi,stepsize=0.01);
 > plots:-display([conv(p1)],axiscoordinates=polar);
 >

Could you help how to fix the code?

## Maple keep freezing...

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.

## DEplot for polar coordinates...

What should I fix my code in order to work?

## unevaluated/inert Matrix-Vector product?...

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

inert_matrix_products.mw

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

Define a matrix K and vector U as:

 (1)

 (2)

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

 (3)

however output I am really looking for is

In the later case,  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.

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?

 (4)

 (5)

 (6)

 (7)

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 wrong.SKMHH27_37_2021_New.mw

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 file.SKMHH27_37_2019_Var.mw.

## Why can a function evaluate a variable local to an...

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;         g('z');         h('z');     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!

## Is there an error in dsolve using method=laplace...

Maple 2021

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):

 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >
 (8)
 >
 (9)
 >
 (10)
 >
 >
 (11)
 >
 (12)
 >
 (13)
 >
 (14)
 >

## How can the functional derivative/variation of the...

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.

RicciAction.mw

Thank you

## Cannot solve with dsolve the self similarity probl...

Hello,

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

 > Pr:=1
 (1)
 > etamax := infinity
 (2)

 > 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)

 >

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

 > sol:=dsolve([eq,bcs],[F(eta),theta(eta)])

## Chevron's lemma...

restart;
with(geometry):
with(plots):
_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:
_local(D);
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(%))]):
BD := distance(B, D):
DC := distance(C, D):
triangle(ABC, [A, B, C]):
area(ABC):
triangle(ABD, [A, B, D]):
area(ABD):
triangle(EBD, [E, B, D]):
area(EBD):
triangle(EDC, [E, D, C]):
area(EDC):
triangle(AEC, [A, E, C]):
area(AEC):
triangle(ABE, [A, B, E]):
area(ABE):
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")

## How can I Simplify in the physics package a tensor...

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.

ActionFieldEquations.mw

## Monge(s circle of an ellipse...

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.

## barycentre of 3 weighted points...

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);
2

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.

## Error (in f) when datatype float[8]...

I dont know why I could not solve this problem.

I have attached my worksheet.

Please anyone help me to get solution to this problem.

Thank you so much

fypppp.mw