## minimize a polynomial function...

Dear all,

I am trying to minimize this polynomial function G on [0,1]x[0,1]:

Maple 2022 seems unable to find the (approximate) minimum. Even adding _EnvExplicit:=true, as suggested here on a previous post, does not fix the issue.

Any suggestion?

Thanks, Nicola

 > restart:
 > _EnvExplicit:=true:
 > G := (x, y) -> ((-1)*38.87*y^4 + 39.7800000000000*y^3 + (-1)*6.76000000000000*y^2 + 10.4000000000000*y - 3.90000000000000)*x^4 + (39.78*y^4 + (-1)*40.4600000000000*y^3 + 6.80000000000000*y^2 + (-1)*10.2000000000000*y + 3.40000000000000)*x^3 + ((-1)*6.76*y^4 + 6.80000000000000*y^3 + (-1)*1.12000000000000*y^2 + 1.60000000000000*y - 0.400000000000000)*x^2 + (10.4*y^4 + (-1)*10.2000000000000*y^3 + 1.60000000000000*y^2 + (-1)*2.00000000000000*y)*x + 1. + (-1)*3.9*y^4 + (-1)*0.4*y^2 + 3.4*y^3
 (1)
 > minimize(G(x,y),x=0..1,y=0..1)

## Calculation of the trace of the SU(2) field streng...

I would like to calculate the following quantity:

Where F is the SU(2) field strength tensor given by:

The gauge field V (in my code A) is defined as

where rj is the unit vector in spherical coordinates.

I tried to calculate it with maple, however, the result is not correct. I should get a scalar function, but my result still contains dependencies on x,y,z. And I really don't know why. I have defined the gauge field in (11) and the field strength tensor in (14). I could imagine that SumOverRepeatedIndices() in (16) does not work as I think (For each a = (1,2,3) I would like a summation over mu and nu). Greek letters are my spacetime indices and lowercase letters are my space indices. Do I perhaps have to use SU(2) indices instead of the space indices? But how exactly does a SU(2) index differ from a space index?

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

This ist my unit vector:

 (7)

 (8)

 (9)

 (10)

 (11)

 (12)

 (13)

 (14)

 (15)

 (16)

 (17)

## Same equation but different parameter? ...

Hi

i use other code for equation too when i use allvalues(Root(...)) it is more near but question is this why not satisfy the ode equation this is my equation this parameter are find for this ODe why not satisfy otherwise my equestions must be wrong!

 >
 >
 >
 (1)
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)

 >
 (8)
 >
 (9)

 >
 (10)

 >

## instruction concerning the arcs is not resected...

display([plottools[arc]([op(coordinates(Omega))], r, t .. t + Pi/2, color = red, t4), plottools[arc]([op(coordinates(Omega))], r, t + Pi .. t + (3*Pi)/2, color = coral, t4), plottools[arc]([op(coordinates(Omega))], r, t - Pi/2 .. t, color = cyan, t4), plottools[arc]([op(coordinates(Omega))], r, t + Pi/2 .. t + Pi, color = green, t4)],
draw([Cir(color = blue, t4), cir(color = grey, t4), sT(color = black, t4), XXp(color = black, l3), YYp(color = black, l3), L1(color = black, l3), L2(color = black, l3), N1(color = blue, symbol = solidcircle, symbolsize = 15), N2(color = blue, symbol = solidcircle, symbolsize = 15), N3(color = blue, symbol = solidcircle, symbolsize = 15), M1(color = blue, symbol = solidcircle, symbolsize = 15)]), axes = none, view = [-30 .. 10, -10 .. 10], size = [800, 800])::
plots:-animate(Proc, [t], t = 0 .. 2*Pi, frames = 30).;

why the instruction concerning the arcs is not resected ? Thank you.

## Shortest curve on a surface connecting 2 points...

I liked the recent question from user goebeld and especially the answer from Rouben Rostamian.
I admit, I didn’t even realize that Maple had VariationalCalculus procedures.
But what if the red and green  points are on the surface x1^4 + x2^4 + x3^4 -1 = 0
Points coordinates (-0.759835685700000, -0.759835685700000, 0.759835685700000) and
(0.759835685700000, 0.759835685700000, -0.759835685700000).

Where will the shortest distance between these points on a given surface be? Taking into account symmetry, of course.

## What does it mean when DESol has an arbitrary cons...

I have a thirder order ODE with non polynomial coefficients and I naively thought to try dsolve for fun to see what happens and Maple returned DESol with a second order differential equation and an arbitrary coefficient. I know Maple outputs DESol when it cannot find a solution similar to RootOf but the arbitrary constant is what is throwing me off.

I am unsure how to interpret this, if a particular solution is found I could reduce the order and see how I could get with the second order ODE but maple doesn't produce a particular solution when I run that command.

DESol_Question.mw

## Integral using variable with units....

What is the problem with the integral below when I use a variable n?

=

=

 (1)

 (2)

## Space curve on a 3d plane connecting 2 points...

