Doug Meade

 

Doug

---------------------------------------------------------------------
Douglas B. Meade <><
Math, USC, Columbia, SC 29208 E-mail: mailto:meade@math.sc.edu
Phone: (803) 777-6183 URL: http://www.math.sc.edu

MaplePrimes Activity


These are replies submitted by Doug Meade

There is nothing wrong with Maple's response.  You have given 3 parameterizations of the same surface. Just using different names does not make the surface different. To see that you are really seeing all three surfaces, change the styles and colors used to prepare the three separate plots:

p1 := plot3d([x, y, sqrt(1-y^2)], x = -1 .. 1, y = -sqrt(1-x^2) .. sqrt(1-x^2), style=point, symbol=cross, color=red);
p2 := plot3d([z, x, sqrt(1-x^2)], z = -1 .. 1, x = -sqrt(1-z^2) .. sqrt(1-z^2), style=point, symbol=sphere, symbolsize=16, color=blue, transparency=0.5);
p3 := plot3d([y, z, sqrt(1-z^2)], y = -1 .. 1, z = -sqrt(1-y^2) .. sqrt(1-y^2), color=green, transparency=0.5);
plots:-display([p1, p2, p3], axes = boxed);

To obtain three sides of the complete Steinmetz surface, try:

p1 := plot3d([x, y, sqrt(1-y^2)], x = -1 .. 1, y = -sqrt(1-x^2) .. sqrt(1-x^2));
p2 := plot3d([x, sqrt(1-x^2), z], z = -1 .. 1, x = -sqrt(1-z^2) .. sqrt(1-z^2));
p3 := plot3d([sqrt(1-z^2), y, z], y = -1 .. 1, z = -sqrt(1-y^2) .. sqrt(1-y^2));
plots:-display([p1, p2, p3], axes = boxed);

I hope this explains what you were seeing.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

Personally, I just copy the input and output directly into MaplePrimes. I'm using worksheets in the Standard interface, with 1D input. The only editing I do in MaplePrimes is to change the format from Normal to Formatted. Note that this does not work for graphics, and you don't see the fancy typesetting, but you do get code that can be copied back into Maple. One benefit of this approach is that it minimizes the number of errors that would creep into my posts if I didn't pull the input (and output) directly from Maple.

For plots, I export the plot to a JPG file and upload the image to MaplePrimes. This is not too difficult, but I would include more plots in my posts if it were easier.

Matrices and vectors are still a problem as all you get is a placeholder, not the real contents of the object.

In the end, each of us has a different style. It works for us, largely because we have grown accustomed to this mode of use.

If you have more questions about this, maybe it would help if you could share your work as a worksheet and let some of us format it in different ways.

Good luck, and keep asking questions.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
 

Personally, I just copy the input and output directly into MaplePrimes. I'm using worksheets in the Standard interface, with 1D input. The only editing I do in MaplePrimes is to change the format from Normal to Formatted. Note that this does not work for graphics, and you don't see the fancy typesetting, but you do get code that can be copied back into Maple. One benefit of this approach is that it minimizes the number of errors that would creep into my posts if I didn't pull the input (and output) directly from Maple.

For plots, I export the plot to a JPG file and upload the image to MaplePrimes. This is not too difficult, but I would include more plots in my posts if it were easier.

Matrices and vectors are still a problem as all you get is a placeholder, not the real contents of the object.

In the end, each of us has a different style. It works for us, largely because we have grown accustomed to this mode of use.

If you have more questions about this, maybe it would help if you could share your work as a worksheet and let some of us format it in different ways.

Good luck, and keep asking questions.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
 

This is not what the OP requested. Your example should have been written as:

L := [$1..12]:
[seq( L[i..i+1], i=1..nops(L)-1 )];
 [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12]]

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

This is not what the OP requested. Your example should have been written as:

L := [$1..12]:
[seq( L[i..i+1], i=1..nops(L)-1 )];
 [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7], [7, 8], [8, 9], [9, 10], [10, 11], [11, 12]]

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

This looks nice, but is essentially the same as what you would get using the view= option:

