Kitonum

21525 Reputation

26 Badges

17 years, 74 days

MaplePrimes Activity


These are answers submitted by Kitonum

If you solve this problem in Maple, then here is its full automation:

restart;
with(NumberTheory):
L:=[9,7,10,5,11]:
t1:=10*60+10: t2:=10*60+55: t3:=11*60+58:
n1:=t2-t1; n2:=t3-t2;
S1:=Divisors(n1); S2:=Divisors(n2);
S:=`intersect`(S1,S2);
select(`in`, L, S)[];

 

Note that  gamma  is a protected constant in Maple, not a symbol. Also, the functions  x(tau), t(tau), u(x,t) are not defined correctly.

restart

with(PDEtools)

with(LinearAlgebra)

with(Physics)

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

(1)

evalf(gamma);

.5772156649

(2)

_local(gamma); x(tau) := delta*(tau+1); t := tau; u(x, t) := U(xi)*exp(I*(-k*x+w*(t+1)))

Warning, A new binding for the name `gamma` has been created. The global instance of this name is still accessible using the :- prefix, :-`gamma`.  See ?protect for details.

 

pde := I*(diff(u(x, t), t))+alpha*(diff(u(x, t), `$`(x, 2)))+beta*(diff(u(x, t), x, t))+gamma*u(x, t)*V(xi) = 0

-U(xi)*w*exp(I*(-k*x+w*(tau+1)))-alpha*U(xi)*k^2*exp(I*(-k*x+w*(tau+1)))+beta*U(xi)*k*w*exp(I*(-k*x+w*(tau+1)))+gamma*U(xi)*exp(I*(-k*x+w*(tau+1)))*V(xi) = 0

(3)
 

``

Download non_sense_new.mw

A, B, C, D, E are the vertices and the center of a rectangle. 

restart;
local D:
A:=<a,3>: B:=<x1,2*x1+c>: C:=<5,b>: D:=<x2,2*x2+c>: E:=<x0,y0>:
sys:={E[1]=(A[1]+C[1])/2,E[2]=(A[2]+C[2])/2,E[1]=(B[1]+D[1])/2,E[2]=(B[2]+D[2])/2,(B-A).(D-A)=0,b=2*a+c} assuming real:
solve(sys);

{a = x1, b = -7+2*x1, c = -7, x0 = (1/2)*x1+5/2, x1 = x1, x2 = 5, y0 = -2+x1}, {a = x2, b = -7+2*x2, c = -7, x0 = 5/2+(1/2)*x2, x1 = 5, x2 = x2, y0 = -2+x2}


Edited.

restart;
g:=convert(9.8, rational):
solve({v1^2 = 2*g*(h-h1), (1/2)*g*t^2 = h2, v1*t+(1/2)*g*t^2 = h1}, {h, v1,t}, explicit):
simplify~([%])[];

You can significantly speed up your efforts to select the appropriate parameter values ​​by using the  Explore  command and then moving the corresponding sliders.

circles.mw
Procedure P solves the problem numerically. Formal arguments a, b are the lengths of the legs of a right triangle. The procedure returns a picture of the entire configuration for the user-specified values ​​of a and b. The global variable Sol stores the values ​​of all parameters of this configuration (points of contact, ellipse parameters, etc.):

restart;
P:=proc(a,b)
local R, h, F, s, c, V, F1, F2, G, c1, c2, Tr;
global Sol;
uses plots, plottools;

R:=proc(c,d)
local eq, eq1, eq2, dc;
eq:=(x-r)^2+y^2-r^2=0;
eq1:=c*cos(t); eq2:=d*sin(t);
dc:=implicitdiff(eq, y, x);
solve({eval(eq,[x=eq1,y=eq2]), diff(eq2,t)/diff(eq1,t)=eval(dc,[x=eq1,y=eq2])}, {r,t}, explicit);
eval(r,%[1]);
end proc:

