Kitonum

20474 Reputation

26 Badges

16 years, 70 days

MaplePrimes Activity


These are answers submitted by Kitonum

To solve this, we use vectors and a well-known formula that expresses the area of ​​a triangle through the coordinates of the vectors of its constituent sides:

restart;
local D:
A:=<0,0>: B:=<b,c>: C:=<a+b,c>: D:=<a,0>: 
AD:=D-A: DC:=C-D: M:=AD+2/5*DC: N:=(B+M)/2: BC:=AD:
BM:=M-B: AN:=N-A: 
area_AND:=1/2*LinearAlgebra:-Determinant(<AD | AN>):
area_BCM:=1/2*LinearAlgebra:-Determinant(<BM | BC>):
area_BCM/area_AND; 

                                   

First we set the coordinates of the points. Then we find the coordinates of the point  F  as the intersection of the lines  AC  and  EB . We find the area of ​​the triangle using the LinearAlgebra:-CrossProduct  command:

restart;
local D;
A, B, C, D, E := <0,0>, <0,b>, <a,b>, <a,0>, <a/2,0>:
solve({y=b/a*x, y=b-b/(a/2)*x}, {x,y});
F:=eval(<x,y>, %);
v1:=F-E; v2:=C-E;
v:=LinearAlgebra:-CrossProduct(<v1[1],v1[2],0>,<v2[1],v2[2],0>);
S:=1/2*sqrt(v[1]^2+v[2]^2+v[3]^2) assuming positive; # The area of the triangle EFC
simplify(S, {a*b=24}); # The answer

 

restart;

 

vars:=[x,y]:

k:=17:

expr:=-2*sqrt(118)*(((-4*x + y + 51/32)*sqrt(k) + (k*x)/4 - (51*y)/4 + 153/32)*sqrt(-4012 + 1003*sqrt(k)) + ((x + 4*y)*sqrt(k) - (85*x)/4 - (17*y)/4)*sqrt(4012 + 1003*sqrt(k)))*k^(1/4)/(17051*(-1 + sqrt(k)));

-2*118^(1/2)*(((-4*x+y+51/32)*17^(1/2)+(17/4)*x-(51/4)*y+153/32)*(-4012+1003*17^(1/2))^(1/2)+((x+4*y)*17^(1/2)-(85/4)*x-(17/4)*y)*(4012+1003*17^(1/2))^(1/2))*17^(1/4)/(-17051+17051*17^(1/2))

(1)

indets(expr);

{x, y}

(2)

factor(expr);

(1/64192)*(-4012+1003*17^(1/2))^(1/2)*118^(1/2)*17^(1/4)*(17^(1/2)+5)*(40*x-24*y-3)

(3)

op(factor(expr));

1/64192, (-4012+1003*17^(1/2))^(1/2), 118^(1/2), 17^(1/4), 17^(1/2)+5, 40*x-24*y-3

(4)

select(has, [op(factor(expr))], vars);

[40*x-24*y-3]

(5)
 

 

Download Download_2024-09-11_Has_Select_Question_new.mw

I think in Maple the most natural way to solve this particular problem is to use the  select  command:

restart;
L:=combinat:-permute([1,2,3,4]):
select(t->ListTools:-Search(2,t)<ListTools:-Search(3,t), L);

[[1, 2, 3, 4], [1, 2, 4, 3], [1, 4, 2, 3], [2, 1, 3, 4], [2, 1, 4, 3], [2, 3, 1, 4], [2, 3, 4, 1], [2, 4, 1, 3], [2, 4, 3, 1], [4, 1, 2, 3], [4, 2, 1, 3], [4, 2, 3, 1]]

Here is a simple calculation of the volume of this body and its drawing. Your body is like a torus. First we calculate the volume of this "torus" without a hole, and then simply subtract the volume of the hole. For drawing we use parametric equations of the surface of this body. For clarity, a cutout of 1/4 of the body is made.

restart;
f:=y->y^2-3: g:=y->y-y^2:
int(Pi*(2-f(y))^2, y=-1..3/2)-int(Pi*(2-g(y))^2, y=-1..3/2); # The volume of the solid
evalf(%);
M:=<cos(t),-sin(t); sin(t),cos(t)>:
P1:=plot3d([convert(M.<f(z)-2,0>, list)[1]+2, convert(M.<f(z)-2,0>, list)[2], z], t=-Pi/2..Pi, z=-1..3/2, color="Blue", scaling=constrained, axes=normal):
P2:=plot3d([convert(M.<g(z)-2,0>, list)[1]+2, convert(M.<g(z)-2,0>, list)[2], z], t=-Pi/2..Pi, z=-1..3/2, color="Red", scaling=constrained, axes=normal):
L:=plottools:-line([2,0,-2.9],[2,0,2.9], color=green, linestyle=3, thickness=2):
plots:-display(P1, P2, L, view=[-4.3..8.1,-6.1..6.1,-2.1..3.1]);

                   

 

