Kitonum

21530 Reputation

26 Badges

17 years, 82 days

MaplePrimes Activity


These are answers submitted by Kitonum

Let  be the number of points on one dice, and   b  be the number of points on another one.
 

restart;
LE:=proc(a::integer,b::integer)
(type(a,even) and type(b,odd)) or (type(a,odd) and type(b,even)) implies a+b<=9;
end proc:

# Examples of use:
LE(2,3);
LE(5,6);

true

 

false

(1)

 


 

Download LE.mw

 

You can use an inert form for subtraction to keep the expression unchanged. For any calculations and transformations use the  value  command:

restart;
expr:=arccos(p%-a);
value(expr);
value(eval(expr,[p=0,a=1]));

                     

 

_B1  is a binary variable that is 0 or 1 :

restart;
ode:=diff(y(x),x)-y(x)/x+csc(y(x)/x)=0;
sol:=dsolve([ode,y(1)=0]);
about(_B1);
sol1:=eval(sol,_B1=0);
sol2:=eval(sol,_B1=1);
odetest(sol1,ode);
odetest(sol2,ode);

                   

Here is a solution in Maple:
 

restart;
Student:-Calculus1:-Roots(1/x^3-sin(12*x)=0, x=1.2..2);
map(x->[x,1/x^3], %); # Solutions of the system

Warning, some roots are returned as numeric approximations

 

[1.266058343, 1.591679997, 1.818677859]

 

[[1.266058343, .4927638521], [1.591679997, .2479891755], [1.818677859, .1662389018]]

(1)

 


 

Download nlsystem.mw

restart;
plots:-animate(plot,[cos(2*theta),theta=0..a, coords=polar], a=0..2*Pi);

 

We can significantly increase efficiency if we use symmetries: from one solution we can get  6 * 6 = 36 solutions by permutations of the first three and last three numbers. Instead of loops, it’s slightly more efficient and more compact to use nested seq . So we get the unique solution:


 

restart;
CodeTools:-Usage(seq(seq(seq(seq(seq(seq(`if`(a+b+c=a1+b1+c1 and a^2+b^2+c^2=a1^2+b1^2+c1^2 and a*b*c=2*a1*b1*c1,[a,b,c,a1,b1,c1],NULL),c1=b1..20),b1=a1..20),a1=1..20),c=b..20),b=a..20),a=1..20));

memory used=168.13MiB, alloc change=0 bytes, cpu time=3.25s, real time=3.26s, gc time=140.62ms

 

[3, 5, 16, 1, 8, 15]

(1)

 


 

Download isys.mw

Your surface is a torus:

restart;
plot3d(eval([x,sqrt(x^2+y^2)*cos(s),sqrt(x^2+y^2)*sin(s)],[x=cos(t),y=2+sin(t)]), t=0..2*Pi, s=0..2*Pi, scaling=constrained, labels=[x,y,z]);

                       

 


 

restart;
r1:=2:  r2:=2*(1-cos(theta)):
A:=plot([r1,r2], theta=0..2*Pi, color=[red,blue], thickness=3, coords=polar):
B:=plot(r1, theta=Pi/2..3*Pi/2, color=green, coords=polar, filled):
C:=plot(r2, theta=-Pi/2..Pi/2, color=green, coords=polar, filled):
plots:-display(A,B,C, scaling=constrained);

 

 


 

Download shade.mw


Here is another shorter way:
 

restart;
r1:=2:  r2:=2*(1-cos(theta)):
plot([r1,r2], theta=0..2*Pi, color=[red,blue], thickness=3, coords=polar, filled, scaling=constrained);

 

 


 

Download shade1.mw


Here is a more automatic plotting for the intersection:

restart;
r1:=2:  r2:=2*(1-cos(theta)):
plot(min(r1,r2), theta=0..2*Pi, color=green, coords=polar, filled, scaling=constrained);

Edit.

The following approach is sometimes useful:

restart;
eq := x^2+floor(x)-10:
Student:-Calculus1:-Roots(eq);
identify(%);

    

 

The animation you see here is saved in GIF format. Each polygon from the list remains on the display for exactly 1 second (10 frames per second by default):