h:=evalf(sqrt(a^2+b^2)):
F:=x^2/ a1^2+y^2/b1^2-1:  s:=b/sqrt(a^2+b^2): c:=a/sqrt(a^2+b^2):
V:=<c,s;-s,c>.<x-x0,y-y0>:
F1:=eval(F,[x=V[1],y=V[2]]):
F2:=solve(F1,y)[2]:
G:=(x+x4)^2+(y-x4)^2-x4^2:

Sol:=fsolve({eval(F1,[x=x1,y=0])=0,eval(implicitdiff(F1,y,x),[x=x1,y=0])=0,eval(F1,[x=x2,y=b/a*x2+b])=0,eval(implicitdiff(F1,y,x),[x=x2,y=b/a*x2+b])=b/a,eval(F1,[x=0,y=x3])=0,eval(implicitdiff(F1,x,y),[x=0,y=x3])=0,eval(G,[x=x5,y=eval(F2,x=x5)])=0,eval(diff(F2,x),x=x5)=eval(implicitdiff(G,y,x),[x=x5,y=eval(F2,x=x5)]),R(a1,b1)=x4},{a1=0..h/2,b1=0..b/2,x1=-a..-a/2,x2=-a..0,x3=b/2..b,x0=-a..0,y0=0..b,x4=0..b/2,x5=-a/2..0});

c1:=eval([x0,y0]+x4*[c,s],Sol):
c2:=eval([x0,y0]-x4*[c,s],Sol):

Tr:=curve([[0,0],[0,b],[-a,0],[0,0]], thickness=2);

display(Tr,implicitplot([eval(F1,Sol),eval(G,Sol),eval((x-c1[1])^2+(y-c1[2])^2=x4^2,Sol),eval((x-c2[1])^2+(y-c2[2])^2=x4^2,Sol)], x=-a..0, y=0..b, color=[blue,red,red,red],thickness=2, scaling=constrained, gridrefine=3), size=[800,500]);

end proc:


Examples of use:

P(2,1);
Sol;

                  


Using procedure P it is easy to trace how the configuration changes with the change in one of the parameters (b changes from 1 to 4):

plots:-animate(P,[a,1], a=1..4, frames=61, size=[800,500]);
               

In each of these two problems, the areas to be calculated are symmetrical about the horizontal axis. Therefore, it is sufficient to calculate only the halves of these areas, which are shaded in the pictures. The areas of these figures are easily found using the well-known formula for area in polar coordinates. It is more difficult to shade these areas. I have not found an easier way than replacing these areas with polygons with a sufficiently large number of sides. In the first problem, the area of ​​the entire figure is equal to twice the area of ​​the green figure. In the second problem, the area is equal to twice the sum of the areas of the pink and blue figures.

restart;
with(plots): with(plottools):
r1 := theta->-6*cos(theta):
r2 := theta->2-2*cos(theta):
r3 := theta->2+2*cos(theta):
t1:=solve(r3(theta)=3);
t2:=solve(r1(theta)=r2(theta));
P1:=plot([r1,r2], 0..2*Pi, color=[red,blue], thickness=2,coords=polar):
P2:=plot([3,r3], 0..2*Pi, color=[red,blue], thickness=2,coords=polar):
L:=line([0,0],[r1(t2)*cos(t2),r1(t2)*sin(t2)]):
Shade1:=polygon([seq([r3(s)*cos(s),r3(s)*sin(s)], s=0..evalf(t1),0.01),seq([3*cos(s),3*sin(s)], s=evalf(t1)..0,-0.01)], color="LightGreen"):
Shade2:=polygon([seq([r1(s)*cos(s),r1(s)*sin(s)], s=evalf(Pi/2)..evalf(t2),0.01),[0,0]], color=pink):
Shade3:=polygon([[0,0],[r2(t2)*cos(t2),r2(t2)*sin(t2)],seq([r2(s)*cos(s),r2(s)*sin(s)], s=evalf(2*Pi/3)..evalf(Pi),0.005)], color="LightBlue"):
display(P2,Shade1, scaling=constrained); # plot to the problem 1
display(P1,L,Shade2,Shade3, scaling=constrained); # plot to the problem 2
2*(1/2*int(r3(theta)^2-3^2, theta=0..t1)); # area of the region in the problem 1
evalf(%);
2*(1/2*int(r1(theta)^2, theta=Pi/2..t2)+1/2*int(r2(theta)^2, theta=t2..Pi)); # area of the region in the problem 2
evalf(%);

                             

                                                        