To solve this, we can follow the plan:
1. Take a point M inside the pyramid - we can take any linear convex combination of the pyramid's vertices.
2. Find the projections of this point M1 and M2 onto the desired planes.
3. Find the angle alpha between the vectors MM1 and MM2.
4. The required angle is Pi - alpha.

restart;
local D:
with(Student:-MultivariateCalculus):
A, B, C, D, S :=  [0,0,0], [1,0,0], [1,1,0], [0,1,0], [0,0,1]:
p1, p2 := Plane(S,B,C), Plane(S,C,D):
M:=(A+B+C+D+S)/5;
M1:=Projection(M, p1);
M2:=Projection(M, p2);
v1:=convert(M1-M,Vector);
v2:=convert(M2-M,Vector);
Pi-Angle(v1,v2);  # The answer

                               

               

data[2 .. 3];

 

This figure is not bounded and its angles go to infinity in three directions. Therefore, to accurately calculate the area, the integration limits should be changed:

restart;
y0 := -ln(1 - exp(-x)):
y1 := -ln(-1 + exp(-x)):
y2 := -ln(1 + exp(-x)):
Area := int(y1-y2, x=-infinity..0) + int(y0-y2, x=0..infinity);
evalf(Area); 

                               

 

 

restart;
Square:=proc(t, r)
local A, B, M, N, v, R, P, c, s, T;
uses plots, plottools;
A := [-r, 0];
M := <r*cos(t), r*sin(t)>;
v:=M-convert(A,Vector);
R:=<cos(Pi/2),-sin(Pi/2); sin(Pi/2),cos(Pi/2)>;
N:=M + R.v;
P:=N - v;
M, N, P := convert~([M, N, P], list)[];
c:=circle(r, color = blue);
s:=curve([A,M,N,P,A], color=red);
T:=textplot([[A[],"A"],[r,0,"B", align=right],[M[],"M"],[N[],"N"],[P[],"P"]], font=[times,16], align={left,above});
display(c, s, T, scaling=constrained, thickness=2);
end proc:

plots:-animate(Square, [t,1], t=0..2*Pi, frames=90);

       

 


 

restart;

v := 1: a := 0: b := 1: t := 0.1e-2: dt := 0.1e-3: N := 5: h := (b-a)/(N-1):

for i to N do x[i] := a+(i-1)*h end do:
p := x->product(x-x[k], k = 1 .. N);
f := expand(p(x));

proc (x) options operator, arrow; product(x-x[k], k = 1 .. N) end proc

 

x^5-(5/2)*x^4+(35/16)*x^3-(25/32)*x^2+(3/32)*x

(1)

PRime := diff(f, x);

5*x^4-10*x^3+(105/16)*x^2-(25/16)*x+3/32

(2)

for i to N do
for j to N do
 if i <> j then a[i, j] := (eval(PRime, x = x[i]))/((x[i]-x[j])*(eval(PRime, x  = x[j]))) else
 a[i, j] := -add(`if`(k<>i, a[i, k], undefined), k = 1 .. N) end if;  
 end do:
 end do:

seq(seq(a[i,j], i=1..N), j=1..N);

undefined, -1, 1/3, -1/3, 1, 16, undefined, -8/3, 2, -16/3, -12, 6, undefined, -6, 12, 16/3, -2, 8/3, undefined, -16, -1, 1/3, -1/3, 1, undefined

(3)

 


 

Download burgers_type_method_new.mw

A circle does not necessarily pass through 4 points, even if the points lie in the same plane. Therefore, we first find the center of the circle passing through points C, D, H, and then check that point K also lies on the same circle:


 

restart;
_local(D, O);
with(Student:-MultivariateCalculus):
A := [0, 0, 0];
B := [a, 0, 0];
C := [a, b, 0];
D := [0, b, 0];
S := [0, 0, h];
O := [x, y, z];
lineSC := Line(S, C);
lineSD := Line(S, D);
H := Projection(A, lineSC);
K := Projection(A, lineSD);
OH := H - O;
OK := K - O;
OC := C - O;
M := Matrix([OH, OK, OC]);
E:=(C+D)/2;
F:=(C+H)/2;
p1:=Plane(E,convert(C-D,Vector));
p2:=Plane(F,convert(C-H,Vector));
Eq1:=GetRepresentation(p1);
Eq2:=GetRepresentation(p2);
Md:=LinearAlgebra:-Determinant(M);
solve({Eq1,Eq2,Md}, {x,y,z});
O := eval(O, %);
d:=simplify(Distance(O, H));
d1:=simplify(Distance(O, K));
is(d=d1);

