Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 357 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Carl Love Here's the same thing done in code that should work in Maple 2015:
 

restart:

Veq:= 3/2-9/2*exp(-2*x)-9/2*exp(-x)+1/2*int(exp(-y)*Z(x-y), y= 0..ln(2));

3/2-(9/2)*exp(-2*x)-(9/2)*exp(-x)+(1/2)*(int(exp(-y)*Z(x-y), y = 0 .. ln(2)))

eps:= 1e-4:
S[0]:= 3/2: S[-1]:= 0:

for n while evalf(Int(abs@(S[n-1]-S[n-2]), 1.5..3.5)) >= eps do
    S[n]:= unapply(eval(Veq, Z= S[n-1]), x)
od
:

n;

13

plot(S[n-1], 1.5..3.5);

 


 

Download IntEq.mw

@Carl Love Gimme a moment, and I'll retrofit that to your Maple 2015.

@LichengZhang The English word "next" as used by John May implies something in the future. Maple 2019.2's release is something in the past.

Are you saying that after 6 years on MaplePrimes, you don't know how to even enter the above equations into Maple?

@Kitonum Please post worksheets inline so that I can read them on my phone. 

Please post worksheets inline so that I can read them on my phone.

@dingtianlidi Hmm, I see that you're right. I couldn't do anything to get colorscheme= ["xyzcoloring", ...to work with tubeplot. But it won't give an error message either! Unfortunately, that misled me to believe that my previous plot was correct.

Here's an alternative which I'm sure works (as can be seen in the plot below). We use the old-style option color= COLOR(HUE, C(t)) where C(t) is an expression in the parameter t scaled to 0..1.
 

restart:

S1:= x*y+y*z+x*z = 0:
S2:= x+y+z = 5:

E:= eliminate({S1,S2}, z);

[{z = -x-y+5}, {-x^2-x*y-y^2+5*x+5*y}]

#I'll call the 2nd part above the "residual". The only "trick" to
#parameterizing is to make two-variable substitutions for (x,y) into the
#residual that
#can be uniquely solved for one of those two variables. Polar coordinates is a
#standard such trick for circles and ellipses.
Polar:= {x= r*cos(t), y= r*sin(t)}:

R:= solve(eval(E[2], Polar), r);

{r = 0}, {r = 5*(cos(t)+sin(t))/(cos(t)^2+cos(t)*sin(t)+sin(t)^2)}

#We can discard the trivial solution. The final paramterization is

Pt:= combine(eval[recurse]([x,y,z], Polar union E[1] union R[2]));

[5*(cos(2*t)+1+sin(2*t))/(2+sin(2*t)), -5*(-sin(2*t)-1+cos(2*t))/(2+sin(2*t)), -5*sin(2*t)/(2+sin(2*t))]

#Express coloring function in terms of the paramter (t):
C:= eval(x*y*z, [x,y,z]=~ Pt)
:

#We need to put the colors on a 0..1 scale:
(m,M):= (minimize,maximize)(C, t= -Pi..Pi);
C:= (C-m)/(M-m):

-500/27, 0

plots:-tubeplot(
    Pt, t= -Pi..Pi, radius= .2, numpoints= 300,
    color= COLOR(HUE, C),
    style= surface, scaling= constrained
);

 


 

Download ColoredTubeplot.mw

Note that x+y+z is constant 5 on the circle, so that doesn't make a good coloring function.

The radius option to tubeplot refers to the cross-sectional radius of the tube, not the radius of the overall circle.

@Carl Love Even without the wireframe, the use of cylindrical coordinates for the surface eliminates the gap between the upper and lower surfaces, even at modest resolution (I used 53x53 above).

There must be an underlying implementation of Maple supporting this Mobius. To what extent does the Mobius user have access to that? It would be easy to write a quaternion package for Maple. Would you be able to install and access it?

@zphaze I formally reported the bug.

It's not a new feature. Loops have always been that way. 

@ActiveUser All parts of Maple"s looping command that come before the word do are optional and always have been. 

@Scot Gould While it is true that the originally posted worksheet is missing a division operator in the parameters section of its Explore command, this is not the cause of the errors shown,. If you compare your worksheet with the OP's, you'll see that the latter has no boundary markers separating the regions of expository text from the executable code. (These markers can be seen in the extreme left margin of almost any worksheet.) I don't know whether this is the OP's doing, or whether the worksheet got mangled by MapleCloud.

And this is the same plot with the only difference being that I turned off transparency:

Here is the plot done in cylindrical coordinates. By using this, it's possible to get just the radial lines of the grid, plus a border. In my opinion, the syntax makes it much easier to color a grid (aka wireframe) in a plot3d than it is to color a spacecurve. In the plot below, the radial lines are colored by the imaginary part.

restart
:
f:= (r,theta)-> r*cos(theta/2): #Re(sqrt(z))  
Square:= piecewise(
    theta < -3*Pi/4, -sec(theta), #x = -1
    theta < -Pi/4,   -csc(theta), #y = -1
    theta < Pi/4,     sec(theta), #x =  1
    theta < 3*Pi/4,   csc(theta), #y =  1
                     -sec(theta)  #x = -1
):
plots:-display(
    plot3d(
        (common:= 
           [seq([r, theta, k*f(r,theta)], k= [-1,1])], 
           r= 0..Square, theta= -Pi..Pi, coords= cylindrical
        ), 
        grid= [53$2], style= surface, glossiness= 1, 
        transparency= .002,    #close to the min value that does anything
        colorscheme= [         #adaptation of your original coloring:
            "xyzcoloring", 
            [(x,y,z)-> y^2, (x,y,z)-> abs(x*y), (x,y,z)-> x^2]
        ]
    ), 
    plot3d(
        common,
        grid= [2,23],                     #Shows only the radial lines. 
        style= wireframe, thickness= 3, 
        color= abs(r*sin(theta/2))             #abs(Im(sqrt(z)))  
    ),
    lightmodel= light2, orientation= [55,75,0], projection= .85, axes= frame,
    labels= ['x', 'y', Re(w)]
);

First 220 221 222 223 224 225 226 Last Page 222 of 709