Kitonum

21500 Reputation

26 Badges

17 years, 60 days

MaplePrimes Activity


These are answers submitted by Kitonum

Christmas1.mw
Let's introduce the coordinates. We'll take the length of each side as 1. We'll take E as the origin of the coordinates, we'll direct the x-axis along ED, and the y-axis vertically upwards. To calculate the lengths and angles, we'll use vector operations:

restart;
local D:
Digits:=20:
d:=v->sqrt(v.v):
E:=<0,0>: D:=<1,0>: C:=<1,1>: B:=<x,y>: A:=<cos(2*Pi/3),sin(2*Pi/3)>:
BA:=A-B: BC:=C-B:
sol:=simplify([solve({d(BA)=1,d(BC)=1}, explicit)])  assuming real;
evalf(%); # Coordinates of point B (only the first solution is suitable)
assign(sol[1]):
AE:=E-A: AB:=-BA: CB:=-BC: CD:=D-C:
a:=evalf(arccos(AE.AB)*180/Pi); b:=evalf((2*Pi-arccos(BA.BC))*180/Pi); c:=evalf(arccos(CB.CD)*180/Pi); # Angles in degrees
90+120+a+b+c;  # Check. The sum of the interior angles in any pentagon is 540 degrees.

           

Visualization:

with(plots): with(plottools):
L:=evalf(eval(convert~([E,A,B,C,D,E],list))):
P1:=curve(L, color=blue, thickness=3):
P2:=polygon(L, color="LightBlue"):
E,A,B,C,D:=L[1..5][]:
T:=textplot([[E[],"E",align=[left,below]],[A[],"A",align=[left,above]],[B[],"B",align=[right,below]],[C[],"C",align=right],[D[],"D",align=[right,below]]],font=[times,16]):
display(P1,P2,T, scaling=constrained, axes=none);

       

 

From your drawing we see that the vector F_RC1_ST is the opposite of the projection of F_RC1 on the z axis, and the vector F_RC1Y is equal to - F_RC1_ST - F_RC1 . In the figure below, all the vectors found come out from the origin. Figure out for yourself from the help how to draw them so that they form a triangle (to do this, you just need to change the bases of the two vectors from three ones).

restart; with(VectorCalculus)

V_C1 := `<,>`(-8, -8, -2); V_C1_ST := `<,>`(-8, 0, -2); EV_C1 := evalf(Normalize(V_C1)); EV_C1 := evalf(Normalize(V_C1))

EV_C1Y:=
`<,>`(0, 1, 0); EV_C1_ST := evalf(Normalize(V_C1_ST))

 

F_C1 := 30
F_RC1 := EV_C1*F_C1; F_RC1_ST := -(F_RC1.`<,>`(0, 0, 1))*`<,>`(0, 0, 1); F_RC1Y := -F_RC1_ST-F_RC1

Vector(3, {(1) = -20.889318714, (2) = -20.889318714, (3) = -5.22232968})

 

Vector(3, {(1) = 0., (2) = 0., (3) = 5.22232968})

 

Vector(3, {(1) = 20.889318714, (2) = 20.889318714, (3) = 0.})

(1)

visu4 := PlotVector([F_RC1, F_RC1_ST, F_RC1Y], color = cyan, width = .3, head_length = [.1, relative = true], axes = normal, labels = [x, y, z], scaling = constrained)

   

 

 

 

Download vector_question_new1.mw

Of course, the method @Carl Love showed is the most optimal, but it is always useful to find alternative ways. Imagine that after some time you need to solve a similar problem again, but you have completely forgotten these commands. In fact, the problem is easily solved iteratively by the simplest for-cycle for a list of any length:

restart;
lst1 := [a^3/10, -a^2/2, a, a^4/4]:
n:=nops(lst1): d[1]:=gcd(lst1[1..2][]):
for i from 3 to n do
d[i-1]:=gcd(d[i-2],lst1[i]);
od:
d[n-1];

 

If you need to do this multiple times, the best way to write a procedure for this:

restart;
P:=x->parse(convert(x,string)[1]):
P(asdf);

The imaginary unit in Maple is encoded as  I  rather than i . Maple performs the simplest arithmetic operations on complex numbers automatically, i.e. there is no need for any commands:

(3-4*I)*(2+I);

                                   

I don't know any other way to solve the problem than to do it using the tools of the plots and plottools packages:

restart; 
with(plots): with(plottools): 
P := plot(sin(x), x = -3 .. 3, colour = [blue], style = pointline, symbol = solidcircle, numpoints = 20): 
p1 := line([1.5, -1], [1.9, -1], colour = [blue]): 
p2 := pointplot([1.7, -1], symbol = solidcircle, color = blue, symbolsize = 10): 
p3 := curve([[1.4, -.9], [2.65, -.9], [2.65, -1.1], [1.4, -1.1], [1.4, -.9]]): 
p4 := textplot([2.3, -1, sin(x)]): 
plots:-display(P, p1, p2, p3, p4);


 

 

