Rouben Rostamian

MaplePrimes Activity


These are questions asked by Rouben Rostamian

While solving an exercise in class, I ran into the following interesting solution of a transcendental equation.  It was not intentionally designed to be like this.

restart;
eq := 2*exp(-2*t) + 4*t = 127:
fsolve(eq, t=0..infinity);
                         31.75000000

The solution looks like a rational number while it was expected to be transcendental.  Let's increase the number of digits:

Digits := 20:
fsolve(eq, t=0..infinity);
Digits := 10:
                     31.750000000000000000

Let's make it even more accurate:

Digits := 29:
fsolve(eq, t=0..infinity);
Digits := 10:
                 31.750000000000000000000000000

And even more:

Digits := 40:
fsolve(eq, t=0..infinity);
Digits := 10:
           31.74999999999999999999999999986778814353

Is there a deep reason why the solution is so close to being a rational or is it just a coincidence?

 

I may be misunderstanding the documentation of implicitplot.  Can someone set me straight?

This is extracted from the implicitplot's help page:

implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. x);

The plotting range is limited to y ≤ x, as intended.  Let us verify that it does the right thing:

display(
	implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. x, color=red),
	plot(x, x=0..2, color=blue)
);

Yes, indeed it does.

Now let us try limiting the plotting range to y ≤ 1 − x2. Here is what we get:

display(
	implicitplot(-x^2 + y, x = 0 .. 2, y = 0 .. 1-x^2, color=red),
	plot(1-x^2, x=0..2, color=blue)
);

I expected the red curve to lie entirely below the blue curve but it doesn't. Am I misunderstanding implicitplot?

Download worksheet: mw.mw

I need to calculate dozens of piecewise-defined  (but elementary) definite integrals of the following kind. Maple returns them unevaluated. Is there a trick to force evaluation? 

restart;
u := piecewise(0 <= x and 0 <= y and y <= x, x-1, 0 <= x and 0 <= y and x <= y, x, 0);
v := piecewise(0 <= x and 0 <= y and y <= x, x-1, y <= 0 and 0 <= x and -x <= y, x-1, 0);
plot3d(u*v, x=-1..1, y=-1..1);
# integrating over (0,1)x(0,1) works
int(u*v, x=0..1, y=0..1);
# but integrating over (-1,1)x(-1,1) returns unevaluated.
# How to force evaluation on (-1,1)x(-1,1)?
int(u*v, x=-1..1, y=-1..1);

integration-problem.mw

 

I want to plot a 2D graph without labels. The labes=["",""] option does half of the job—it prints the empty string for labels (that's good) but it reserves room for them (that's bad).  In the following code I use a large size labelfont in order to exaggerate the effect:

restart;
plots:-setoptions(labelfont=[TIMES,64]);  # large labelfont selected on purpose
p1 := plot([[0,0],[1,1]], labels=["", ""]);

Note the large blank space at the bottom reserved for the the non-existent label.

I know one way to eliminate the label altogether:

p2 := subs(AXESLABELS=NULL, p1);

This does the right job but is there a more orthodox way of doing that?

Afterthought:  It would be good if the labels option to the plot command  accepted none as argument, as in labels=[none, none].

Vector calculus is very nicely handled in Maple's Physics package:

with(Physics[Vectors]):

The gradient of a scalar field in Cartesian coordinates

Gradient(f(x,y,z));

(diff(f(x, y, z), x))*_i+(diff(f(x, y, z), y))*_j+(diff(f(x, y, z), z))*_k

The gradient of a scalar field in cylindrical coordinates

Gradient(f(rho,phi,z));

(diff(f(rho, phi, z), rho))*_rho+(diff(f(rho, phi, z), phi))*_phi/rho+(diff(f(rho, phi, z), z))*_k

But the gradient of a vector field is not available:

Gradient(_rho*f(rho,phi,z) + _phi*g(rho,phi,z) + _k*h(rho,phi,z));

Error, (in Physics:-Vectors:-Nabla) Physics:-Vectors:-Gradient expected a scalar function, but received the vector function: _rho*f(rho, phi, z)+_phi*g(rho, phi, z)+_k*h(rho, phi, z)

I suppose this is because the gradient of a vector field needs to be
expressed in terms a basis consisting of the dyadic products  of the basis vectors

as in _i  _j, _rho_phi, etc., which does not seem to be implemented.

 

That said, it is quite possible that this is already done and I have missed it in
the documentation since the Physics package is so huge.  But if it's truly not there,
it would be a very useful feature to add.  Calculating gradients of vector fields

is central to continuum mechanics (including elasticity and fluid mechanics).

They are easy to represent in Cartesian coordinates but their calculation in the

frequently needed cylindrical and spherical coordinates are nontrivial and can use

Maple's help.

 

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