Download areas.mw

To calculate the hiker's coordinates, it is convenient to specify the points by the corresponding radius vectors. The problem is reduced to solving a system of two equations with 2 unknowns (the hiker is at point  ). The system may have several solutions, and to choose the right one, we check with the determinant that the shortest turns of the vectors  MS  and  MК  before aligning with the vectors MF and  MS  must occur counterclockwise. Procedure P returns the coordinates of the hiker (point M).

restart;
P:=proc(F::Vector,S::Vector,K::Vector,alpha,beta)
local M, Sol, a, b;
uses LinearAlgebra;
a:=evalf(alpha); b:=evalf(beta);
M:=<x,y>: 
Sol:=[solve({((F-M).(S-M))/sqrt((F-M).(F-M))/sqrt((S-M).(S-M))=cos(a),((K-M).(S-M))/sqrt((K-M).(K-M))/sqrt((S-M).(S-M))=cos(b)}, {x,y}, explicit)] assuming real;
select(t->Determinant(<eval(S-M,t) | eval(F-M,t)>)>0 and Determinant(<eval(K-M,t) | eval(S-M,t)>)>0, Sol)[];
end proc:


Example: calculation and visualization:

P(<1,2>,<3,4>,<7,1>,Pi/8, Pi/6);
M:=eval([x,y],%):
F:=[1,2]: S:=[3,4]: K:=[7,1]:
with(plots): with(plottools):
FS:=line(F,S,color=red): SK:=line(K,S,color=red):
MF:=line(M,F,linestyle=3,color=blue): MS:=line(M,S,linestyle=3,color=blue):
MK:=line(M,K,linestyle=3,color=blue):
T:=textplot([[F[],"F"],[S[],"S"],[K[],"K"],[M[],"M"]], font=[times,18], align={left,below}):
Points:=pointplot([F,S,K,M], color=[red$3,blue], symbol=solidcircle, symbolsize=15):
display(FS,SK,MF,MS,MK,T,Points, scaling=constrained);

                  

 

Let us denote by   the angle between the sides   and  . Using the law of cosines, we express the side  . By writing the doubled area of ​​the triangle in two ways, it is easy to find the height  h  dropped to  . Using the similarity of triangles, we find the side of the inscribed square  as a function of  .

restart;
a:=3: b:=4: 
c:=sqrt(a^2+b^2-2*a*b*cos(x)): 
h:=solve(h*c=a*b*sin(x), h);
d:=solve((h-d)/h=d/c, d); # The target function 
Optimization:-Maximize(d, {x>=0, x<=Pi}); # The answer

                      

Explanation: Triangle DBE is similar to triangle ABC with a similarity coefficient = BP/BQ

                           

 

The recursive procedure named  P  finds the list of values  x[n], y[n]  ​​for given  x0, y0, n .
As an example, the first 11 values ​​were found and the first 4 points were plotted:
 

restart;

P:=proc(x0,y0,n)
local Q;
option remember;
if n=0 then [x0,y0] else
Q:=P(x0,y0,n-1);
[Q[2]*Q[1]+2,(1/2)*Q[1]+Q[2]+1] fi;
end proc:

S:=seq(P(1,2,n), n=0..10):
A:=plots:-pointplot([S][1..4], color=red, symbol=solidcircle, symbolsize=15):
B:=plot([S][1..4], linestyle=3, color=blue):
plots:-display(A,B, view=[0..110,0..16]);

 

 


 

Download proc1.mw

Edited.


 

