lt

80 Reputation

6 Badges

10 years, 96 days

MaplePrimes Activity


These are questions asked by lt

Take a 3d plot of some uneven surface in the xyz space and you want to have the surface colored according to local z-coordinates (e.g. a valley is blue, a peak is red with all rainbow colors inbetween). For such a color-coding one can in principal select the plot option "Color->Z (Hue)". What do you do if the valley and the peak are still more or less green colored? How can you force the valley and peak to have different colors?

I have this surface which I display with the following commands:

     Belt:=plots[surfdata](Surface,color=C,labels=["x","y","z"]):

     display({...,Belt});

It all works, and the surface has nice default rainbow colors, but when I choose Color->Z (Hue) everything turns to green. Also when I manually write in the first of the above lines "color=["Blue","Red"]" the surface turns all red. The ranges of the x and y axis are larger than the z axis by a factor of about 50. Might this be the problem? How can I adjust the color ranges for my small z axis?

How would you insert a label-coordinate in this command:

textplot3d([subs(E[11]=0,x[11]),subs(E[11]=0,y[11]),subs(E[11]=0,z[11]),"Planet"]):

 

 

What is the command for filling the space between two circular spacecurves? Something like a Saturnian ring?

I am trying to alter the Virtual Solar system Maple worksheet of Yi Xie in the way that I added several objects to the eight planets and Pluto (e.g. Hale-Bopp, Sedna, 2012 VP113 etc.) and would like to adjust the array such that when zooming out and the obrit and labels overlap so that it's unreadable anymore (orbits and labels) that I can switch on and off (respectively display/not display) specific parts, e.g. the inner solar system. In the original file a single array was created from 1..18 (including 9 orbital entries and 9 label entries). What I did is to create arrays for each part of the Solar system, e.g. Inner for the planets+Pluto 1..18, an array for Hale-Bopp with an orbital entry and a label entry, so [1,2], and an array with 6 entries for 3 additional objects like Sedna, Planet X and 2012 VP113. As well as the sun, which only has a single entry as there are no orbital elements necessary and one just makes a 3dplot (I did not label it, so just one entry). All arrays are converted into lists in the end and displayed. Here is the code:

 

> with(linalg);

> with(plots);

> with(plottools);

> P1 := matrix([[cos(omega[j]), -sin(omega[j]), 0], [sin(omega[j]), cos(omega[j]), 0], [0, 0, 1]]); P2 := matrix([[1, 0, 0], [0, cos(i[j]), -sin(i[j])], [0, sin(i[j]), cos(i[j])]]); P3 := matrix([[cos(Omega[j]), -sin(Omega[j]), 0], [sin(Omega[j]), cos(Omega[j]), 0], [0, 0, 1]]);

> A:=matrix([[a[j]*(cos(E[j])-e[j])],[a[j]*sqrt(1-e[j]^2)*sin(E[j])],[0]]);

> R:=multiply(P3,P2,P1);

> B:=multiply(R,A);

> a := [.38709893, .72333199, 1.00000011, 1.52366231, 5.20336301, 9.53707032, 19.19126393, 30.06896348, 39.48168677, 1/0.5454e-2, 268.2509283, 532.7838156, 300];

> e := [.20563069, 0.677323e-2, 0.1671022e-1, 0.9341233e-1, 0.4839266e-1, 0.5415060e-1, 0.4716771e-1, 0.858587e-2, .24880766, .994920, .7005635, .8570973, .1];

> i := [7.00487, 3.39471, 0.5e-4, 1.85061, 1.30530, 2.48446, .76986, 1.76917, 17.14175, 89.5328, 24.01830, 11.92859, 10];

> Omega := [48.33167, 76.68069, -11.26064, 49.57854, 100.55615, 113.71504, 74.22988, 131.72169, 110.30347, 282.1476, 90.88303, 144.53190, 45];

> omega := [77.45645, 131.53298, 102.94719, 336.04084, 14.75385, 92.43194, 170.96424, 44.97135, 224.06676, 130.8038, 293.03200, 311.18311, 150];

> i := map(x→ convert(x, units, deg, rad) end proc, i);

> Omega := map(x→ convert(x, units, deg, rad) end proc, Omega);

> omega := map(x→ convert(x, units, deg, rad) end proc, omega);

> for j to 13 do omega[j] := arcsin(sin(omega[j]-Omega[j])/sin(arccos(sin(i[j])*cos(omega[j]-Omega[j])))) end do;

> x := array(1 .. 13);

> y := array(1 .. 13);

> z := array(1 .. 13);