plot3d( -z*(1/(x^2+z^2)^(3/2)-1), x=-0.3..0.3, z=-0.3..0.3, view=[DEFAULT,DEFAULT,-1000..1000],
        numpoints=50^2,axes=boxed,lightmodel=light2,orientation=[27, 54]);

To be honest, I prefer to have holes where the function is larger than 1000 or smaller than -1000.

Converting Axel's plot3d command into the comparable contourplot is better than the earlier results from contourplot:

contourplot( max(min(-z*(1/(x^2+z^2)^(3/2)-1), 1000),-1000), x=-0.3..0.3, z=-0.3..0.3,
             numpoints=50^2,axes=boxed);

This is a nice trick. Thanks, Axel.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

This looks nice, but is essentially the same as what you would get using the view= option:

plot3d( -z*(1/(x^2+z^2)^(3/2)-1), x=-0.3..0.3, z=-0.3..0.3, view=[DEFAULT,DEFAULT,-1000..1000],
        numpoints=50^2,axes=boxed,lightmodel=light2,orientation=[27, 54]);

To be honest, I prefer to have holes where the function is larger than 1000 or smaller than -1000.

Converting Axel's plot3d command into the comparable contourplot is better than the earlier results from contourplot:

contourplot( max(min(-z*(1/(x^2+z^2)^(3/2)-1), 1000),-1000), x=-0.3..0.3, z=-0.3..0.3,
             numpoints=50^2,axes=boxed);

This is a nice trick. Thanks, Axel.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

Not a problem.

I could have avoided this by including the pictures in my original response. If only inserting a figure in a MaplePrimes post were as easy as copy and paste.

The process of uploading an image and including it in a post is not that difficult, but it's something that generally needs to be done from a separate browser window - or else the partially composed message is lost. A solution (workaround?) to this might be as simple as having the "My Files" link automatically open in a new tab or window.

This brings up another point. This post should really be cross-linked to the discussion of desirable new features in an updated MaplePrimes. It would be nice if I could indicate an additional parent (a step-parent?) in the hierarchy of posts that is MaplePrimes. In other words, allow MaplePrimes to evolve from a tree to a web.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

Not a problem.

I could have avoided this by including the pictures in my original response. If only inserting a figure in a MaplePrimes post were as easy as copy and paste.

The process of uploading an image and including it in a post is not that difficult, but it's something that generally needs to be done from a separate browser window - or else the partially composed message is lost. A solution (workaround?) to this might be as simple as having the "My Files" link automatically open in a new tab or window.

This brings up another point. This post should really be cross-linked to the discussion of desirable new features in an updated MaplePrimes. It would be nice if I could indicate an additional parent (a step-parent?) in the hierarchy of posts that is MaplePrimes. In other words, allow MaplePrimes to evolve from a tree to a web.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

The plot you attribute to my code is obtained with the command:

contourplot( f, x=-0.5..0.5, z=-0.5..0.5, grid=[50,50], contours=10, numpoints=100, axes=boxed );

I included this in my posting as a reference point. The approach I suggested was to use the command:

contourplot3d(f, x=-3..3, z=-3..3, grid=[50,50], contours=[$-10..10], numpoints=100,
                 axes=boxed, orientation=[-90,0]);

This is reasonably close to the plot obtained with implicitplot3d. The latter plot appears smaller because it's actually a 3D plot. Here's a view of the above plot that shows some of the 3d structure of the surface.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

The plot you attribute to my code is obtained with the command:

contourplot( f, x=-0.5..0.5, z=-0.5..0.5, grid=[50,50], contours=10, numpoints=100, axes=boxed );

I included this in my posting as a reference point. The approach I suggested was to use the command:

contourplot3d(f, x=-3..3, z=-3..3, grid=[50,50], contours=[$-10..10], numpoints=100,
                 axes=boxed, orientation=[-90,0]);

This is reasonably close to the plot obtained with implicitplot3d. The latter plot appears smaller because it's actually a 3D plot. Here's a view of the above plot that shows some of the 3d structure of the surface.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

