Rouben Rostamian

MaplePrimes Activity


These are questions asked by Rouben Rostamian

This is from the documentation of ?plot3d,light:

 

light=[phi, theta, r, g, b]

    This option adds [my emphasis] a directed light source

    from the direction phi, theta in spherical coordinates.

 

The "adds" in that sentence seems to imply that

multiple light sources are possible, but it does not seem

to work that way.  Each subsequent light option overrides

the previous one as we see in the following illustration

where we render a ball three times by illuminating it

(a) from the north, (b) from the south, and (c) from

both the north and south.  In (c) Maple accounts for only

the south light.

restart;

with(plots): with(plottools):

ball := sphere(1, style=surface, color=gold):

display(<
    display(ball,light=[0,0,1,1,1])   |
    display(ball,light=[180,0,1,1,1]) |
    display(ball,light=[0,0,1,1,1], light=[180,0,1,1,1])
 >);

 

Download light.mw

 

In the worksheet below I produce a sequence of frames for an animation by distributing the task into several threads.  The result has strange artifacts as we see in the sample.  The artifacts vary randomly from run to run.  Am I doing something wrong?

restart;

kernelopts(version);

`Maple 2018.2, X86 64 LINUX, Oct 23 2018, Build ID 1356656`

kernelopts(numcpus);

4

Draw a simple picture:

frame := proc(t)
  plot(x^2 + t, x=-1..1, title=typeset("t = %1", t));
end proc:

Generate a sequence of pictures:

frames := Threads:-Seq(frame(t), t=0..1, 0.05):

Animate the sequence:

plots:-display([frames], insequence);

Download theads.mw

I don't quite understand the behavior of PDEtools[declare].  My reading of the documentation is that PDEtools[declare](y(t)) tells Maple that y is a function of t, and therefore y(t) is displayed as y and the derivative of y is displayed as yt.  I did not expect other variables to be similarly affected but apparently they are.  For instance, in the worksheet below, why is the derivative of p displayed as ps?

restart;

The normal display of derivatives:

diff(y(t),t);
diff(p(s),s);

diff(y(t), t)

diff(p(s), s)

Declare y as a function of t:

PDEtools[declare](y(t));

` y`(t)*`will now be displayed as`*y

diff(y(t),t);    # this is displayed in subscript notation, as expected
diff(p(s),s);    # why is this displayed in subscript notation?

diff(y(t), t)

diff(p(s), s)

 

Download mw.mw

I an unable to get a numerical result out of this triple integral.  Maple runs forever.  I stopped it after about half an hour:

Int(exp(-a^2-b^2-c^2),
    a=b^2/(4*c)..infinity, b=-infinity..infinity, c=0..infinity);
value(%);
evalf(%);

Is there a trick to make it work?

In the calculation below, A and B both simplify to 1.  Why doesn't A*B simplify to 1?  Tested on Maple 2017 and 2018.

restart;

A := (1 - cos(s)^2)/sin(s)^2;

(1-cos(s)^2)/sin(s)^2

B := (1 - cos(t)^2)/sin(t)^2;

(1-cos(t)^2)/sin(t)^2

simplify(A);
simplify(B);

1

1

Why doesn't this simplify to 1?

simplify(A*B);

((cos(t)^2-1)*cos(s)^2-cos(t)^2+1)/(sin(s)^2*sin(t)^2)

First 6 7 8 9 10 11 12 Page 8 of 14