Download Plot1_new.mw

The problem can be easily reduced to solving a system of 2 equations with 2 unknowns. But for some reason, there is no correct answer among the suggested ones (possibly a typo):

restart;
d:=(X,Y)->sqrt((X[1]-Y[1])^2+(X[2]-Y[2])^2):
A:=[7,6]: B:=[3,4]: P:=[x,0]: Q:=[0,y]:
solve({d(P,A)=d(P,B),d(Q,A)=d(Q,B)});
assign(%);
d(P,Q); # The answer

                                                

 

@vv You only check six-digit numbers with distinct digits. But how do we know that numbers with fewer digits and/or repeating digits cannot have this property?

The following code checks for any numbers that have no more than six digits:

restart;
L:=[$2..6]:
for k from 2 to 6 do
for n from 10^(k-1) to floor((10^k-1)/6) do
L1:=convert(n,base,10);
S:=combinat:-permute(L1);
P:=n*L;
L2:=convert~(P,base,10);
if andmap(t->t in S, L2) then print(n) fi;
od: od:

                                                    142857

If I understood your task correctly, here is my attempt:

restart;
P:=proc(x1,p2,t)
local v, d12, v12, r, x1_t, C, c, d1, s, T;
uses plots,plottools;
v:=convert(p2-x1,Vector);
d12:=sqrt(v.v);
v12:=v/d12;
x1_t:=convert(x1,Vector)+t*v12;
r:=d12-t;
d1:=pointplot(convert(x1_t,list),color=red,symbol=solidcircle,symbolsize=12);
C:=circle(x1,d12, linestyle=3, color=blue);
c:=circle(convert(x1_t,list),r,color=blue);
s:=line(x1,p2, thickness=2);
T:=textplot([[x1[],"x1",align=[left,above]], [p2[],"p2", align=[right,above]]], font=[times,15]):
display(d1,c,s,T,C, scaling=constrained);
end proc:

plots:-animate(P,[[1,1],[2,3],t], t=0..1, frames=60);

                     

 

The problem is solved by direct calculation using the shoelace formula. See  https://en.wikipedia.org/wiki/Shoelace_formula

restart;
local D:
A:=[0,0]: B:=[b,c]: C:=[a+b,c]: D:=[a,0]:
f:=(A,B)->sort(expand((y-A[2])*(B[1]-A[1])-(x-A[1])*(B[2]-A[2]))):
g:=(a,b)->eval([x,y],solve({a, b},{x,y})):
mAB:=(A+B)/2: mBC:=(B+C)/2: mCD:=(C+D)/2: mDA:=(D+A)/2:
A1,A2,B1,B2,C1,C2,D1,D2:=map(t->f(t[]),[[A,mCD],[A,mBC],[B,mDA],[B,mCD],[C,mAB],[C,mDA],[D,mBC],[D,mAB]])[]:
L:=[[A2,B1],[A2,C1],[B2,C1],[B2,D1],[C2,D1],[C2,A1],[D2,A1],[D2,B1]]:
assign(seq(p[i]=g(L[i][]), i=1..8));
p[9]:=p[1]:
S:=expand(1/2*add(p[i][1]*p[i+1][2]-p[i][2]*p[i+1][1], i=1..8)):
is(abs(S)=abs(a*c/6));

 #  true

Explanations of the code:
A, B, C, D are the vertices of an arbitrary parallelogram (a<>0, c<>0); mAB, mBC, mCD, mDA are the midpoints of the corresponding sides, f is the procedure for finding a straight line through 2 points, g is the procedure for finding the intersection point of two straight lines, p[i] (i=1..8) are the vertices of the octagon, S is the area of ​​the octagon. The calculations use only formulas from the Maple core, so they are suitable for any version of Maple (even very old ones).

Visualization - the names of the objects match their names in the code above:

                           

Edited.                       

Octagon.mw

Since all the numbers in the problem are multiples of 5, the idea immediately came to me to work with a regular pentagon (roses - red solid circles and rows - blue segments):