I have not followed this thread too closely, but I think it might be appropriate to suggest that the distinction between add and sum (and Sum) be revisited, again. (see ?sum and ?add)

From the help for sum:

sum - definite and indefinite symbolic summation

Note
To add a finite sequence of values, rather than compute a formula, use the add command.  For example, add(k, k=0..9) returns 45.  Although the sum command can often be used to compute explicit sums, it is strongly recommended that the add command be used in programs if an explicit sum is needed, in particular, when summing over all elements of a list, Array, Matrix, or similar data structure.
 

From the hellp for add:

add - add up a sequence of values
 

The add command is used to add up an explicit sequence of values. The mul command computes a product of an explicit sequence of values. A typical call to the add command is add(f(i), i=1..n). This computes
                          f(1) + f(2) + ... + f(n)
. More generally, add(f(i), i=m..n) computes
                        f(m) + f(m + 1) + ... + f(n)
. Similarly, mul(f(i), i=m..n) computes
                           f(m) f(m + 1) ... f(n)
 

You should also consult the help for ?evalf,Sum .

Even though most mathematicians and scientists (not to mention students) do not naturally see a distinction between these three cases, they are not simple issues computationally.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

If you want to see the curves on which the potential is constant, just insert "style=patchcontour" into the plot3d command. If you want more control over the number of contours shown, also add "contours=<number>" (the default is 10). Or, you can give the specific list of level curves with "countours=[ Here is the specific paragraph from ?plot3d,option about contours:

contours = n
This option specifies the number of contours or a list of contour values, where n is a positive integer or a list of contour values. The default value is  10.

If you want to see only the contours, use "style=contour" instead of patchcontour. Again, see ?plot3d,option

I hope you are converging on the plot that you seek.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

If you want to see the curves on which the potential is constant, just insert "style=patchcontour" into the plot3d command. If you want more control over the number of contours shown, also add "contours=<number>" (the default is 10). Or, you can give the specific list of level curves with "countours=[ Here is the specific paragraph from ?plot3d,option about contours:

contours = n
This option specifies the number of contours or a list of contour values, where n is a positive integer or a list of contour values. The default value is  10.

If you want to see only the contours, use "style=contour" instead of patchcontour. Again, see ?plot3d,option

I hope you are converging on the plot that you seek.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu

Get what curve?

My example does plot the two vertical lines through the points found by fsolve.

I did this by giving a parametric representation of the lines ( x=x0, y=y0, z=t for -infinity < t < infinity ).

They should show up as thick red lines in the plot (but they looked more like discrete point when I plotted them).

Is this not what you wanted?

Might you want the line segment in the x-y plane that joins the two points found by fsolve? If so, let us know. There are several ways this can be found, including with pointplot3d, as follows:

q:=2*10^(-7)*8.99*10^9;
v:=q/sqrt((x-a)^2+(y-b)^2);

g:=-diff(v,x);

charges:=subs(a=-1/2,b=0,v)+subs(a=1/2,b=0,v)-subs(a=0,b=3/4,v);

P1 := plot3d(charges,x=-3..3,y=-4..4,view=-1e4..1e4);

xg:=-diff(charges,x);
yg:=-diff(charges,y);
fsolve({xg=0,yg=0},{x,y},{x=-1..1},{y=-1..0});
L1 := eval( [x,y,t], % );
p1 := eval( [x,y,0], %% );

fsolve({xg=0,yg=0},{x,y},{x=-1..1},{y=0..4});
L2 := eval( [x,y,t], % );
p2 := eval( [x,y,0], %% );

P3 := pointplot3d( [p1,p2], style=line, color=green, thickness=3 ):
P2 := map( spacecurve, [L1,L2], t=-1e4..1e4, thickness=4, color=red )[]:
display( [P1,P2,P3], axes=boxed, view=[-3..3,-4..4,-1e4..1e4] );

You might need to rotate the plot a little to be able to see the green line in the x-y plane. Part is above the potential surface and part is below.

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu
Phone:  (803) 777-6183         URL:    http://www.math.sc.edu
First 15 16 17 18 19 20 21 Last Page 17 of 76