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

## How to run an executable program from Maple...

Dear All,

I have an executable program which I have generated with Fortran. Is it possible to run such a program from Maple? It sounds a bit weird but that would simplify my computation, since I would not need to use scripts in Linux. Thank you very much.

Cheers.

## Euler’s circle of an inscribed quadrilateral...

restart;
with(geometry):
with(plots):
_EnvHorizont:lName = 'x';
_EnvVerticalName = 'y';
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc;
R := 5;
ang := [3/4*Pi, -(3*Pi)/4, -Pi/6,4*Pi/9];
seq(point(||(P, i), [R*cos(ang[i]), R*sin(ang[i])]), i = 1 .. 4);
pts:=[seq(P || i,i=1..4)]:
seq(dsegment(||(seg, i), [||(P, i), ||(P, irem(i, 4) + 1)]), i = 1 .. 4);
Triangle(Tr1,[P1,P2,P4]);
EulerCircle(Elc1,Tr1,'centername'=o);
circle(cir, [point(OO, [0, 0]), R]);
dist := proc(M, N) sqrt(Vdot(M - N, M - N)); end proc;
display(draw([P1(color = black, symbol = solidcircle, symbolsize = 12),
P2(color = black, symbol = solidcircle, symbolsize = 12),
P3(color = black, symbol = solidcircle, symbolsize = 12),
P4(color = black, symbol = solidcircle, symbolsize = 12),seg1,
seg2,seg3,seq4,Tr1,Elc1,
cir(color = blue)]),
textplot([[seq( [ coordinates(||(P, i))[], convert(||(P, i), string)],i=1..4],
,align = [above, right]), axes = none);
does not recognize neg4 or tr1? I don't know to manage. Thank you.

## Difficulty with displat draw and textplot...

restart;
with(geometry):
with(plots):
_EnvHorizontalName = 'x':
_EnvVerticalName = 'y':
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc:
R := 5:
ang := [2/3*Pi, -3*Pi*1/4, -Pi*1/6]:
seq(point(||(P, i), [R*cos(ang[i]), R*sin(ang[i])]), i = 1 .. 3):
seq(dsegment(||(seg, i), [||(P, i), ||(P, irem(i, 3) + 1)]), i = 1 .. 3):
circle(cir, [point(OO, [0, 0]), R]):
dist := proc(M, N) sqrt(Vdot(M - N, M - N)); end proc:

display*([draw*[P1(color = black, symbol = solidcircle, symbolsize = 12),
P2(color = black, symbol = solidcircle, symbolsize = 12),
P3(color = black, symbol = solidcircle, symbolsize = 12),
cir(color = blue)],
textplot*([[coordinates(P1)[], "P1"],
[coordinates(P2)[], "P2"],
[coordinates(P3)[], "P3"]], align = [above, right])], axes = none);
/[
plots:-display |[geometry:-draw [
$P1(color = black, symbol = solidcircle, symbolsize = 12), P2(color = black, symbol = solidcircle, symbolsize = 12), P3(color = black, symbol = solidcircle, symbolsize = 12), /[[-5 5 (1/2) ] cir(color = blue)], plots:-textplot |[[--, - 3 , "P1"], \[[2 2 ] [ 5 (1/2) 5 (1/2) ] [5 (1/2) -5 ]] [- - 2 , - - 2 , "P2"], [- 3 , --, "P3"]], [ 2 2 ] [2 2 ]]$             \
align = [above, right]|], axes = none|
/]             /

no figure drawn, Why? Thank you

## Given a function, I want maple to produce an ODE o...

I remember that once there was an option to provide to maple a given function and it produced a suitable DE that this function solves.

Can you remind me how to do it?

I remember there was such an option in the previous versions of maple.

## Projection of a point on a line...

do not accept substitution after line EQ
restart;
with(LinearAlgebra);
A := [1, -2];
B := [-2, 3];
C := [1, 1];
M := [x, y];
ProjPL := proc(C, A, B) local M, AB, AM, Q, eq, EQ, eq1, a, b, c, t, tt, n, dist, x, y, xH, yH, H, CH, no; M := [x, y]; AM := M - A; AB := B - A; Q := Matrix(2, [AM, AB]); eq := Determinant(Q); a := coeff(eq, x); b := coeff(eq, y); c := tcoeff(eq); dist := abs(a + b + c)/sqrt(a^2 + b^2); n := [a, b]; x := C[1] + n[1]*t; y := C[2] + n[2]*t; EQ := eq = 0; tt := solve(subs(x = C[1] + n[1]*t, y = C[2] + n[2]*t, EQ), t); xH := subs(t = tt, x); yH := subs(t = tt, y); H := [xH, yH]; CH := H - C; no := sqrt(CH[1]^2 + CH[2]^2); RETURN(EQ, dist, H, no); end proc;
ProjPL(C, A, B);

## Copying output together vs seperately...

So I have a problem when copying multiple output from Maple to Word. I am using a simple example here.

When I copy each part of the output as an image SEPERATELY, it comes out much cleaner than if I highlight everything together and then copy. Is there a reason this is the case and is there a way to fix this problem?

Here is the Maple Code:

with(plottools);
with(plots);
ttt1 := textplot([0, 1, "3  +  5  =  __", color = "black", font = ["Arial", "bold", 120]]);
display(ttt1, size = [1000, 200], axes = none);
ttt1 := textplot([0, 1, "1  +  3  =  __", color = "black", font = ["Arial", "bold", 120]]);
display(ttt1, size = [1000, 200], axes = none);

I also uploaded the Maple Worksheet

Here is the output:

There are TWO imges in the output in this example. I tried copying both together and pasting them, and then I tried copying them individually. The output is very different in quality.

The one copied alot is much cleaner once copied and pasted in Word. Does anyone why this is happening? I don't want to have to copy images individally for obvoius reasons. I know this example is only two images but what if there was alot more, etc.

Thank you

 >
 >
 >

## How do I get rid of Typesetting:-mprintslash?...

plot-problem.mw

I have done something but what?

I want to use maple notation for input and  output.

I have done something to mess this up.

How do I get rid of the typesetting messages?

## poncelet theorem for the triangle...

restart;
with(geometry);
with(plots);
_EnvHorizontalName = 'x';
_EnvVerticalName = 'y';
Vdot := proc(U, V) local i; add(U[i]*V[i], i = 1 .. 2); end proc;
dist := proc(M, N) sqrt(Vdot(M - N, M - N)); end proc;
EQ := proc(M, N) local eq, a, b, c; eq := simplify(expand((y - M[2])/(x - M[1]) - (N[2] - M[2])/(N[1] - M[1]))*(x - P1[1])*(P2[1] - P1[1])); a := coeff(eq, x); b := coeff(eq, y); c := tcoeff(eq, [x, y]); RETURN(-a*x/c - b*y/c - 1); end proc;
R := 5;
ang := [2/3*Pi, -3*Pi*1/4, -Pi*1/6];
seq(point(||(P, i), [R*cos(ang[i]), R*sin(ang[i])]), i = 1 .. 3);
seq(dsegment(||(seg, i), [||(P, i), ||(P, irem(i, 3) + 1)]), i = 1 .. 3);
circle(cir, [point(OO, [0, 0]), R]);
sol := solve(subs(x = 2, Equation(cir, [x, y])), y);
point(A, [2, sol[1]]);
triangle(Tri, [P1, P2, P3]);
incircle(inc, Tri, 'centername' = oo);
circle(Cr, [A, oo]);
sol := solve({Equation(Cr, [x, y]), Equation(inc, [x, y])}, {x, y});
point(H1, [subs(sol, x), subs(sol, y)]);
line(L, [A, oo]);
reflection(H2, H1, L);
line(L1, [A, H1]);
line(L2, [A, H2]);
Equation(cir, [x, y]);
Equation(L1, [x, y]);
sol := solve({Equation(L1, [x, y]), Equation(cir, [x, y])}, {x, y});
evalf(%);
point(M1, [subs(sol, x), subs(sol, y)]);
sol2 := solve({Equation(L2, [x, y]), Equation(cir, [x, y])}, {x, y});
evalf(%);
point(M2, [subs(sol2, x), subs(sol2, y)]);
triangle(TR, [M1, M2, A]);
display([draw([P1(symbol = solidcircle, symbolsize = 8, color = blue), P2(symbol = solidcircle, symbolsize = 8, color = blue), P3(symbol = solidcircle, symbolsize = 8, color = blue), A(symbol = solidcircle, symbolsize = 8, color = black), H1(symbol = solidcircle, symbolsize = 8, color = black), H2(symbol = solidcircle, symbolsize = 8, color = black), L1(color = black), L2(color = black), seg1(color = magenta), seg2(color = magenta), seg3(color = magenta), Cr(color = black), cir(color = magenta), inc(color = blue)]), textplot([seq([coordinates(||(P, i))[], convert(||(P, i), string)], i = 1 .. 3)], 'align' = {'above', 'left'})], view = [-6 .. 10, -15 .. 6], scaling = constrained, size = [800, 800], axes = none);
It seems that there is conusion between M1 and M2. How to write letters A, M1 ,M2, H1, H2 ? Thank you.

## How do I plot volume of revolution...

How do I plot a volume of revolution? I can plot other volumes using Student[Calculus1]]:-VolumeOfRevolution, but not this one. I get a blank plot. I do get the correct volume from output=value..

How do I plot this using plot3d?

restart;
a := 0; b := 1;
f := (x) -> x^2+2;
g := (x) -> 1/2*x+1;
V := int(f(x)^2 - g(x)^2,x=a..b)*Pi;
Student[Calculus1]:-VolumeOfRevolution(f(x),g(x),x=a..b,output=value);
Student[Calculus1]:-VolumeOfRevolution(f(x),g(x),x=a..b,output=plot);

## Using greek letters in menues, such as the "Enter ...

Hello,

I have been trying to figure this out for a long time and can't find anyone else having the same problem.

I use the built-in unit system for assigned values (short-cut is Ctrl+Shift+u) a lot when doing electronics calculations and electromagnetism, so I often use resistances and therefore need to use Ohm. This is very often an option in the "Choose Unit" drop-down menu on the right, but when too many units are brought into the same calculation the option dissappear. Usually I the go to the "Enter Unit" menu as to write the unit out myself I cannot figure out a way for it to accept greek letters. Does anyone know what to do?

## Problem with Solving a PDE...

Hi Everyone,

I intend to find the invariants of a 2nd-order Tensor using the representation of the rotational group as an Infinitesimal generator. However, maple does not seem to find the correct invariants $\tr \mathbf{a}$, $\tr \mathbf{a}^2$, $\tr \mathbf{a}^3$. Maple only returns an empty set. I can't seem to figure out why that is the case.

Here is my code

 >
 >
 >
 >
 >
 (1)
 >
 (2)
 >
 (3)
 >
 >
 (4)