Carl Love

Carl Love

28070 Reputation

25 Badges

13 years, 28 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are answers submitted by Carl Love

According to ?abs :

The derivative of abs is denoted by abs(1, x). This is signum(x) for all non-0 real numbers, and is undefined otherwise.

Therefore,

D(conjugate)(x) assuming x::real;

                   1

Maple does it this way so that the derivatives of expressions involving conjugate will simplify, as above, when appropriate assumptions are made.

 

 

 

 

I did it for the first five of your points. The idea is the same for more points. This goes through the color spectrum from red to blue, so it passes through orange, yellow, and green also.

Pts:= [[.1733, .0048], [.1726, .0048], [.1714, .0051],
[.1689, .0069], [.1644, .0109]]:
N:= nops(Pts):
plots:-pointplot(Pts, color= [seq(COLOR(HUE, (k-1)*.65/N), k= 1..N)]);

This one makes a direct transition from red ro blue, so it goes through shades of purple:

plots:-pointplot(Pts, color= [seq(COLOR(RGB, (N-k)/N, 0, k/N), k= 1..N)]);

The problem with colorstyle= HUE cycling back to red (which Acer discussed in his lengthy Reply) can be easily overcome by rescaling the colors after the PLOT structure has been generated.

Mandelbrot:= proc(x,y)
local n,c,z;
     c:= x+I*y;  z:= c;
     for n to 48 while abs(z) < 2 do  z:= z^2+c  end do;
     n
end proc:

P:= plots:-densityplot(
     Mandelbrot, -2.1..0.6, -1.2..1.2, grid= [500,500],
     colorstyle= HUE,
     axes= boxed, scaling= constrained,
     style= patchnogrid,
     labels= [Re,Im], labelfont= [HELVETICA,ROMAN,24],
     size= [500,500]  #Maple 18 only
):

#Rescale the colors:
applyop(`*`, [1,4,2], P, .85);

Remove the size option if you aren't using Maple 18. Use size=[1000,1000] for a better view in a worksheet.

A more complicated rescaling can be used. For example, one could stretch out the visually optimal green range.

The only reference that I used to write my code is the last example at ?densityplot , which does a Julia set. I am sorry that it is similar to someone else's code. It is rather obvious if you understand the Mandelbrot set and how densityplot works.

This surface is smooth and approximates the points.

A:= `<|>`(v||(1..6), w||(1..3), x1, x2, y1):
plots:-display(
     Statistics:-ScatterPlot3D(A^%T, lowess, bandwidth=2, showpoints= false, transparency= .3),
     plots:-pointplot3d(A^%T, symbol= solidsphere, color= red, symbolsize= 16)
);

Condensing Acer's ideas into a simple procedure, I get this:

FactorGroup:= proc(G::GroupTheory:-Group, N::satisfies(N-> GroupTheory:-IsNormal(N,G)))
# Returns the group G/N.
uses GT= GroupTheory;
     GT:-CustomGroup(
          GT:-LeftCosets(N,G),
          `.`= ((g1,g2)-> GT:-LeftCoset(Representative(g1) . Representative(g2), N)),
          `/`= (g-> GT:-LeftCoset(Representative(g)^(-1), N))
          `=`= ((g1,g2)-> member(Representative(g1) . Representative(g2)^(-1), N))
     )
end proc:

Example:

G:= Alt(4):
H:= SylowSubgroup(2,G):
GH:= FactorGroup(G,H);

GroupOrder(GH);

3

Edit: Procedure updated to reflect Acer's correction to a bug discussed below.

The reason that you can't change the corner entries is that doing so makes the Matrix no longer circulant---it violates the indexing function of the Matrix.

Your Matrix is equivalent to a symmetric band matrix:

N:= 8:
A:= LinearAlgebra:-BandMatrix([[-1$N-1], [2$N]], shape= symmetric);

 

Use a local declaration in your procedure, like this:

My_Proc:= proc(...parameter declarations...)
local L, P, V;

   ...procedure statements...

end proc:

It can be done like this:

Plex:= < u | v | w | x | y | z >;

for i from 2 to 5 do Plex:= Plex[[i, 1..i-1, i+1..-1]] end do;

 

while n >= 1 do
     for i from 1 to n do
          S[i]:= resultant(F[i], F[i+1], Plex[i])
     end do;
     F[i]:= S[i];
     n:= n-1
