## 16053 Reputation

12 years, 200 days

## bug...

This is certainly a bug. Do

```with(geometry):
point(o, 0, 0);
point(A, 0, 1);
point(d, 0, 2);
point(F, 0.8944271920, 1.4472135960);
line(lOD, [o, d]);
line(lAF, [A, F]);
alpha1 := FindAngle(lOD, lAF);
alpha:=min(alpha1,Pi-alpha1);```

alpha := 1.107148718

## @@ operator...

```f:=y->sqrt((1+y)/2):
cos(Pi/2)=0:
cos(Pi/2^n)=(f@@(n-1))(0):

# Examples
cos(Pi/16)=(f@@3)(0);
cos(Pi/64)=(f@@5)(0);
```

## Workaround...

Any command, if you add the  %  symbol in front of it, becomes inert. If we replace  Sum  with  %sum , then the bug disappears. See below

## Solution for specific parameters...

Your system contains too many parameters  Q11A, Q11Ay, Q11Az, Q11Iy, Q11Iz, Q11J, Q16A, Q16Ay, Q16Az, Q16Iz, Q16J, Q55A, Q55Ay, Q55Iy, Q66A, Q66Az, Q66Iz  (total 17 ones) with unknown values. If you specify the values of these parameters, Maple easily solves this system. I took parameter values from 1 to 17.

## Procedure...

Here is a procedure for this:

```LeastDegree:=proc(P::polynom, var::{set,list})
local L;
L:=sort(map(p->degree(p,var),[op(P)]));
select(p->degree(p,var)=L[1],P);
end proc:
```

Examples of use:

f:= 100*x^2*y^2 + 35*x^2*y + 45*y:
g:= 13*x^2*y^2 + x*a*y^2 + 2*y*x^2:
LeastDegree(f, [x,y]);
LeastDegree(g, [x,y]);

45*y
a*x*y^2+2*x^2*y

Edit.

## The range for x...

Specify the range for x:

`plot(sin(4*x)+1/3*cos(6*x), x=0..2*Pi);`

## Another animation...

This animation shows thin cylindrical disks, summing up the volumes of which and passing to the limit, we get the exact volume:

```restart;
f:=x^(1/2):
g:=x^2/8:
X:=r*cos(phi): Y:=r*sin(phi):
P:=plot3d(eval([[X,Y,f],[X,Y,g]],x=r), r=0..4, phi=0..2*Pi, style=surface, color=["Khaki","LightBlue"], scaling=constrained, axes=normal, labels=[z,x,y], orientation=[20,80], transparency=0.5):
F:=y->plots:-display(plot3d([[r*cos(phi),r*sin(phi),y],[r*cos(phi),r*sin(phi),y+h]], r=y^2..sqrt(8*y), phi=0..2*Pi, style=surface, color=gold), plot3d([[y^2*cos(phi),y^2*sin(phi),H],[sqrt(8*y)*cos(phi),sqrt(8*y)*sin(phi),H]], H=y..y+h, phi=0..2*Pi, style=surface, color=gold)):
h:=0.15:
plots:-animate(F,[y], y=0..2-h, frames=60, background=P);
```

# Volume of this body in 2 ways
Int(Pi*(8*y-y^4), y=0..2)=int(Pi*(8*y-y^4), y=0..2);  # Washer (disk) method
Int((sqrt(x)-x^2/8)*2*Pi*x, x=0..4)=int((sqrt(x)-x^2/8)*2*Pi*x, x=0..4);  # Shell (cylinder) method

## Solution...

I guess that you consider this function to be real-valued, so its domain will be x>0 and x<1 . The solution to your problem is based on 2 key properties that are easy to prove:
1. The graph of the function is symmetric with respect to the line  x = 1/2 .
2. For any  a>2 the function  f(x)  has  1 local  maximum at  x=1/2  and 2 local minimums  x1  and  x2

By virtue of symmetry, all these conditions (df/dx(x=x1)=df/dx(x=x2)=0 and f(x1)=f(x2)) are satisfied for these points x1  and  x2. Below the calculation of  x1  and  x2  and the plotting for  a=3 .

```restart;
f:=(x,a)->a*x*(1-x)+x*ln(x)+(1-x)*ln(1-x);
limit(f(x,a),x=0);
plot(f(x,3),x=0..1);
x1:=fsolve(diff(f(x,3),x));
x2:=1-x1;
plot(f(x,3), x=x1..x2);
```

## coeff...

```A:=d*n0/dt+d*epsilon*n1/dt+d*epsilon^(3/2)*n2/dt+d*epsilon^2*n3/dt+epsilon*d*n0*u1/dx+epsilon^(3/2)*d*n0*u2/dx+d*n0*epsilon^2*u3/dx+d*epsilon^2*n1*u1/dx+d*epsilon^(5/2)*n1*u2/dx:
coeff(A,epsilon^(3/2));
```

