## 7501 Reputation

17 years, 99 days

## How to suppress axes labels...

Maple 2021

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].

## Gradient of a vector field and the Physi...

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

 > with(Physics[Vectors]):

The gradient of a scalar field in Cartesian coordinates

The gradient of a scalar field in cylindrical coordinates

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   , , 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.

## A small bug in pdsolve...

Maple 2020

Here is a division-by-zero bug in a solution produced by pdsolve.  Admittedly, this sort of problem can be difficult to avoid in a CAS, but here it is, in case there is a chance to get it fixed somehow.

 > restart;
 > kernelopts(version);

 > pde := diff(u(x,y,t),t,t) = diff(u(x,y,t),x,x) + diff(u(x,y,t),y,y);

 > bc := u(x,0,t)=0, u(x,1,t)=0, u(0,y,t)=0, u(1,y,t)=0;

 > ic := u(x,y,0) = x*y*sin(Pi*x)*sin(Pi*y),  D[3](u)(x,y,0)=0;

 > pdsol := pdsolve({pde, bc, ic});

 > eval(pdsol, infinity=4); value(%);

Error, (in SumTools:-DefiniteSum:-ClosedForm) summand is singular in the interval of summation

## Applying fsolve to unknowns of type x(0)...

Maple 2020

 > restart;
 > kernelopts(version);

This one works as expected:

 > solve({x + y = 5, x - y = 3});

This one fails:

 > solve({x(0) + y(0) = 5, x(0) - y(0) = 3});

That shouldn't fail.  According to ?solve,details, under the Description

heading, it says that the unknown may be a name or a function.  Note that

 > type(x(0), function);

so there seems to be a contradiction.  Nevertheless, there is a workaround:

 > solve({x(0) + y(0) = 5, x(0) - y(0) = 3}, {x(0), y(0)});

 >

Now try with fsolve().  This one works as expected:

 > fsolve({x + y = 5, x - y = 3});

This one fails:

 > fsolve({x(0) + y(0) = 5, x(0) - y(0) = 3});

But the previous workaround does not help:

 > fsolve({x(0) + y(0) = 5, x(0) - y(0) = 3}, {x(0), y(0)});

I can temporarily rename the variables to plain symbols, or perhaps

freeze/thaw them.  But is there a simpler workaround?

## A gamma puzzle awaiting an explanation...

Maple 2020

Maple's gamma constant appears to misbehave.

 > restart;
 > kernelopts(version);

 > evalf(gamma);     # this one is expected

 > evalf(gamma(0));  # this one may be explained

 > evalf(gamma(1));  # how to explain this one?

Things get more puzzling.  Let's declare gamma as local:

 > local gamma:
 > evalf(gamma);     # this is good

 > evalf(gamma(0));  # expected an unevaluated  here!

 > evalf(gamma(1));  # expected an unevaluated  here!