restart;
OneFrame:=proc(n)
local Circle, Polygon, Text, S;
uses plottools, plots;
Circle:=plot([cos(t),sin(t),t=0..2*Pi], color=grey, thickness=2);
Polygon:=polygon([seq([cos(2*Pi*k/n),sin(2*Pi*k/n)], k=1..n)], color=yellow);
S:=evalf(n*sin(2*Pi/n)/2);
Text:=textplot([[-0.7,-1.1,"Area of Circle = 3.14"],[0,-1.1,typeset("n","=",n)],[0.7,-1.1,typeset("Area of Polygon","=",evalf[3](S))]], font=[times,16]);

display(Text,Circle,Polygon, scaling=constrained, axes=none, title="Archimedes Approximation for Pi \n", titlefont=[times,bold,18]);
end proc:

plots:-display(seq(OneFrame(n)$10, n=[3,6,9,12,15,18,21,24,27,30,60]), insequence, size=[600,600]); 

                       

 


 

restart;
sys_ode := diff(F0(zeta), zeta, zeta)-b^2*F0(zeta)+G0(zeta)^2 = 0, diff(G0(zeta), zeta, zeta)-b^2*G0(zeta) = 0, 2*F0(zeta)+diff(H0(zeta), zeta) = 0;
ics := F0(0) = 0, G0(0) = 1, H0(0) = 0, F0(infinity) = 0, G0(infinity) = 0;

sol:=dsolve([sys_ode,ics]);
sol1:=eval(sol,b=1):
plot([eval(F0(zeta),sol1),eval(G0(zeta),sol1),eval(H0(zeta),sol1)], zeta=0..10, color=[red,blue,green]);

diff(diff(F0(zeta), zeta), zeta)-b^2*F0(zeta)+G0(zeta)^2 = 0, diff(diff(G0(zeta), zeta), zeta)-b^2*G0(zeta) = 0, 2*F0(zeta)+diff(H0(zeta), zeta) = 0

 

F0(0) = 0, G0(0) = 1, H0(0) = 0, F0(infinity) = 0, G0(infinity) = 0

 

{F0(zeta) = limit((1/2)*(-(1/3)*exp(b*zeta)*((exp(b*_a))^3*(exp(-b*_a))^3-9*(exp(b*_a))^2*(exp(-b*_a))^2+2*exp(-b*_a)*(exp(b*_a))^2+12*(exp(-b*_a))^2*exp(b*_a)+2*(exp(-b*_a))^3-9*exp(-b*_a)*exp(b*_a)+1)/(b*((exp(b*_a))^3-3*exp(-b*_a)*(exp(b*_a))^2+3*(exp(-b*_a))^2*exp(b*_a)-(exp(-b*_a))^3))+(1/3)*exp(-b*zeta)*((exp(b*_a))^3*(exp(-b*_a))^3-9*(exp(b*_a))^2*(exp(-b*_a))^2+2*(exp(b*_a))^3+12*exp(-b*_a)*(exp(b*_a))^2+2*(exp(-b*_a))^2*exp(b*_a)-9*exp(-b*_a)*exp(b*_a)+1)/(((exp(b*_a))^2-2*exp(-b*_a)*exp(b*_a)+(exp(-b*_a))^2)*b*(exp(b*_a)-exp(-b*_a)))-(-(1/3)*(exp(b*_a))^2/((exp(b*_a)-exp(-b*_a))^2*b*(exp(b*zeta))^3)+(exp(-b*_a))^2*exp(b*zeta)/((exp(b*_a)-exp(-b*_a))^2*b)+2*exp(-b*_a)*exp(b*_a)/((exp(b*_a)-exp(-b*_a))^2*b*exp(b*zeta)))*exp(b*zeta)+((1/3)*(exp(-b*_a))^2*(exp(b*zeta))^3/((exp(b*_a)-exp(-b*_a))^2*b)-(exp(b*_a))^2/((exp(b*_a)-exp(-b*_a))^2*b*exp(b*zeta))-2*exp(-b*_a)*exp(b*_a)*exp(b*zeta)/((exp(b*_a)-exp(-b*_a))^2*b))*exp(-b*zeta))/b, _a = infinity), G0(zeta) = limit(-exp(-b*_a)*exp(b*zeta)/(exp(b*_a)-exp(-b*_a))+exp(b*_a)*exp(-b*zeta)/(exp(b*_a)-exp(-b*_a)), _a = infinity), H0(zeta) = limit(-(1/3)*(-12*exp(-b*_a)*exp(b*_a)*zeta/(exp(b*_a)-exp(-b*_a))^2+(exp(b*_a))^2/((exp(b*_a)-exp(-b*_a))^2*(exp(b*zeta))^2*b)-(exp(-b*_a))^2*(exp(b*zeta))^2/((exp(b*_a)-exp(-b*_a))^2*b)-((exp(b*_a))^3*(exp(-b*_a))^3-9*(exp(b*_a))^2*(exp(-b*_a))^2+2*(exp(b*_a))^3+12*exp(-b*_a)*(exp(b*_a))^2+2*(exp(-b*_a))^2*exp(b*_a)-9*exp(-b*_a)*exp(b*_a)+1)/(((exp(b*_a))^2-2*exp(-b*_a)*exp(b*_a)+(exp(-b*_a))^2)*b*(exp(b*_a)-exp(-b*_a))*exp(b*zeta))-exp(b*zeta)*((exp(b*_a))^3*(exp(-b*_a))^3-9*(exp(b*_a))^2*(exp(-b*_a))^2+2*exp(-b*_a)*(exp(b*_a))^2+12*(exp(-b*_a))^2*exp(b*_a)+2*(exp(-b*_a))^3-9*exp(-b*_a)*exp(b*_a)+1)/(b*((exp(b*_a))^3-3*exp(-b*_a)*(exp(b*_a))^2+3*(exp(-b*_a))^2*exp(b*_a)-(exp(-b*_a))^3)))/b^2-(1/3)*(2*(exp(b*_a))^3*(exp(-b*_a))^3-18*(exp(b*_a))^2*(exp(-b*_a))^2+(exp(b*_a))^3+15*exp(-b*_a)*(exp(b*_a))^2+15*(exp(-b*_a))^2*exp(b*_a)+(exp(-b*_a))^3-18*exp(-b*_a)*exp(b*_a)+2)/(b^3*((exp(b*_a))^3-3*exp(-b*_a)*(exp(b*_a))^2+3*(exp(-b*_a))^2*exp(b*_a)-(exp(-b*_a))^3)), _a = infinity)}

 

 

 


 