d*n2/dt+d*n0*u2/dx

## Solution...

The list  L2 contains all the options for representing numbers from your list in a sum of no more than 5 different squares.

For some reason, the document is not displayed inline. Therefore, I copied the code and the output fragment:

```restart;
Squares:=[seq(i^2,i=0..12)]:
k:=0:
for n from 129 to 129+13^2 do
for m from 1 to 5 do
for c in combinat:-choose(Squares,m) do
if n=add(c) then k:=k+1; L[k]:=[n,c] fi;
od: od: od:
L:=convert(L,list):
L1:={seq(p[1]=`+`(seq(sqrt(p[2][i])^`2`,i=1..nops(p[2]))),p=L)}:
L2:=[ListTools:-Categorize((x,y)->lhs(x)=lhs(y),[L1[]])]:
for p in L2 do
lhs(p[1])=`or`(seq(rhs(p[k]),k=1..nops(p)));
od;
```

Edit.

## Another option...

I made 2 graphs: the first is static with a cutout in the first octant for greater clarity, the second is dynamic (animation). The upper and lower surfaces are made in different colors and the scale is equalized in all axes (scaling=constrained):

```restart;
f:=x^(1/2):
g:=x^2/8:
X:=r*cos(phi): Y:=r*sin(phi):
plot3d(eval([[X,Y,f],[X,Y,g]],x=r), r=0..4, phi=Pi/2..2*Pi, color=["LightBlue","Khaki"], scaling=constrained, axes=normal, labels=[z,x,y], orientation=[25,75], lightmodel=light1);
plots:-animate(plot3d,[eval([[X,Y,f],[X,Y,g]],x=r), r=0..4, phi=Pi/2..a, color=["LightBlue","Khaki"], scaling=constrained, axes=normal, labels=[z,x,y], orientation=[25,75], lightmodel=light1], a=Pi/2..5*Pi/2, frames=60);
```

## average path length...

You mean the arithmetic mean? Why waste your time and look for the appropriate command if the problem is solved simply by adding the distances between all kinds of pairs of vertices and dividing by the number of these pairs. Here is an example:

```with(GraphTheory):
G := Graph([1, 2, 3, 4, 5], {{1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 3}, {2, 5}, {3, 4}, {4, 5}}):
Dists:=AllPairsDistance(G);
`+`(seq(seq(Dists[i,j],j=i+1..5),i=1..4))/10;```

In this example (when we set the graph  G ), distances are not specified and, by default, the length of each edge is assumed to be 1.

Edit. The last line of code can be written shorter:

## Procedure...

```Index:=proc(v::{Vector,Array})
local i0,i1,i;
i0:=`if`(v::Vector,1,lhs(op(v)[1]));
i1:=`if`(v::Vector,op(v)[1],rhs(op(v)[1]));
for i from i0 to i1 do
if v[i]>=0 then return i fi;
od;
end proc:
```

Examples of use:
V:=Vector([-1,-1,-2,0,3,4]):
Index(V);
V1:=Array(0..3, [-1,-2,4,-5]):
Index(V1);
V2:=Vector([-1,-1,-2]):
Index(V2);

4
2

Edit.

## Rational function...

```f:=x->-(x^3-6*x^2+11*x-6)*(x^2-4*x+5)/(x^4-8*x^3+24*x^2-32*x+17);
plot([f(x),2-x], x=-2..6, linestyle=[1,3],color=[red,blue], thickness=[2,0], scaling=constrained);
```

Addition. There is a rational function with polynomials of lower degrees satisfying all conditions:

```f:=x->(-x^3+6*x^2-11*x+6)/(x^2-4*x+5);
convert(f(x),parfrac);
plot([f(x),2-x], x=-4..8, -5..5,  linestyle=[1,3],color=[red,blue], thickness=[2,0], scaling=constrained);
```

## Procedure...

Here is a procedure for this:

```Grouping:=proc(L::listlist)
local L1;
uses ListTools;
L1:=[Categorize((x,y)->x[2]=y[2], L)];
map(p->[p[1,2],map(l->l[1],p)], L1);
end proc:```

Example of use:

MyNestedList := [   [g1, [1,2,3]]     ,   [g2, [0,1,3]]   ,  [g3, [1,2,3]]  ,  [g4, [0,1,3]]]:
Grouping(MyNestedList);

[[[1, 2, 3], [g1, g3]], [[0, 1, 3], [g2, g4]]]

 First 20 21 22 23 24 25 26 Last Page 22 of 249
﻿