Kitonum

21475 Reputation

26 Badges

17 years, 49 days

MaplePrimes Activity


These are answers submitted by Kitonum

Is this what you want?

Tour2:=[[[1, 2, 3, 4]], [[1, 2], [1, 3, 4]], [[1, 3], [1, 2, 4]], [[1, 4], [1, 2, 3]], [[1, 2], [1, 3], [1, 4]]]:
seq(seq(add(d[s[i]]*x[s[i],s[i+1]], i=1..nops(s)-1)<=K , s=t), t=Tour2);

d[1]*x[1, 2]+d[2]*x[2, 3]+d[3]*x[3, 4] <= K, d[1]*x[1, 2] <= K, d[1]*x[1, 3]+d[3]*x[3, 4] <= K, d[1]*x[1, 3] <= K, d[1]*x[1, 2]+d[2]*x[2, 4] <= K, d[1]*x[1, 4] <= K, d[1]*x[1, 2]+d[2]*x[2, 3] <= K, d[1]*x[1, 2] <= K, d[1]*x[1, 3] <= K, d[1]*x[1, 4] <= K


 


 

Abitur 2016 B2 Aufgabe B2.1 Pyramide

a)

 

restart; with(geom3d); with(plots)

point(A, 0, -6, 0);

A

 

[0, -6, 0]

 

B

 

[6, 0, 0]

 

C

 

[0, 6, 0]

 

S

 

[0, 0, 5]

(1.1)

P := [[kA, kB, kS], [kB, kC, kS], [kA, kB, kC], [kC, kA, kS]]:

Punkte := plots:-pointplot3d([kA, kB, kC, kS], color = [red, green, blue, black], symbol = solidsphere, symbolsize = 15, labels = [x1, x2, x3]):

plots:-display(Punkte, Pyramide, scaling = constrained);

 

Mittelpunkt zwischen Kante AS

geom3d:-point(M1, 0, -3, 2.5);

M1

 

[0, -3, 2.5]

 

M2

 

[0, 3, 2.5]

(1.2)

midpoint(M, A, S); detail(M)

M

 

Geom3dDetail(["name of the object", M], ["form of the object", point3d], ["coordinates of the point", [0, -3, 5/2]])

(1.3)

plane(E, [M1, M2, B]);

E

(1.4)

detail(E)

Warning, assuming that the names of the axes are _x, _y and _z

 

Geom3dDetail(["name of the object", E], ["form of the object", plane3d], ["equation of the plane", 90.0-15.0*_x-36*_z = 0])

(1.5)

geom3d:-triangle(T1, [M1, M2, B]);

T1

(1.6)

Dreieck := draw(T1, labels = [x1, x2, x3]):

plots:-display(Punkte, Pyramide, Dreieck, view = [0 .. 6, -6 .. 6, 0 .. 5]);

 

b)

   

Aufgabe B2.2

 

   


 

Download Abituraufgabe_2016_B2_Pyramide_new.mw

Should be

plot(convert~([x,y], list)[ ]);

The  Tangents  procedure finds tangent lines to a curve (given by the equation  F(x,y)=0)  and passing through the given point  P .  Formal parameters of the procedure:  F  is the left part of the equation   F(x,y)=0  (for example if the curve has the equation  y=f(x)  then  F  is  y - f(x) ),  P is the list of coordinates of the point through which the tangent passes (the point  P may lie on the curve  and may not lie). 

restart;
Tangents:=proc(F::algebraic, P::list)
local x, y, f, Eq, Points, n, i;
uses RealDomain;
x,y:=op(indets(F, name)); 
f:=unapply(F, x,y);
if f(op(P))=0 then return D[1](f)(op(P))*(x-P[1])+D[2](f)(op(P))*(y-P[2])=0 else
Eq:=D[1](f)(x0,y0)*(x-x0)+D[2](f)(x0,y0)*(y-y0)=0;
Points:=[solve({subs([x,y]=~P, lhs(Eq)), f(x0,y0)=0}, explicit)];
n:=nops(Points);
seq(collect(simplify(subs(Points[i], Eq)),[x,y]), i=1..n) fi;
end proc:

 

Example of use - find all the tangents to the curve  y=x^3-x  passing through the point  with the coordinates  (1,-0.5) .

L:=Tangents(y-x^3+x, [1,-0.5]);  # The tangents lines in the implicit form
y=~(solve~([L], y))[ ];  # The same in the explicit form
plots:-implicitplot([y-x^3+x,L], x=-2..2, y=-1..3, color=[red,blue$3], gridrefine=3);  # The plot


 

Tang.mw

restart;
Circle:=x^2+y^2+6*x-8*y+25-1/16:
Eq:=subs(y=m*x, Circle);
discrim(Eq, x);
M:=[solve(%)];
y=M[1]*x;
 # The first tangent
y=M[2]*x;   # The second tangent
plots:-implicitplot([Circle, %, %%], x=-4..0, y=0..5, color=[red,blue$2], gridrefine=5, scaling=constrained);