> for j to 13 do x[j] := B[1, 1]; y[j] := B[2, 1]; z[j] := B[3, 1] end do;

> Sun := array([1]);

> Inner := array(1 .. 18); for j to 9 do Colors := [black, green, blue, red, black, yellow, green, violet, brown, aquamarine, black, black, red]; Linestyle := [solid, solid, solid, solid, solid, solid, solid, solid, solid, longdash, solid, solid, longdash]; Inner[j] := spacecurve([subs(E[j] = E, x[j]), subs(E[j] = E, y[j]), subs(E[j] = E, z[j])], E = 0 .. 2*Pi, color = Colors[j], linestyle = Linestyle[j]) end do;

> Comet := array([1, 2]); if j = 10 then Colors := [aquamarine]; Linestyle := [longdash]; Comet[1] := spacecurve([subs(E[j] = E, x[j]), subs(E[j] = E, y[j]), subs(E[j] = E, z[j])], E = 0 .. 2*Pi, color = Colors[j], linestyle = Linestyle[j]) end if;

> Oort := array(1 .. 6); for j from 11 to 13 do Colors := [black, black, red]; Linestyle := [solid, solid, longdash]; Inner[j] := spacecurve([subs(E[j] = E, x[j]), subs(E[j] = E, y[j]), subs(E[j] = E, z[j])], E = 0 .. 2*Pi, color = Colors[j], linestyle = Linestyle[j]) end do;

> Sun[1] := plot3d(0.1e-1, 0 .. 2*Pi, 0 .. Pi, style = PATCHNOGRID, coords = spherical, color = red);

> Inner[10] := textplot3d([subs(E[1] = 0, x[1]), subs(E[1] = 0, y[1]), subs(E[1] = 0, z[1]), "Mercury"]); Inner[11] := textplot3d([subs(E[2] = 0, x[2]), subs(E[2] = 0, y[2]), subs(E[2] = 0, z[2]), "Venus"]); Inner[12] := textplot3d([subs(E[3] = 0, x[3]), subs(E[3] = 0, y[3]), subs(E[3] = 0, z[3]), "Earth"]); Inner[13] := textplot3d([subs(E[4] = 0, x[4]), subs(E[4] = 0, y[4]), subs(E[4] = 0, z[4]), "Mars"]); Inner[14] := textplot3d([subs(E[5] = 0, x[5]), subs(E[5] = 0, y[5]), subs(E[5] = 0, z[5]), "Jupiter"]); Inner[15] := textplot3d([subs(E[6] = 0, x[6]), subs(E[6] = 0, y[6]), subs(E[6] = 0, z[6]), "Saturn"]); Inner[16] := textplot3d([subs(E[7] = 0, x[7]), subs(E[7] = 0, y[7]), subs(E[7] = 0, z[7]), "Uranus"]); Inner[17] := textplot3d([subs(E[8] = 0, x[8]), subs(E[8] = 0, y[8]), subs(E[8] = 0, z[8]), "Neptune"]); Inner[18] := textplot3d([subs(E[9] = 0, x[9]), subs(E[9] = 0, y[9]), subs(E[9] = 0, z[9]), "Pluto"]); Comet[2] := textplot3d([subs(E[10] = 0, x[10]), subs(E[10] = 0, y[10]), subs(E[10] = 0, z[10]), Hale-Bopp]); Oort[4] := textplot3d([subs(E[11] = 0, x[11]), subs(E[11] = 0, y[11]), subs(E[11] = 0, z[11]), "2012 VP113"]); Oort[5] := textplot3d([subs(E[12] = 0, x[12]), subs(E[12] = 0, y[12]), subs(E[12] = 0, z[12]), "Sedna"]); Oort[6] := textplot3d([subs(E[13] = 0, x[13]), subs(E[13] = 0, y[13]), subs(E[13] = 0, z[13]), "Planet X ?", color = red]);

> Sun1 := convert(Sun, 'list');
> Inner1 := convert(Inner, 'list');
> Comet1 := convert(Comet, 'list');
> Oort1 := convert(Oort, 'list');
> display(Sun1, Inner1, Comet1, Oort1, scaling = CONSTRAINED);

 

The first error message appears after the if-condition. Can you tell me where I am making a mistake? Beware: when copy paste the code from Maple to Word and from Word in here the colons at the end of lines have changed into semi-colons. Hope this is no problem in executing the code despite the lines being in the same ">..." e.g. where the labels are defined.

I can't directly copy Maple code into messages but have to insert into Word first, apply some changes that for better readability and copy it from there via Word-paste. Is there a direct way?

1 2 3 4 5 Page 3 of 5