Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

How to write names on an drawing P1, P2, P3, Pn... I try
textplot({seq([(coordinates(point(P[i]))), cat("P", i)], i = 0 .. 5)}, 'align' = {'above', 'left'}):;
i got the message : wrong number of arguments that i don't how correct. Thank you.

restart; with(plots):unprotect(gamma):
_EnvHorizontalName := 'x';_EnvVerticalName := 'y';
line := proc (x1, y1, x2, y2) options operator, arrow; (x-x1)*(y2-y1)-(y-y1)*(x2-x1) end proc:
R := 3:
ang := [0, (1/3)*Pi, 3*Pi*(1/4)+.2, 7*Pi*(1/6)+.4, 8*Pi*(1/5), 13*Pi*(1/7)]:
for i to 6 do P || i := [R*cos(ang[i]), R*sin(ang[i])] end do:
pts := [seq(P || i, i = 1 .. 6)]:
for i to 6 do tang || i := x*P || i[1]+y*P || i[2] = R^2 end do:
sol:=solve({tang1,tang3},{x,y}):Q13:=[subs(sol,x),subs(sol,y)]:
sol := solve({tang1, tang2}, {x, y}): Q1 := [subs(sol, x), subs(sol, y)]:
sol := solve({tang2, tang3}, {x, y}): Q2 := [subs(sol, x), subs(sol, y)]:
sol := solve({tang3, tang4}, {x, y}): Q3 := [subs(sol, x), subs(sol, y)]:
sol := solve({tang4, tang5}, {x, y}): Q4 := [subs(sol, x), subs(sol, y)]:
sol := solve({tang5, tang6}, {x, y}): Q5 := [subs(sol, x), subs(sol, y)]:
sol := solve({tang1, tang6}, {x, y}): Q6 := [subs(sol, x), subs(sol, y)]:
ptQ := [seq(Q || i, i = 1 .. 6)]:
line14 := line(Q1[1], Q1[2], Q4[1], Q4[2]): L14 := implicitplot(line14, x = -10 .. 10, y = -10 .. 10, color = red):
line25 := line(Q2[1], Q2[2], Q5[1], Q5[2]): L25 := implicitplot(line25, x = -10 .. 10, y = -10 .. 10, color = red):
line36 := line(Q3[1], Q3[2], Q6[1], Q6[2]): L36 := implicitplot(line36, x = -10 .. 10, y = -10 .. 10, color = red):
sol := solve({line14, line25}, {x, y}): I1 := [subs(sol, x), subs(sol, y)]:

lineP23 := line(P2[1], P2[2], P3[1], P3[2]): lineP56 := line(P5[1], P5[2], P6[1], P6[2]):
sol := solve({lineP23, lineP56}, {x, y}): gamma := [subs(sol, x), subs(sol, y)]:
lineP12 := line(P1[1], P1[2], P2[1], P2[2]): lineP45 := line(P4[1], P4[2], P5[1], P5[2]):
sol := solve({lineP12, lineP45}, {x, y}): beta := [subs(sol, x), subs(sol, y)]:
lineP34 := line(P3[1], P3[2], P4[1], P4[2]): lineP16 := line(P1[1], P1[2], P6[1], P6[2]):
sol := solve({lineP16, lineP34}, {x, y}): alpha := [subs(sol, x), subs(sol, y)]:
pl:= line(alpha[1], alpha[2], gamma[1], gamma[2]):
hexa := seq(implicitplot(tang||i, x = -20 .. 20, y = -20 .. 20, linestyle=3,color = blue),i=1..6):
#hexa:=plot([seq([P||i,P||(i mod 6)+1],i=1..6),color=green): 
#hexa:=plot([seq([P||i,P||(i+1)],i=1..6)],thickness=4,color=green): 
hex:=plot([[Q1,Q2],[Q2,Q3],[Q3,Q4],[Q4,Q5],[Q5,Q6],[Q6,Q1]],thickness=4,color=green):
tp := textplot({seq([op(pts[i]), cat("P", i)], i = 1 .. 6)}, 'align' = {'above', 'left'}):
tpq := textplot({seq([op(ptQ[i]), cat("Q", i)], i = 1 .. 6)}, 'align' = {'above', 'left'}):
TP:=textplot([[I1[],"I"],[alpha[],"alpha"],[beta[],"beta"],[gamma[],"gamma"]],'align' = {'above', 'left'}):
slopes:=[seq(((dx,dy)->dy/dx)((pts[i]-pts[(i mod 6)+1])[]),i=1..6)]:
lines:=zip((pt,slope)->y=slope*(x-pt[1])+pt[2],pts,slopes):
plotpts:=plot(pts,style=point,colour=red,symbol=solidcircle,symbolsize=5):
plotptQ:=plot(ptQ,style=point,colour=black,symbol=solidcircle,symbolsize=5):
plotlines:=plot(rhs~(lines),style=line,linestyle=3,colour=magenta):
cir:=implicitplot(x^2+y^2=R^2,x=-R..R,y=-R..R,color=black):
PL:=implicitplot(pl,x=-1..15,y=-15..6,color=blue,thickness=3):
display(plotpts,plotptQ,plotlines,hex,cir,L14,L25,L36,PL,tp,tpq,TP,axis = [gridlines = [4, color = blue]],
view=[-6..10,-15..6],scaling=constrained,axes=none,size=[800,800]):
How to simplify this program ? Thank you.