Dear all, is there a maple call to calculate the space curve connecting two points of a 3d plane?

e.g. the plane is defined by: f(x,y) = -x^2/9 + y^2/4

The two points are: P = (1,2,0), Q=(1,-1,0)

Searched: space curve laying on 3d plane connecting the two points.

Thanks

 >
 >
 >
 (1)
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)
 >
 >

## Nested square brackets in matrix...

Dear all, in the example below I create a matrix(3x2) and each element contains a vector. How can I avoid the double brackets of the matrix elements or eliminate the double brackets?

Thanks for help

## set up equations and find parameter ...

restart;
with(PolynomialTools);
with(RootFinding);
with(SolveTools);
with(LinearAlgebra);
NULL;
NULL;
E1 := (-alpha*k^2*A[1] - alpha*k^2*B[1] + 3*A[0]^2*A[1]*beta[4] + 3*A[0]^2*B[1]*beta[4] + A[1]^3*beta[4] + 3*A[1]^2*B[1]*beta[4] + 3*A[1]*B[1]^2*beta[4] + B[1]^3*beta[4] + 2*A[0]*A[1]*beta[3] + 2*A[0]*B[1]*beta[3] - w*A[1] - w*B[1])*cosh(xi)^6 + (-alpha*k^2*A[0] + A[0]^3*beta[4] + 3*A[0]*A[1]^2*beta[4] + 6*A[0]*A[1]*B[1]*beta[4] + 3*A[0]*B[1]^2*beta[4] + A[0]^2*beta[3] + A[1]^2*beta[3] + 2*A[1]*B[1]*beta[3] + B[1]^2*beta[3] - w*A[0])*sinh(xi)*cosh(xi)^5 + (2*alpha*k^2*A[1] + alpha*k^2*B[1] - 2*alpha*lambda^2*A[1] + 2*alpha*lambda^2*B[1] - 2*gamma*lambda^2*A[1] + 2*gamma*lambda^2*B[1] - 6*A[0]^2*A[1]*beta[4] - 3*A[0]^2*B[1]*beta[4] - 3*A[1]^3*beta[4] - 6*A[1]^2*B[1]*beta[4] - 3*A[1]*B[1]^2*beta[4] - 4*A[0]*A[1]*beta[3] - 2*A[0]*B[1]*beta[3] + 2*w*A[1] + w*B[1])*cosh(xi)^4 + (alpha*k^2*A[0] - A[0]^3*beta[4] - 6*A[0]*A[1]^2*beta[4] - 6*A[0]*A[1]*B[1]*beta[4] - A[0]^2*beta[3] - 2*A[1]^2*beta[3] - 2*A[1]*B[1]*beta[3] + w*A[0])*sinh(xi)*cosh(xi)^3 + (-alpha*k^2*A[1] + 4*alpha*lambda^2*A[1] + 4*gamma*lambda^2*A[1] + 3*A[0]^2*A[1]*beta[4] + 3*A[1]^3*beta[4] + 3*A[1]^2*B[1]*beta[4] + 2*A[0]*A[1]*beta[3] - w*A[1])*cosh(xi)^2 + (3*A[0]*A[1]^2*beta[4] + A[1]^2*beta[3])*sinh(xi)*cosh(xi) - 2*alpha*lambda^2*A[1] - 2*gamma*lambda^2*A[1] - A[1]^3*beta[4] = 0;
N := 6;
for i from 0 to N do
equ[1][i] := coeff(E1, {cosh(xi)^i, sinh(xi)^i}, i) = 0;
end do;
//        2               2
equ[1][0] := \\-alpha k  A[1] - alpha k  B[1]

2                      2                    3
+ 3 A[0]  A[1] beta[4] + 3 A[0]  B[1] beta[4] + A[1]  beta[4]

2                           2               3
+ 3 A[1]  B[1] beta[4] + 3 A[1] B[1]  beta[4] + B[1]  beta[4]

\
+ 2 A[0] A[1] beta[3] + 2 A[0] B[1] beta[3] - w A[1] - w B[1]/

6   /        2            3
cosh(xi)  + \-alpha k  A[0] + A[0]  beta[4]

2
+ 3 A[0] A[1]  beta[4] + 6 A[0] A[1] B[1] beta[4]

2               2               2
+ 3 A[0] B[1]  beta[4] + A[0]  beta[3] + A[1]  beta[3]

2                 \
+ 2 A[1] B[1] beta[3] + B[1]  beta[3] - w A[0]/ sinh(xi)

5   /         2               2
cosh(xi)  + \2 alpha k  A[1] + alpha k  B[1]

2                      2
- 2 alpha lambda  A[1] + 2 alpha lambda  B[1]

2                      2
- 2 gamma lambda  A[1] + 2 gamma lambda  B[1]

2                      2
- 6 A[0]  A[1] beta[4] - 3 A[0]  B[1] beta[4]

3                 2
- 3 A[1]  beta[4] - 6 A[1]  B[1] beta[4]

2
- 3 A[1] B[1]  beta[4] - 4 A[0] A[1] beta[3]