restart;
S := solve(x^2-2*x+1 > 0, x);
`union`(S);

S := solve(x^2-2*x+1 >= 0, x);
if S=x then convert(real, RealRange) fi;

S := solve(x^2-2*x+1 < 0, x);
if S=NULL then {} fi;

 

RealRange(-infinity, Open(1)), RealRange(Open(1), infinity)

 

`union`(RealRange(-infinity, Open(1)), RealRange(Open(1), infinity))

 

x

 

RealRange(-infinity, infinity)

 

 

{}

(1)

 


 

Download intervals.mw

restart;
l1:=<a,b,c>: l2:=<a,b,c>:
if LinearAlgebra:-Equal(l1, l2) then 
print("Equal Vectors");
end if:

# or
if andmap(t->t=0, l1-l2) then 
print("Equal Vectors");
end if:

To plot vectors, you can use the plots:-arrow command:


 

   
   

restart;
u:=[7,3]: v:=[2,-4]:
P1:=plots:-arrow([u,v], color=blue):
P2:=plots:-arrow(v,u-v, color=red):
plots:-display(P1,P2, scaling=constrained);

 

 


 

Download arrow.mw


 

restart

Sh := .5; R[d] := .7; alpha := (1/2)*Pi; Nc := .2; H := .4; `&epsilon;` := .4

"F(x):=(1+4*R[d])*diff(f(x),x$2)-Sh*sin(alpha)*f^(2)(x)-(Nc*(1-`&epsilon;`)+H)*f(x);"

proc (x) options operator, arrow, function_assign; (1+4*R[d])*(diff(f(x), `$`(x, 2)))-Sh*sin(alpha)*f(x)^2-(Nc*(1-epsilon)+H)*f(x) end proc

(1)

"f(x):=sum(a[i]*x^(i),i=0..3); "

proc (x) options operator, arrow, function_assign; sum(a[i]*x^i, i = 0 .. 3) end proc

(2)

"F(x):=(1+4*R[d])*diff(f(x),x$2)-Sh*sin(alpha)*f^(2)(x)-(Nc*(1-`&epsilon;`)+H)*f(x);"

proc (x) options operator, arrow, function_assign; (1+4*R[d])*(diff(f(x), `$`(x, 2)))-Sh*sin(alpha)*f(x)^2-(Nc*(1-epsilon)+H)*f(x) end proc

(3)

BCS := f(1) = 1, (D(f))(0) = 0

eq[1] := f(1) = 1; eq[2] := (D(f))(0) = 0; eq[3] := eval(F(x), x = 1) = 1; eq[4] := eval(diff(F(x), x), x = 0) = 0

a[0]+a[1]+a[2]+a[3] = 1

 

a[1] = 0

 

22.28*a[3]+7.08*a[2]-.5*(a[0]+a[1]+a[2]+a[3])^2-.52*a[1]-.52*a[0] = 1

 

22.8*a[3]-1.0*a[0]*a[1]-.52*a[1] = 0

(4)

p := fsolve({eq[1], eq[2], eq[3], eq[4]}, {a[0], a[1], a[2], a[3]})

{a[0] = .7342105263, a[1] = 0., a[2] = .2657894737, a[3] = 0.}

(5)

f := unapply(eval(f(x), p), x)

proc (x) options operator, arrow; .7342105263+.2657894737*x^2 end proc

(6)

"g(x):=0.7605263158+0.2394736842*x^2;"

proc (x) options operator, arrow, function_assign; .7605263158+.2394736842*x^2 end proc

(7)

plot([f(x), g(x)], x = 0 .. 1)

 

NULL

NULL


 

Download MSNL_new.mw

You must specify the coordinates of the center  c  and write down the parametric equations of the circle not in vector form, but coordinate-wise:

restart;
c:=[1,2]:
plots:-animate(plot, [[c[1]+r*cos(t),c[2]+r*sin(t),t=0..6.3], scaling=constrained],r=5..10);
5 6 7 8 9 10 11 Last Page 7 of 290