Hello. I have certain requirements for drawings. Please tell me, is it possible to implement them when plotting in Maple? Thanks.
Drawing width 15 cm
Be sure to frame and mesh. The thickness of the frame and serifs on the axes is 0.5 pt. Mesh thickness 0.25 pt. The length of the serifs is 1.2 mm.
The thickness of the graph itself is 1 pt
Axis names 10 pt

How to show that the function z0(t)=t²+exp(-t)  is solution of z"(t)+2z'(t)+z(t)=2exp(-t); Thank you.

Hello. Tell me, please, is it possible to somehow remove the labels on the axes in Maple when plotting graphs? I mean labels 1, 2, 3 and so on. Thank you for your help.

If the equation with homogeous coordinates in the base (A,B,C) is pYZ+qZX+rXY=0, an affine  equation in the base (A,AB,AC) is
pxy+qy(1-x-y)+r(1-x-y)=0, it is also written rx²+(q+r-p)xy+qy²=0. The discrim of  trinom is rx²+(q+r-p)xy+qy² is of the sign of 
delta=(q+r-p)²-4qr; We get a hyperbole, a parabole, an ellipse according to delta is >0, =0 or <0 respectvely. How implement
this property. Thank you very much.

The problem: to simplify the expression

for any negative  x  and  y .

Below we see that Maple copes with the task brilliantly (example 1). For example, it presents  sqrt(x*y)  as  sqrt(-x)*sqrt(-y)  and so on. But the same technique, applied only to the numerator of this expression does not give the desired presentation in the form of a square (example 2 and example 3).

restart;
# Example 1
A:=(x+y-2*sqrt(x*y))/(sqrt(-x)+sqrt(-y));
simplify(A) assuming negative;
factor(%,{sqrt(-x),sqrt(-y)});

                                         

restart;
# Example 2
B:=x+y-2*sqrt(x*y);
simplify(B) assuming negative;
factor(%,{sqrt(-x),sqrt(-y)});

                                           

 

restart;
# Example 3
B:=x+y-2*sqrt(x*y);
R:=simplify(B) assuming positive;
combine(R) assuming positive;
factor(R,{sqrt(x),sqrt(y)});

                                                   

Two questions:

1. Does anyone know the reasons for this behavior.

2. Does anyone know an easy way to simplify in examples 2 and 3 (without  substitutions  like  x=+-u^2  and  y=+-v^2 and so on,  of course)

 

Download sqrt.mw

 

An exercise of 1948 commits me to form the equation of conics passing by 3 points. Let P=0, Q=0, R=0 be the equations of the sides of the triangle ABC; if we associate these sides 2 to 2 we obtain 3 conics passing through points A, B, C having for equations QR=0, RP=0, PQ=0. As a result, the general equation of conics around the triangle ABC is: aQR+bRP+cPQ=0. P, Q, R being equations of the form mx+ny+pz=0 (so-called homogeneous coordinates). Then change to refined coordinates with x+y+z=1 (formula found on the internet and surely misinterpreted). Is it necessary to change of base ? Thank you for your help.