Addition. Here is another solution that is more general and can be applied to an arbitrary curve given by equation  F(x,y)=0 . We find the tangent at a point  (x0,y0) at this curve and varying this point, we find points at the curve whose tangents pass through an given point (the origin at the example in the issue) :

restart;
F:=(x,y)->x^2+y^2+6*x-8*y+25-1/16:
Eq:=D[1](F)(x0,y0)*(x-x0)+D[2](F)(x0,y0)*(y-y0)=0;  
# Equation of the tangent line to the curve F(x,y)=0  at the point  (x0,y0)
P:=[solve({subs([x=0,y=0], lhs(%)), F(x0,y0)=0}, explicit)];  # The points of tangency
L1:=subs(P[1], Eq);  # The first tangent
L2:=subs(P[2], Eq);  # The second tangent
y=collect(expand(rationalize(solve(L1, y))), x);  # The final results - the tangent lines in explicit form
y=collect(expand(rationalize(solve(L2, y))), x);

Tangents.mw

M:=combinat:-permute([0$16,1$16],16):
S:=[seq(`if`(LinearAlgebra:-Rank(Matrix(4,m))>=3, m, NULL), m=M)]:  
# The list of all such matrices, represented as the lists formed of the rows
nops(S);   # The total number of such matrices  
Matrix~(4, S[1..10])[ ];   # The first 10 such matrices
Matrix~(4, S[-10..-1])[ ];    # The last 10 such matrices

Use  table  for this:

F:=table([a=1, b=3, c=-9, d=5]):
F[c];

                                           -9

 

Addition. The way by  a procedure:


oldVars:=[a,b,c,d]: newVars:=[1,3,-9,5]:
myfunc:=proc(x)
local i;
for i from 1 to nops(oldVars) do
if x=oldVars[i] then return newVars[i] fi;
od;
undefined;
end proc:
myfunc(d);  

                               5

min(subs(0=NULL, L));

This method  subs(0=NULL, L)  just takes away all the zeros from a list, maintaining its structure.

Probably it can be done only manually (not programmatically) in text mode. You can copy and paste it into other text inside the worksheet.

 

map((t->[1,t[ ]])~, Tours);

Put on your glasses.

equa1 := diff(u(x,y), x, x)-y*(1+x) = 0;
pdsolve({equa1, u(0,y) = 0, D[1](u)(0,y) = 0}); 

                                           

 

May be you want this:

Explore(plot([x, x^k], x=0..1, color=[black,red], thickness=3, axes=box, title=`Lorenz Curve`), k=1...100.);

                            

 

Addition. A similar application for G1:

G1:=2*int(x-x^k, x=0..1)  assuming k>=1;
Explore(plot([0,G1], x=0..1, 0..1, color=[black,red], thickness=3, axes=box), k=1...100.);

 

 

restart;
with(GraphTheory):
with(RandomGraphs):
P:=combinat:-permute([$ 1..7]):
L:=[seq(RandomTree(7), i=1..50)]:
U:=map(Edges, L):
f:=(x,y)->convert([seq(x=subs(zip(`=`, [$ 1..7], P[n]), y), n=1..nops(P))], `or`):
S:=[ListTools:-Categorize(f, U)]:
plots:-display(Matrix(3,4,[DrawGraph(Graph([$ 1..7], {seq({i,i+1}, i=1..6)})), seq(DrawGraph(Graph([$ 1..7],S[i,1])), i=1..nops(S)),plot([[0,0]], axes=none)]));




Even with a large number of repetitions, for some reason Maple does not generate the graph on the first picture. Therefore, it was specified for plotting manually.

 


 

fq := proc (p) options operator, arrow; piecewise(p < -5, 0., p < -3, .161711971*(p+5.)^3, p < -1, (-1)*1.798464149*p^2+(-1)*.544033315*p+7.541565235+(-1)*.3076373305*p^3, p < 1, 0.809338641e-1*p^3+(-1)*.6327505649*p^2+.6216802691*p+7.930136430, p < 3, 0.7445052690e-1*p^3+(-1)*.613300552*p^2+.602230257*p+7.936619768, p < 5, 0.19182821e-2*p^3+0.39489651e-1*p^2+(-1)*1.35614035*p+9.894990378, p < 7, (-1)*0.256603524e-2*p^3+.106754411*p^2+(-1)*1.69246414*p+10.45553002, p < 9, (-1)*0.254356370e-2*p^3+.106282509*p^2+(-1)*1.68916084*p+10.44782231, p < 11, (-1)*0.2031067084e-1*p^3+.585994401*p^2+(-1)*6.00656786*p+23.40004343, p < 13, 0.4137545813e-1*p^3+(-1)*1.449647855*p^2+16.38549696*p-58.70419431, p < 15, (-1)*0.273325019e-1*(p-15.)^3, 15 <= p, 0.) end proc

m := proc (p) options operator, arrow; `if`(1 <= p and p <= 9, fq(p), undefined) end proc;

proc (p) options operator, arrow; `if`(1 <= p and p <= 9, fq(p), undefined) end proc

 

 

``


 

Download PiecewiseTruncate_new.mw

First 159 160 161 162 163 164 165 Last Page 161 of 290