Rouben Rostamian

MaplePrimes Activity


These are questions asked by Rouben Rostamian

I have been unable to add a directed light source to my plot3d drawings.  Perhaps I am misreading the documentation.  In the following experiment, I attempt to shine a red light from the direction (phi,theta) but changing the values of phi and theta don't seem to change the scene's lighting.  Can you change the lighting in your Maple?

restart;
with(plottools):
with(plots):
Explore(display(sphere(), style=surface, color=yellow, light=[phi,theta,1,0,0]),
	phi=0..Pi, theta=0..Pi);

 

restart;

q := (u,v) -> u^2 + v^2;

proc (u, v) options operator, arrow; v^2+u^2 end proc

D[3](q);

Error, (in D/procedure) index out of range: function takes only 2 arguments

Question: How does D know that q takes two arguments?

In general, if I pass q to another proc, how can I find out, within
that proc, that q takes only two arguments?

download number-of-arguments.mw

Given a vector-valued function z(u,v), I want to calculate the derivative of z with respect to its first argument by applying the D operator to it. I don't see how.  Any suggestions?

restart;

z := (u,v) -> < a(u,v), b(u,v) >;

proc (u, v) options operator, arrow; `<,>`(a(u, v), b(u, v)) end proc

Calculate the derivative of z with respect to its first argument:

P := diff(z(u,v), u);

Vector(2, {(1) = diff(a(u, v), u), (2) = diff(b(u, v), u)})

Express P through the D operator:

Q := convert(P, D);

Vector(2, {(1) = (D[1](a))(u, v), (2) = (D[1](b))(u, v)})

Question:  How do we obtain Q directly by applying the D operator to z

without the help of diff?  This one doesn't work:

D[1](z)(u,v);
type(%, Vector);

(D[1](`<,>`))(a(u, v), b(u, v))*(D[1](a))(u, v)+(D[2](`<,>`))(a(u, v), b(u, v))*(D[1](b))(u, v)

false

Download diff.mw

restart;

pde := diff(u(x,t),t) + u(x,t)*diff(u(x,t),x) = 0;

diff(u(x, t), t)+u(x, t)*(diff(u(x, t), x)) = 0

These are all wrong:

pdsolve({pde,u(x,0)=f(x)});
pdsolve({pde,u(x,0)=sin(x)});
pdsolve({pde,u(x,0)=erf(x)});

u(x, t) = 0

u(x, t) = 0

u(x, t) = 0

But these ones are correct:

pdsolve({pde,u(x,0)=exp(x)});
pdsolve({pde,u(x,0)=x});

u(x, t) = LambertW(t*exp(x))/t

u(x, t) = x/(t+1)

Download mw.mw

Is there  a specific type name for vectors in Physics[Vectors]?  Specifically, Let's say we want to write a proc whose argument is expected to be a (Physics) Vector, as in  these (trivial) demos:

with(Physics[Vectors]);

f := proc(a_::???)
    return a_ . a_;
end proc:

g := proc(a_::???, b_::???)
    return a_ &x b_;
end proc:

What do we put in place of "???".

1 2 3 4 5 6 7 Last Page 3 of 16