Kitonum

21845 Reputation

26 Badges

17 years, 235 days

MaplePrimes Activity


These are replies submitted by Kitonum

@Carl Love  OP asked "Suppose I am interested in n-large and, instead of locating one focal point, A, I wish to obtain several,i.e. A, B, C, etc. such that the distances from each of these to their respective neighboring points is also a minimum". I replied referring to the wiki that if the initial n points do not lie on one straight line, then this is impossible.

@minhthien2016   I can of course, but I don't have time now for this.

See Google search on  The condition for the existence of a tetrahedron with given lengths of all edges

Your tetrahedron defined by the lengths of the edges actually exists.

Thank you all! I did not expect the solution to be so simple.

@Teep 

restart;
X := [3, 6, 4, 13]:   Y := [8, 6, 5, 7]:  n:=nops(X):
local D;  
L:=[seq(seq([[[X[i],Y[i]],[X[j],Y[j]]],(i,j)=sqrt((X[i]-X[j])^2+(Y[i]-Y[j])^2)], j=i+1..n), i=1..n-1)];
T:=Matrix(4, {map(t->t[2],L)[],map(t->(lhs(t[2])[2],lhs(t[2])[1])=rhs(t[2]),L)[]}):
MatrixOfDistances:=<<``|A|B|C|D>,<<A,B,C,D>|T>>;

 

@Carl Love  Thank you for your interest. Unfortunately, getting a noticeable gain in time at the cost of obtaining only one solution is impossible. In the branch and bound method  each variant may branch out into several variants, or it may disappear altogether, if it cannot be continued. And this we will not know until we reach the last step. How the method works is clearly seen in the example below (the second example from the worksheet). I brought all the steps to the display:

    

 

@DimaBrt  I did not understand your comment. For me, everything works in Maple 2018.2.

@kambiz1199  You can use the  trace  option to show the intermediate positions of a ladder. See my updated answer above.

@Rouben Rostamian   I also do not know a short way. Here is a rather cumbersome way:

test := -2+exp(theta)+exp(-theta);
convert(test,trigh);
convert(%, tanh);
convert(%,exp);
factor(%);
numer(%)/simplify(denom(%));

 

@minhthien2016  Of course, this line is only needed to make these assignments  a:=...  and  b:=...  clear.

@acer  and  Carl. Thanks for replies! The trouble removed. 

I tried to test this procedure. I just copied the text of the procedure into a new worksheet. But during initialization, the error occurs:  Error, unexpected neutral operator

Can anyone confirm this situation? What could be the reason? I'm using Maple 2018.2

Error.mw

@hamideh 

restart;
plots:-implicitplot3d((x,y,z)->`if`(x<y and y<z,x^3*y*z-0.5,NULL), 0..5, 0..5, 0..5, style=surface, color=green, numpoints=500000, axes=normal, orientation=[55,75]);

                    

@Al86  The idea of how to find these values is suggested by the graph of the implicit function 

(x-2)^2*(x-3)+epsilon^2=0

(see the code above). The straight line  epsilon=C  (is a constant)  should cross this graph at exactly 2 points. One value is obvious  epsilon=0, and 2 others are easily found using the derivative:

epsilon1:=x->sqrt(-(x-2)^2*(x-3));
epsilon2:=x->-sqrt(-(x-2)^2*(x-3));
x1:=solve(D(epsilon1)(x)=0);
x2:=solve(D(epsilon2)(x)=0);
epsilon1(x1);
epsilon2(x2);

 

@David Sycamore

 

restart;
AlmostCarmichaelNumbers1:=proc(n::posint)
local L;
L:=ifactors(n);
if nops(L[2])>2 and L[2,1,1]<>2 and `and`(map(t->is(t[2]=1),L[2])[]) and irem(n-1,L[2,1,1]-1)=0 and irem(n-1,L[2,-1,1]-1)=0 and `and`(seq(irem(n-1,t[1]-1)<>0,t=L[2][2..-2])) then true else false fi;
end proc:


Example of use:

 select(AlmostCarmichaelNumbers1, [seq(i, i=1..20000, 2)]);
 
 [231, 1045, 1653, 4371, 4641, 5365, 6545, 8029, 9361, 10011, 10857, 13685, 13695, 15753, 16269, 18361, 18565]

Edit.

I first learned about this command from this post. It is not clear to me why it is necessary for all occasions to look for the appropriate command in Maple, if we can just write the simplest procedure. Example:

restart;
Dist:=(X,Y)->sqrt(add((X-~Y)^~2)):
X:=<1,2,3>: Y:=<2,3,4>:
Dist(X,Y);

 

First 33 34 35 36 37 38 39 Last Page 35 of 134