Download diffeq.mw

Maple has the command  Student:-LinearAlgebra:-LinearSolveTutor  that solves systems of linear equations step by step, but unfortunately only if the matrix of the system is no more than 5 by 5. Below is a step-by-step solution using the Jordan Gauss method using my program  JordanGausse (all comments are in Russian):

system.mw

reduce the range along the vertical axis (y-range) while maintaining  x-range. Also use a list rather than a set when specifying functions so that all options match the corresponding function:

restart;
plot([0, 2*x^2, 2*x^2 - 2*x^3 + 8/3*x^4 - 4*x^5], x = -10 .. 10, y=-1000..1000, color = ["DarkGreen", "CornflowerBlue", "Burgundy"], axes=box);

                       

 

Here is another way by the using the  applyrule  command:

restart;
expr:=1/exp(z)*arcsinh(x*exp(C[1]))+x*sin(exp(x))+3*exp(C[1]*y)*sqrt(sin(exp(3*h)));
applyrule(exp(t::anything)=Z, expr);

 

I think that there are infinitely many ellipses inscribed in a given triangle. But among them there will be only one that touches the sides of the triangle in their midpoints. It is called the Steiner ellipse. See  https://en.wikipedia.org/wiki/Steiner_inellipse

Here is an example of plotting this ellipse:
 

restart;
A:=<0,0>: B:=<5,6>: C:=<4,0>:
S:=1/3*(A+B+C);
AS:=S-A: SC:=C-S: AB:=B-A:
XY:=AS+1/2*SC*cos(t)+1/2/sqrt(3)*AB*sin(t);
ABC:=plottools:-curve(convert~([A,B,C,A],list), color=blue):
P:=plots:-pointplot(convert([(A+B)/2,(B+C)/2,(A+C)/2],list), symbol=solidcircle, color=red, symbolsize=12):
plots:-display(plot([XY[1],XY[2],t=0..2*Pi], color=red), ABC, P, scaling=constrained);

Vector(2, {(1) = 3, (2) = 2})

 

Vector[column](%id = 18446746141167283846)

 

 

 


As for orthoptic circle for an ellipse see  https://en.wikipedia.org/wiki/Orthoptic_(geometry)#:~:text=Generalizations%3A,fixed%20angle%20(see%20below).&text=Thales'%20theorem%20on%20a%20chord,two%20points%20P%20and%20Q.

 

Download Steiner_ellipse.mw

First 55 56 57 58 59 60 61 Last Page 57 of 290