90 Reputation

5 Badges

5 years, 209 days

MaplePrimes Activity

These are replies submitted by anton_dys


Thanks a lot for you suggestions and clarification. They are reallly helpful, as always. :)

@Christopher2222 Yes that's what I was looking for. And the funny thing is that it was me who asked that question 3 years ago, but I've just forgotten about it. Thank you for reminding! :)


@Christopher2222 Yes, and I wonder why did they remove this functionality. Is there a better way to produce the first of the two images in Maple 2017/2018?

@tomleslie, @vv@Kitonum Many thanks for your help! As always :)

@acer Thanks for your comments. Yes, I can definitely obtain cartesian coordinate display of the arrows while using spherical coordinate representation for the vector-field just as you have shown. It is basically what I want. But I also need to plot the field in spherical coordinates. And the problem is that different definitions of spherical coordinates are used for these two things. I have to define my fields differently, therefore, either for cartesian or for spherical plotting. This is messy and inconvinient.

The approach suggested by @tomleslie based on Addcoordinates and MapToBasis allows me to work around this inconvinience by defining my own coordinates and sticking to them throughout all computations and visualizations. So the problem seems to be solved for me.

However different outputs of:


PlotVector(VectorField(<0, 1, 0>, spherical[r, phi, theta]), r = 0 .. 1, phi = 0 .. 2*Pi, theta = 0 .. Pi, grid = [5, 15, 5], color = black)


VectorField(<0, 1, 0>, spherical[r, phi, theta], output = plot, fieldoptions = [grid = [8, 8, 3]], color = black)

do look like a bug that needs to be taken care of by the developers.. 





@tomleslie Your thoughts on MapToBasis sound encouraging to me.. And thanks for sharing your experience with code writing. I removed my question about indentation because after a good deal of searching MaplePrimes, Maple documentation and just googling I finally figured out that if you switch to 1D input and toggle that tab switch button in the upper toolbar you can use the tabkey for indentation after shift-enter..


@tomleslie That's exactly the simple way I was looking for! It is so obvious now that I wonder how come it did not occur to me before? Thank you, Tomleslie. Yes, I want to perform calculations with fields in spherical coordinates but to visualize them with uniform spacing in cartesian coordinates.This way they look much better.

I only hope that it would not be too difficult (won't take too much time) for MapToBasis to convert complicated superpositions of vector spherical harmonics to cartesian coordinates before plotting the results.. 

@tomleslie I want simply something like this:

instead of something like this:

@rlopez Even more seriously, this inconsistency is present even within Student[VectorCalculus] package:


PlotVector(VectorField(<0, 1, 0>, spherical[r, phi, theta]), r = 0 .. 1, phi = 0 .. 2*Pi, theta = 0 .. Pi, grid = [5, 15, 5], color = black) produces:

While the same field with

VectorField(<0, 1, 0>, spherical[r, phi, theta], output = plot, fieldoptions = [grid = [8, 8, 3]], color = black) is:

Which begins to look like a bug..

@rlopez I understand that the problem is not in the names, but in the positions of angle variables. They are of cause a matter of choice and any of the two choices is no better/worse than the other one. The problem that leads to confusion, however, is that this choice is made differently in different parts of Maple:

in Student[VectorCalculus]  and VectorCalculus packages the second argument is the angle down from the z-axis and the third is the angle around the z-axis,

but in plot3d, fieldplot3d, coordplot3d, etc. it is the other way round. Here is, for example, the output of 

coordplot3d(spherical, [0 .. .8, 0 .. 2*Pi, 0 .. Pi], [[.5], [0], [(1/2)*Pi]], axes = normal, view = [-2 .. 2, -2 .. 2, -2 .. 2])

from which one can see that the second angle is around the z-axis and ranges from 0 to 2pi. This would not bother me, however, if I could find a simple way to produce a uniform 3D distribution of arrows for a field in spherical coordinates without Student[VectorCalculus], but it does not seem to exist..

@tomleslie Thank you for your suggestion! This may come in handy if one wishes to use spherical coordinates both with VectorCalculus and with other Maple commands in a consistent fashion. But VectorCalculus does not seem to have that capability to draw a uniform distribution of arrows for a field defined in spherical coordinates. This is what Student[VectorCalculus] has but it has no AddCoordinates command. What a shame..

@acer@Carl Love Thanks a lot! Although it all has gone far beyond my modest comprehension, I can see that there are lots of ways to achieve what I asked for :))) 


That's really cool and there's no way I could figure out it myself, Thank you, Acer! :)

@vv Thanks again, these are usful examples but it's not quite what I meant. 

I meant something like this: 

c := ph+th/16:
plot3d(1, th=0..2*Pi, ph=0..Pi, coords=spherical, color=[c,colorscheme=[black, red, yellow, white]])

 I does not work this way however. But nevermind, your first suggestion does work well enough. Thanks for help! :) 


How simple! Many thanks for this. I should have figured out it myself..

If you could also suggest how to marry this appoach with the 'colorscheme' option I would be perfectly happy :)

What I mean is that although I can use a hue value or color coordinates in RGB space but being able to specify a custom colorscheme (like a thermal one: [black, red, yellow, white] ) would  work much better for me. I tried to experiment with "colorscheme = .." but to no avail.

1 2 Page 1 of 2