restart;
with(plots): with(plottools):
Line:=(A,B)->sort(expand((y-A[2])*(B[1]-A[1])-(x-A[1])*(B[2]-A[2]))):
assign(seq(A[i]=[cos(Pi/2+2*Pi*(i-1)/5),sin(Pi/2+2*Pi*(i-1)/5)],i=1..5));
B[1]:=eval([x,y],solve({Line(A[3],A[5]),x=0})):
assign(seq(B[i]=[abs(B[1][2])*cos(-Pi/2+2*Pi*(i-1)/5),abs(B[1][2])*sin(-Pi/2+2*Pi*(i-1)/5)],i=2..5)):
E:=(B[3]+B[4])/2:
C:=eval([x,y],solve({Line(B[3],B[5]),Line(B[2],B[4])})):
M:=eval([x,y],solve({Line(B[1],B[4]),Line(B[2],B[5])})):
N:=eval([x,y],solve({Line(B[1],B[3]),Line(B[2],B[5])})):
K:=(M+N)/2:
P1:=pointplot([A[1],E,C,K,B[1]], color=red, symbol=solidcircle, symbolsize=15):
P2:=display(line(A[1],A[3]),line(A[1],B[1]),line(A[1],A[4]),line(B[2],B[5]), color=blue):
display(seq(rotate(P1,2*Pi*k/5),k=1..5),seq(rotate(P2,2*Pi*k/5),k=1..5), axes=none, size=[650,650], scaling=constrained);

                        

Edited.

restart;
M:=<sqrt(5),0>: C:=<2*sqrt(5),0>: MB:=y=2*(x-sqrt(5)):
Circle:=x^2+y^2=(2*sqrt(5))^2:
solve({MB,Circle}):
E:=eval(<x,y>,%[2]):
EM:=M-E: EC:=C-E:
Angle_CEM=arccos(EM.EC/sqrt(EM.EM)/sqrt(EC.EC));

                                           

 

In cases where the  solve command fails, it is useful to first plot the graphs to visually verify the roots. Then we find the roots numerically using the  fsolve  command. Finally, we try to find the roots symbolically using the  identify  command:

 

restart;
Eq:=9*(x^2+2*cos(x))=Pi^2+9;
plot([lhs(Eq),rhs(Eq)], x=0..3, 0..40, color=[red,blue]);
fsolve(Eq, x=0..infinity);
identify(%);

9*x^2+18*cos(x) = Pi^2+9

 

 

1.047197551

 

(1/3)*Pi

(1)

 


 

Download roots.mw

a:=Matrix(2,2,{(1, 1) = <1.0,2.0>, (1, 2) = 3.0, (2, 1) = 4.0, (2, 2) =<5.0,6.0>});
a[1,1][1];
a[2,2][2];

 

We will assume that the parameters are not equal to  0  simultaneously, otherwise we have a trivial case  x=0 . Factoring, we see that for any values ​​of the parameters, the equation has the root  n=1 . The second factor is a third-degree polynomial with respect to n  with the leading coefficient different from 0, so there will be another real root:

restart;

x:=(4*sigma__d^4 + 4*sigma__d^2*sigma__dc^2 + sigma__dc^4)*n^4 + (-4*sigma__d^4 - 2*sigma__d^2*sigma__dc^2)*n^3 + (sigma__d^4 - 4*sigma__d^2*sigma__dc^2 - sigma__dc^4)*n^2 + (-4*sigma__d^4 + 2*sigma__d^2*sigma__dc^2)*n + 3*sigma__d^4;
factor(x);

(4*sigma__d^4+4*sigma__d^2*sigma__dc^2+sigma__dc^4)*n^4+(-4*sigma__d^4-2*sigma__d^2*sigma__dc^2)*n^3+(sigma__d^4-4*sigma__d^2*sigma__dc^2-sigma__dc^4)*n^2+(-4*sigma__d^4+2*sigma__d^2*sigma__dc^2)*n+3*sigma__d^4

 

(n-1)*(4*n^3*sigma__d^4+4*n^3*sigma__d^2*sigma__dc^2+n^3*sigma__dc^4+2*n^2*sigma__d^2*sigma__dc^2+n^2*sigma__dc^4+n*sigma__d^4-2*n*sigma__d^2*sigma__dc^2-3*sigma__d^4)

(1)

P:=op(2,%);

4*n^3*sigma__d^4+4*n^3*sigma__d^2*sigma__dc^2+n^3*sigma__dc^4+2*n^2*sigma__d^2*sigma__dc^2+n^2*sigma__dc^4+n*sigma__d^4-2*n*sigma__d^2*sigma__dc^2-3*sigma__d^4

(2)

collect(P, n);
map(factor,%);

(4*sigma__d^4+4*sigma__d^2*sigma__dc^2+sigma__dc^4)*n^3+(2*sigma__d^2*sigma__dc^2+sigma__dc^4)*n^2+(sigma__d^4-2*sigma__d^2*sigma__dc^2)*n-3*sigma__d^4

 

(2*sigma__d^2+sigma__dc^2)^2*n^3+sigma__dc^2*(2*sigma__d^2+sigma__dc^2)*n^2+sigma__d^2*(sigma__d^2-2*sigma__dc^2)*n-3*sigma__d^4

(3)
 

 

Thus, for any values ​​of the parameters, the equation will have at least   real roots.

Download quartic_equation_in_n_new.mw

3 4 5 6 7 8 9 Last Page 5 of 290