A := [0, 0, 0]

 

B := [a, 0, 0]

 

C := [a, b, 0]

 

D := [0, b, 0]

 

S := [0, 0, h]

 

O := [x, y, z]

 

Student:-MultivariateCalculus:-Line([0, 0, h], Vector(3, {(1) = a, (2) = b, (3) = -h}), variables = [x, y, z], parameter = t, id = 1)

 

Student:-MultivariateCalculus:-Line([0, 0, h], Vector(3, {(1) = 0, (2) = b, (3) = -h}), variables = [x, y, z], parameter = t, id = 2)

 

H := [h^2*a/(a^2+b^2+h^2), h^2*b/(a^2+b^2+h^2), h*(a^2+b^2)/(a^2+b^2+h^2)]

 

K := [0, h^2*b/(b^2+h^2), h*b^2/(b^2+h^2)]

 

OH := [-x+h^2*a/(a^2+b^2+h^2), -y+h^2*b/(a^2+b^2+h^2), -z+h*(a^2+b^2)/(a^2+b^2+h^2)]

 

OK := [-x, -y+h^2*b/(b^2+h^2), -z+h*b^2/(b^2+h^2)]

 

OC := [-x+a, -y+b, -z]

 

Matrix(3, 3, {(1, 1) = -x+h^2*a/(a^2+b^2+h^2), (1, 2) = -y+h^2*b/(a^2+b^2+h^2), (1, 3) = -z+h*(a^2+b^2)/(a^2+b^2+h^2), (2, 1) = -x, (2, 2) = -y+h^2*b/(b^2+h^2), (2, 3) = -z+h*b^2/(b^2+h^2), (3, 1) = -x+a, (3, 2) = -y+b, (3, 3) = -z})

 

E := [(1/2)*a, b, 0]

 

F := [h^2*a/(2*(a^2+b^2+h^2))+(1/2)*a, h^2*b/(2*(a^2+b^2+h^2))+(1/2)*b, h*(a^2+b^2)/(2*(a^2+b^2+h^2))]

 

Student:-MultivariateCalculus:-Plane(Vector(3, {(1) = a, (2) = 0, (3) = 0}), [(1/2)*a, b, 0], variables = [x, y, z], id = 1)

 

_m2776775710912

 

x = (1/2)*a

 

(-h^2*a/(a^2+b^2+h^2)+a)*x+(-h^2*b/(a^2+b^2+h^2)+b)*y-h*(a^2+b^2)*z/(a^2+b^2+h^2) = (-h^2*a/(a^2+b^2+h^2)+a)*((1/2)*h^2*a/(a^2+b^2+h^2)+(1/2)*a)+(-h^2*b/(a^2+b^2+h^2)+b)*((1/2)*h^2*b/(a^2+b^2+h^2)+(1/2)*b)-(1/2)*h^2*(a^2+b^2)^2/(a^2+b^2+h^2)^2

 

-h^2*a*(a^2*b*h-a^2*b*z-a^2*h*y+b^3*h-b^3*z-b^2*h*y)/((a^2+b^2+h^2)*(b^2+h^2))

 

{x = (1/2)*a, y = (1/2)*b*(b^2+2*h^2)/(b^2+h^2), z = (1/2)*h*b^2/(b^2+h^2)}

 

[(1/2)*a, (1/2)*b*(b^2+2*h^2)/(b^2+h^2), (1/2)*h*b^2/(b^2+h^2)]

 

(1/2)*(((b^2+h^2)*a^2+b^4)/(b^2+h^2))^(1/2)

 

(1/2)*(((b^2+h^2)*a^2+b^4)/(b^2+h^2))^(1/2)

 

true

(1)

 


 

Download center_circle.mw

In this example, it's easier to do it manually, using the empty symbol  ``   to prevent automatic bracket expansion:

restart;
p:=9*csc(theta)^2+9;
9*``(p/9);

 

evala(M);

 

You can use a special program for this. See  https://mapleprimes.com/posts/200677-Partition-Of-An-Integer-With-Restrictions

Examples of use:

Partition(10, 4, 1..4);  # Your problem.
``;
Partition(10, 4, {1,3,5,7,9});  # Partitions of length 4 consisting only of odd numbers.
``;
Partition(10, 1..10, {1,3,5,7,9});  # Any partitions of odd numbers.

         

 

 

1 2 3 4 5 6 7 Last Page 1 of 283