jerbertz

40 Reputation

4 Badges

13 years, 311 days

MaplePrimes Activity


These are questions asked by jerbertz

Before Maple 2015, units were enlosed in [[ double brackets ]] when displaying 2D input and output. In later versions these brackets are displayed only when editing input, and never in output, which in my opinion detracts from readability. Does anybody know if it is possible to revert to the old behaviour?

Is it possible to display each element of a sequence on a new line?

The default behaviour, obviously, is to display each element on the same line separated by commas, and wrapping to a new line as required by screen space. This is somewhat unsightly when the elements of the sequence contain long equations or expressions, and impacts readability because the commas don't stand out as effective separators between elements.

For example:

B := b=2;

C := c=3;

A := B,C;

>A

b=2, c=3

 

Is there a way to display each element on a new line?

For example:

>A

b=2,

c=3

 

Is there another data type or a simple expression that could achieve this effect?

Is there a better way to express the sign of a variable that will eventually hold a numeric value?

Up to this point, I have been using x/abs(x) (i.e. x/abs(x)) to represent the numeric sign of a variable. I can later manipulate, substitute, and evaluate any expression involving x/abs(x) without difficulty. For example:
> eval(x/abs(x), [x = -1]);
 -1

The problem is that it's inconvenient when the numeric value is identically zero:
> eval(x/abs(x), [x = 0]);
 Error, numeric exception: division by zero

Using a floating point zero works fine, but is not always practical:
> eval(x/abs(x), [x = 0.]);
 Float(undefined)

Now, the obvious tool here, sign(x), evaluates without complaint:
> sign(0);
 1

The problem with sign is that I cannot incorporate it into an expression that can be freely used later. For, the following produces an unexpected result:
> eval(sign(x), x = -1);
 1

Constructing the expression using layers of quotes don't help:
> expr := 200*' 'sign(x)' ';
 200 'sign(x)'

Simple uses of eval work fine:
> expr;
 200 sign(x)

> eval(expr, [x = -1]);
 -200

However, substitution with that expression using subs or eval doesn't produce the expected result:
> eval(a*b, [a = expr]);
 200 sign(x) b
> eval(%, [x = -1]);
 200 b

This also doesn't produce the expected result:
> subs(a = expr, a*b);
 200 sign(x) b
> eval(%, [x = -1]);
 200 b

I realize that this question might collapse into "How do I prevent a function from evaluating prematurely? " but cannot find any search terms that yield useful results.

sign_of_a_thing.mw

I would like to set an axis to logarithmic scale, after having loaded the Units[Standard] package.

The command is:

plot3d( function(input), x=-1..1, y=1..1, axis[3]=[mode = log] )

Confoundingly, the error is:

Error, (in plot3d) expecting option mode to be of type identical(linear, log)
 but received Units:-Standard:-log

So the problem is that with(Units[Standard]) hijacks all occurences of log and replaces them with...

Page 1 of 1