## 15082 Reputation

12 years, 26 days

## plots:-implicitplot...

1. For grouping the terms of an equation in Maple do not use square or curly brackets (only parentheses).

2. There is no need to use the  fsolve  command first for plotting, you can immediately plot with the  plots:-implicitplot  command. We see 2 values of  M  for each value of  sigmai from the range  0.1..0.4 :

 > Eq:=-(1/18)*(((M+sqrt(3)*sqrt(sigmai))^2-(M-sqrt(3)*sqrt(sigmai))^2)^(3/2)-(M+sqrt(3)*sqrt(sigmai))^3+(M-sqrt(3)*sqrt(sigmai))^3)*sqrt(3)/sqrt(sigmai)+2*f*(1-(1+(1/2*(qc-1))*(M-sqrt(3)*sqrt(sigmai))^2)^((3*qc-1)/(2*qc-2)))/(3*qc-1)+(2*(1-f))*(1-(1+(1/2)*beta*(qh-1)*(M-sqrt(3)*sqrt(sigmai))^2)^((3*qh-1)/(2*qh-2)))/(beta*(3*qh-1))=0; params:=[qc=0.7,qh=0.7,beta=0.1, f=0.11]; R:=sigmai=0.1..0.4; Eq1:=eval(Eq, params); plots:-implicitplot(Eq1, R, M=-10..10, gridrefine=4);

## R^2->R^2...

We can think of a conformal mapping as a mapping from R^2 to R^2 :

 > restart; assume(y, real); assume(x, real); f := z -> I + z*exp(1/4*I*Pi); w := f(x + y*I); u := Re(w); v := Im(w); with(plots): with(plottools): R:=display(polygon([[0,0],[1,0],[0,1]],color="LightBlue"),seq(plot(i,x=0..1-i,color=black),i=0..1,0.1),plot([seq([i,t,t=0..1-i],i=0..1,0.1)],color=black)): F:=transform(unapply([u,v],x,y)): `f(R)`:=display(F(R)): display(, scaling=constrained, size=[300,300]); display(R,`f(R)`);

 >

 >
 >
 >
 >
 >

## elementwise equality...

```restart;
eq:=x^2+2*x-1=0;
x=~[solve(eq)];```

## Procedure for this...

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);
 (1)
 >

## Inert form...

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...

_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]);
sol1:=eval(sol,_B1=0);
sol2:=eval(sol,_B1=1);
odetest(sol1,ode);
odetest(sol2,ode);
```

## Student:-Calculus1:-Roots...

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
 (1)
 >

## plots:-animate...

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

## Symmetries and nested seq...

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
 (1)
 >

## Parameterization of 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]);
```

## Ways...

 > 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);
 >

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);
 >

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.

## Student:-Calculus1:-Roots, identify...

The following approach is sometimes useful:

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

## Solution...

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]);
```

 1 2 3 4 5 6 7 Last Page 2 of 235
﻿