end do;

I am not sure if you are more interested in reproducing the animation in your first link or in analyzing solids of revolution as in the second (MapleSoft) link. I chose the former. Except for the coordinate axes, the following is very close to the animation in your first link. I just estimated the number of gridlines.

restart:
f:= x-> -x^3+4*x^2-3*x+1:
plots:-animate(
     #Each frame of animation has 4 pieces put together by `display`.
     plots:-display,
     [[
       #A cylindrical sector of the curved surface:
       'plot3d'(
            [r,t,f(r)], t= 0..T, r= 0..3,
            coords= cylindrical, style= wireframe, grid= [30,20]
       ),
       #A sector of the base cylinder:
       'plot3d'(
            [3,t,z], t= 0..T, z= 0..f(3),
            coords= cylindrical, style= wireframe, grid= [30,2]
       ),
       #A sector of the base disk of the base cylinder:
       'plot3d'(
            [r,t,0], t= 0..T, r= 0..3,
            coords= cylindrical, style= wireframe, grid= [30,8]
       ),
       #The curve which is being revolved:
       'plots:-spacecurve'(
             #The main curve:
            {[r,T,f(r)],
             #The 3 straight line segments of the curve:
              [[3,T,f(3)], [3,T,0], [0,0,0], [0,0,f(0)]]
             },
            r= 0..3, coords= cylindrical, thickness= 2, color= red
       )
      ], scaling= constrained, axes= normal, orientation= [90,65]
     ], T= 0..2*Pi, paraminfo= false
);

Basically, you want to plot -abs(x^x).

plot(-abs(x^x), x= -2..0);

 

 

e^x is exp(x) in Maple; e is treated simply as another variable, hence your error messages. Try this:

plot(exp(x)*ln(x), x= 0.1..10);

Kitonum wrote:

Herd size that satisfies all the constraints, very large, and Maple can count it only approximately.

Not true, at least in Maple 18. It can compute all 200,000+ digits of the answer in the blink of an eye, if you use evala. This may be a good example to show how Maple has advanced.

restart:
w:= 300426607914281713365*sqrt(609)+84129507677858393258*sqrt(7766):
n:= evala((w^4658-1/w^4658)^2/(4657*79072)):
d:=3515820*n;                             
B:= (1243419/585970)*d;
local D: D:= (367903/175791)*d;
W:= (246821/83710)*d;
Y:= (125739/106540)*d;
b:= (815541/585970)*d;
w:= (17158/8371)*d;
y:= (1813071/1171940)*d;

... long integer answers omitted ...

is(sqrt(W+B), integer);

                        true

is(-3/2+(1/2)*sqrt(1+8*(D+Y)),integer);

                        true

In your second plot---the one with more points---you forgot to increase the denominators from 149 to 249. Thus, you only increased the number of points outside the set. If you increase the denominators to 249, you will indeed get a denser, more-detailed plot.

I don't know what you mean by "flush". And why do you expect lines when you are plotting points? If you use enough points, then you will get a plot that doesn't appear pixellated.

Here's a better way to plot the Mandelbrot set: We use the concept of "escape time".  In your code, you rejected points if they got to Float(infinity) after 100 iterations. Actually, once the abs(z) > 2, it's guaranteed to go to infinity. In the escape-time way, we count the number of iterations it takes to get abs(z) > 2 or max out at 100 iterations. The color of a point is determined by the number of iterations.

Mandelbrot:= proc(x,y)
local n,c,z;
     c:= x+I*y;
     z:= 0;
     for n to 100 while abs(z) < 2 do
          z:= z^2+c
     end do;
     n
end proc:

plots:-densityplot(
     Mandelbrot, -1.5..0.5, -1..1, grid= [250,250],
     colorstyle= HUE,
     axes= boxed, scaling= constrained,
     style= patchnogrid,
     labels= [Re,Im]
);

You'll notice that this is much faster than your code, yet it is doing a very similar computation. That's because this code is processed in the evalhf environment.

P:= randpoly([x,y]);

 

C:= [coeffs(P, [x,y], 't')];

t;

 

add(C[k]*t[k], k= 1..nops(C));

 

First 304 305 306 307 308 309 310 Last Page 306 of 395