In the two examples below (in the second example, the range for the roots is simply expanded), we see bugs in both examples (Maple 2018.2). I wonder if these errors are fixed in Maple 2020?
 

restart;

solve({log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2,x>=-7*Pi/2,x<=-2*Pi}, explicit, allsolutions); # Example 1 - strange error message
solve({log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2,x>=-4*Pi,x<=-2*Pi}, explicit, allsolutions);  # Example 2 - two roots missing

Error, (in assume) contradictory assumptions

 

{x = -(11/3)*Pi}, {x = -(10/3)*Pi}

(1)

plot(log[1/3](2*sin(x)^2-3*cos(2*x)+6)+2, x=-7*Pi/2..-2*Pi);
plot(log[1/3](2*sin(x)^2-3*cos(2*x)+6)+2, x=-4*Pi..-2*Pi);

 

 

Student:-Calculus1:-Roots(log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2, x=-7*Pi/2..-2*Pi);  # OK
Student:-Calculus1:-Roots(log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2, x=-4*Pi..-2*Pi);  # OK

[-(10/3)*Pi, -(8/3)*Pi, -(7/3)*Pi]

 

[-(11/3)*Pi, -(10/3)*Pi, -(8/3)*Pi, -(7/3)*Pi]

(2)

 


I am glad that  Student:-Calculus1:-Roots  command successfully handles both examples.

 

Download bugs-in-solve.mw

At the moment t=0, we place a body at 100 ° C in a room at 25°C; we designate by q(t) the temperature at the moment t. The differential equation is.q'(t)+k*(q(t)-25)=t, with k cooling coefficient equal to 2.
Determine the solution that checks the initial condition.
What is the body temperature after 30 minutes.
After how long the temperature drops to 50°C. Thank you for the help.

Eq=z"(t)+3z'(t)+2z(t)=24*(exp(-3t)-exp(-4t)) how to find the gereral solution of this equation. Thank you.

 

Hello,

 

I have a problem with PDE coupled that I don't know how to solve in the maple.

Are there some analitical/numerical methods to solve the problem?

 

Any help will be usefull!!

 

 

Hi,

The evalDG command included in the LieAlgebras via the DifferentialGeometry package allows summations such as evalDG(e1+e2) where e1 and e2 are two generators of a given Lie algebra.

Now, let L be a list of such summations, e.g.,

L= [e1+a*e3,2*e2+b*e4,e1+3*e5]

where a and b are symbols for variable names in the real domain.
Then, while the code

evalDG(add(eval(cat(e,i)),i=1..n));

works fine (n be a given integer), the code

evalDG(add(eval(L[i]),i=1..n));

does not, and an error message results due to an "invalid subscript selector".

What is the right code to realize this summation?

Thanks.

Jaqr

Hi everybody,

This is my code:

assume(0 < a, 0 < L, a < L);

M := piecewise(0 <= x and x < a, P*x*(L-a)/L, a <= x and x < L, P*a*(L-x)/L);
ode := diff(y(x), `$`(x, 2)) = M/(E*I__0);
ic := y(0) = 0, y(L) = 0;
sol := factor(dsolve([ode, ic], y(x))); assign(sol); y1 := y(x);

I have two questions:

1) How to plot y1?

I would like to plot y1, but in the plot can to specify a values of a, L, P, E and I.

2) How can I find a maximun and minimun value of y1?

I tried to use maximize and minimize commands but really I don't know if I used them correctly.

Thank you.

 

 

Hi, my problem is the next differential equation:

In maple. I used this code to solved it, but throws this error:

dsolve({diff(y(x), x, x) = -P*x/(I*E), eval(y(x), x = L) = 0, eval((D(y))(x), x = L) = 0});
Error, (in dsolve) found differentiated functions with same name but depending on different arguments in the given DE system: {y(L), y(x)}

What is the problem with my code? How can solve my ODE with tis boundary conditions? 

 

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