\         4   /
- 2 A[0] B[1] beta[3] + 2 w A[1] + w B[1]/ cosh(xi)  + \alpha

2            3                      2
k  A[0] - A[0]  beta[4] - 6 A[0] A[1]  beta[4]

2                 2
- 6 A[0] A[1] B[1] beta[4] - A[0]  beta[3] - 2 A[1]  beta[3]

\                  3   /
- 2 A[1] B[1] beta[3] + w A[0]/ sinh(xi) cosh(xi)  + \
2                      2                      2
-alpha k  A[1] + 4 alpha lambda  A[1] + 4 gamma lambda  A[1]

2                      3
+ 3 A[0]  A[1] beta[4] + 3 A[1]  beta[4]

2                                            \
+ 3 A[1]  B[1] beta[4] + 2 A[0] A[1] beta[3] - w A[1]/

2
cosh(xi)

/           2               2        \
+ \3 A[0] A[1]  beta[4] + A[1]  beta[3]/ sinh(xi) cosh(xi)

2                      2            3
- 2 alpha lambda  A[1] - 2 gamma lambda  A[1] - A[1]  beta[4] =

\
0/ = 0

equ[1][1] := 0 = 0

equ[1][2] := 0 = 0

equ[1][3] := 0 = 0

equ[1][4] := 0 = 0

equ[1][5] := 0 = 0

equ[1][6] := 0 = 0

NULL;
NULL;



## Can expression trees and/or DAG be displayed grapi...

Is the a print or plot function that can generate from an expression an expression tree

and/or the corresponding expression DAG

Taken from ?ProgrammingGuide,Chapter02

## Units in manual calculation of expression vs using...

I was just using Maple to do a simple calculation but the units came out all complicated.

The expression in question is work done by a van der Waals gas. The units should come out to Joules per mol.

When I do the calculation manually (second expression below) I do get that result, albeit in more basic units than Joules.

In the first expression, in which I am using subs to sub in values with units into the expression, the final expression is very complicated. Why?

 (1)

How do we simplify the units above so they become the same as the units in the same (manual) calculation below?

 (2)

## avoid the flickering points of an animation...

restart;
Proc := proc(t) local t4, l3, R, r, eq, sol; _EnvHorizontalName := 'x'; _EnvVerticalName := 'y'; t4 := thickness = 4; l3 := linestyle = dot; R := 9; r := 1/2*R; geometry:-point(OO, 0, 0); geometry:-circle(Cir, [OO, R]); geometry:-point(K, R*cos(t), R*sin(t)); geometry:-point(Omega, r*cos(t), r*sin(t)); geometry:-circle(cir, [Omega, r]); eq := geometry:-Equation(cir); geometry:-line(XXp, y = 0); geometry:-line(YYp, x = 0); geometry:-line(L1, y = x); geometry:-line(L2, y = -x); geometry:-projection(M1, K, XXp); geometry:-coordinates(M1); geometry:-point(K2, geometry:-coordinates(M1)[1] - 2*R, 0); geometry:-coordinates(K2); geometry:-segment(sT, K2, M1); geometry:-point(N1, 0, R*sin(t)); subs(y = x, eq); sol := solve(%, x); geometry:-point(N2, sol[2], sol[2]); subs(y = -x, eq); sol := solve(%, x); geometry:-point(N3, sol[2], -sol[2]); plots:-display(geometry:-draw([Cir(color = blue, t4), cir(color = grey, t4), sT(color = black, t4), XXp(color = black, l3), YYp(color = black, l3), L1(color = black, l3), L2(color = black, l3), N1(color = blue, symbol = solidcircle, symbolsize = 15), N2(color = blue, symbol = solidcircle, symbolsize = 15), N3(color = blue, symbol = solidcircle, symbolsize = 15), M1(color = blue, symbol = solidcircle, symbolsize = 15)]), axes = none, view = [-30 .. 10, -10 .. 10], size = [800, 800]); end proc;
plots:-animate(Proc, [t], t = 0 .. 2*Pi, frames = 200);
NULL;
I am trying to program  this drawing, how to improve this code ? Thank you.

## A simplification / reduction question...

I know this question has been asked time and time again. Starting of with the expr . That is the end goal I want to achieve.  How would I reduce the expansion to get it into 1-f(x,y,z)/g(x,y,z) format?. I have tried all sorts of approaches.

 > restart
 > #
 > expr:=1 - (x__1*x__2 + y__1*y__2 - z__1*z__2)^2/((x__1^2 + y__1^2 - z__1^2)*(x__2^2 + y__2^2 - z__2^2))
 (1)
 > normal( (1) );
 (2)
 > simplify( (2) );
 (3)
 (4)
 > Test:=combine(%)
 (5)
 >
 > n:={op(numer(Test))}
 (6)
 > d:={op(expand(denom(Test)))}
 (7)
 > d subset n
 (8)
 > d intersect n
 (9)
 (10)
 > factor( (10) );
 (11)
 > n minus d
 (12)
 >