Kitonum

21435 Reputation

26 Badges

17 years, 29 days

MaplePrimes Activity


These are replies submitted by Kitonum

@Markiyan Hirnyk  I think that your moralism out of place in our community. You are not a teacher at school and I'm not your pupil.

@Markiyan Hirnyk  See links on request  "задача о жуках в вершинах квадрата"  here

@smith_alpha 

1) op  command extracts operands from an expression. In syntax  op(list, e)  the list of integers indicates positions of operands at increasing nesting levels of an expression. See help for details.

2) Since your maximum is reached at a critical point, here are two more ways to solve the problem:

 

a:=eval(x, solve({diff(f,x)=0, diff(f,x,x)<0}));  # Direct short solution

or

extrema(f, {}, x, 's');  # From all the extrema values we select the point in which the maximum value

s;

a:=max(map(rhs@op, s));

It is interesting that purely visually in the output, they are indistinguishable. But Maple distinguishes them:

 

Pi, pi;

                            

 

evalf(%);

                

 

 

 

 

@Markiyan Hirnyk  What does the acronym  SCR?

@Carl Love  Thank you for the good advice!

@tomleslie  Even more easy way - to resolve this trivial example by the hand (or in mind). 

 

@cktamcu  Imput in the form  ∫xdlnx  contradicts Maple syntax to calculate integrals. See help on  int  command.

@Markiyan Hirnyk  You wrote "We see that Maple 2015.1 does take into account the numpoints option". This statement in no way motivated.

In Maple 2015.1 we have:

restart;

A := Student[Calculus1]:-VolumeOfRevolution(-x^2+2*x, sqrt(-x^2+2*x), x = 0 .. 2, output = plot):
B := Student[Calculus1]:-VolumeOfRevolution(-x^2+2*x, sqrt(-x^2+2*x), x = 0 .. 2, output = plot):
C := Student[Calculus1]:-VolumeOfRevolution(-x^2+2*x, sqrt(-x^2+2*x), x = 0 .. 2, output = plot, numpoints = 10000):

plots[display](Array([A, B, C]));

 

We see that the imputs in  A  and  B  are the same, but in  output of A green and blue lines are present. So the difference is not related to  numpoints option. B and C are different in  numpoints  option, but the outputs are the same. The hole near the point  (2,0,0)  is present in all variants.

 

 

 

@Markiyan Hirnyk  To construct a surface of revolution about the axis Ox of the curve  y=f(x), x=0..a, Maple probably using parametric surface  [x, |f(x)|*cos(phi), |f(x)|*sin(phi)] , x=0..a, phi=0..2*Pi  Obviously  Student[Calculus1]:-VolumeOfRevolution  command  ignores  numpoints  option. In the direct plotting by plot3d and slightly increased numpoints the hole disappears:

restart;

plot3d([x, sqrt(-x^2+2*x)*cos(phi), sqrt(-x^2+2*x)*sin(phi)], x = 0 .. 2, phi = 0 .. 2*Pi, color = pink, axes = normal, labels = [x, y, z], numpoints = 1000);

                            

 

 

 

  

@Markiyan Hirnyk  As can be seen from the plot above for each value of  X = 0..1  we have not one but two values of  Y .

@Carl Love  Of course, you're right! For a complete elimination of the parameter it is necessary to solve the cubic equation.

@Markiyan Hirnyk  I do not know how many more you need examples to believe the complete inefficiency of DirectSearch  package for solving problems of discrete optimization. Here are two very obvious example. It is taken from your question about the maximum of determinant with numbers 1..16. Consider two simpler examples of the determinant of the second order (numbers 1..4) and third order (the numbers 1..9). 

The first example is trivial and can be solved in the mind for a few seconds. Here's the work  DirectSearch  package:

restart;

ts:=time():

F:=LinearAlgebra[Determinant](Matrix([[x[1],x[2]],[x[3],x[4]]]));

DirectSearch[GlobalOptima](F, {[x[1],x[2],x[3],x[4]]=Matrix(map(convert,combinat[permute]([$1..4]),Vector))}, maximize);

time()-ts;

                                       

 

 

The solution of the same problem for the determinant of the third order:

restart;

ts:=time():

F:=LinearAlgebra[Determinant](Matrix([[x[1],x[2],x[3]],[x[4],x[5],x[6]],[x[7],x[8],x[9]]]));

DirectSearch[GlobalOptima](F, {[seq(x[i],i=1..9)]=Matrix(map(convert,combinat[permute]([$1..9]),Vector))}, maximize);

time()-ts;

 

As you can see, I did not wait for any result and interrupted calculation.

 

The latest example is solved in 20 seconds by simple enumeration:

restart;

ts:=time():

P:=combinat[permute]([$1..9]):

M:=-infinity:

f:=unapply(LinearAlgebra[Determinant](Matrix(3, [seq(x||i, i=1..9)])), seq(x||i, i=1..9)):

for p in P do

d:=f(op(p));

if d>M then M:=d; L:=[d,p] fi;

od:

L[1],Matrix(3,L[2]);

time()-ts;

                            

 

 

@Markiyan Hirnyk  You call  566073  as a worthy output  in comparison with the exact result  5927 ?

@Markiyan Hirnyk   

Digits := 200:

 fsolve(100^x - x^100=0, x = 2 .. infinity);

         100.000000000000 ... 

 

 

First 91 92 93 94 95 96 97 Last Page 93 of 132