Kitonum

14009 Reputation

24 Badges

11 years, 190 days

MaplePrimes Activity


These are replies submitted by Kitonum

@ActiveUser 

restart;
solve(m(x)^n=0, m(x));
diff(%, x);

                                                   0
                                                   0

@Carl Love In this case, 4 or 5 different ratings are used ( {-1, 0, 2, 3} or {-1, 0, 1, 2, 3}  ). Of course, to get an unambiguous answer, a more precise statement of the problem is required from OP.

@acer  Thanks for this observation. Take a look at the complement of my answer above.

You are trying to set a tangent to a circle passing through its center. Such a tangent does not exist and TangentLine command returns NULL.

@Ramakrishnan  You can do the same with the  geometry  package. To remove excess parts of circles you can use the  view  option:

restart;
with(plots): with(geometry):
square(Square,[point(A,0,0),point(B,0,4),point(C,4,4),point(DD,4,0)]):
circle(Circle_green,x^2+y^2=4^2, [x,y]):
circle(Circle_blue,x^2+(y-2)^2=2^2, [x,y]):
circle(Circle_red,(x-2)^2+(y-4)^2=2^2, [x,y]):
P:=draw([Square(color=black,thickness=1), Circle_green(color=green,thickness=2), Circle_blue(color=blue,thickness=2), Circle_red(color=red,thickness=2)], view=[0..4,0..4]):
Region_yellow:=inequal({y<sqrt(4^2-x^2),y>sqrt(2^2-x^2)+2}, x=0..2, y=2..4, color=yellow, nolines):
Region_pink:=inequal({y<sqrt(4^2-x^2),y>-sqrt(2^2-(x-2)^2)+4}, x=2..4, y=2..4, color=pink, nolines):
display(P, Region_yellow, Region_pink, axes=normal);

 

@Carl Love  You are right. Another example:

sum((-1)^n, n=1..infinity);
sum((-1)^n, n=1..infinity, formal);

 

@Carl Love OP wants to get  [5,2,3] , but these numbers go in different order in different lists. Therefore, I understood the question as to find common elements in these lists without taking into account the order of these elements.

@johncarl 

z := -y + sech(x - 3*t);
w := 10*sech(x - 3*t);
y1:=eval(w, [t = 0,x=-10]); 
y2:=eval(w, [t = 0,x=10]);
minimize(eval(z, t = 0),[x = -10 .. 10, y = -y1 .. y2]);
evalf(%); 
maximize(eval(z, t = 0),[x = -10 .. 10, y = -y1 .. y2]);
evalf(%); 

 

@lt00414  I didn’t understand what you can’t do? When you plot a function, you yourself specify the range for the argument. Run the following code:

E:=1/2:
Eq := -(1/2)*(diff(psi(x), x, x))+(1/2)*x^2*psi(x) = E*psi(x); 
Sol := dsolve(Eq);
plot(eval(rhs(Sol),[_C1=2,_C2=1]), x=-2..2);

@johncarl  The procedure  ContoursWithLabels  does not provide for the plotting of contours in non-rectangular areas. I think the easiest way to solve your problem is to simply add labels for the corresponding level lines  eval(z, t = 0)=C , using the  plots:-textplot  command: 


 

z := -y + sech(x - 3*t);
w := 10*sech(x - 3*t);
with(plots):
P1 := plot(eval(w, t = 0), x = -6 .. 6):
Contours:=[-7,-3,1,5,9]:
Y:=map(p->solve(eval(z,[x=1,t=0])=p,y),Contours):
P2 := contourplot(eval(z, t = 0), x = -10 .. 10, y = -eval(w, t = 0) .. eval(w, t = 0), contours = Contours, color=blue, grid = [101, 101]):
Labels:=textplot([seq([1,Y[i],C=Contours[i]], i=1..5)], color=red, font=[times,14], align=above):
display(P1,P2,Labels, size=[400,400]);

-y+sech(-x+3*t)

 

10*sech(-x+3*t)

 

 

 


 

Download Contours_new.mw

@Kitonum In my answer above, I used numerical approximations to plot. Of course, this is not rigorous proof that the points actually lie on the same circle. But we can easily prove this rigorously (in this example) if we use symbolic expressions for the roots of the system and the condition for 4 points to belong to the same circle  (see https://math.stackexchange.com/questions/1252944/technique-for-proving-four-given-points-to-be-concyclic ):

restart;
P0:=[1,1]:
Sys:={x^2/5^2+y^2/3^2=1, (x-P0[1])*(y/3^2)-(x/5^2)*(y-P0[2])}:
Sol:=[solve(Sys,explicit)]:
L:=map(t->eval([x,y],t),Sol):
a:=L[1]: b:=L[3]: c:=L[4]: e:=L[2]: e1:=-e:
f:=(x,y)->x^2+y^2:
M:=<f(a[]),a[1],a[2],1; f(b[]),b[1],b[2],1; f(c[]),c[1],c[2],1; f(e1[]),e1[1],e1[2],1>: 
simplify(LinearAlgebra:-Determinant(M));

   The output:                                              0


I tried using the same technique for an arbitrary ellipse and an arbitrary point P0, but did not succeed.

@TeyhaNeedHelp  Use the  eval  command for this.

Example (let  eta=1):
eval([f(eta), theta(eta)], sol(1));
                         
 [0.534212077281807, 0.0239516677989057]

@Adam Ledger  See the help page  remember (Option remember in Procedures)  for this.

@tiaranain  Change the last line to
plots:-fieldplot3d( RHS, x=-1..1, y=-1..1, z=-1..1, arrows=THICK, color=red,  grid=[5,5,5], axes=box);
 

@Zeineb  because 180 is divided by 90 without a remainder. Strictly speaking, only one second case can be left, because 0 is also divisible by 90.

2 3 4 5 6 7 8 Last Page 4 of 105