C_R

3212 Reputation

21 Badges

5 years, 213 days

MaplePrimes Activity


These are questions asked by C_R

In the below I would like to format the odes as they appear in the second and third ode (in green brackets).

I.e. making the first operand with the minus sign inside the parentheses the second one. I was hoping for simplify,size but that does not do the trick.

How to do this?

Format_odes.mw

Occasionally I want to convert 2D-Math input to 1D-Math input. This is either not fully working with comments or changes the format. Example:

Try converting the input below to Maple 1D-Math (select -> right click -> 2D-Math -> convert to -> 1D-Math)

statement

statement

(1)

The*comment*dissapears:

statement;

 

statement

(2)

The Maple Input at the top can be converted by selecting the style C Maple Input from the edit tab but the font changes not to the default font for 1D Math-Input;

statement

statement

(3)

The above is in italic and not in bold. However the default for 1D-Math Input is the following

statement

statement

(4)

 

NULL

Also pasting code with comments in MaplePrimes (function insert code snippet) removes comments.

Any other ways? Ideally, I would also like to convert a whole document in one go, That is probably asked too much.

Download convert_comment_to_1D.mw

I have repeatedly seen this on two Windows PCs:

The assignement operator := is rendered as a roman d

This happens after using Maple for some time.
 Exiting Maple and restart of Maple is required. Has someone noticed the same?
All on Windows 10 and for sure in screen reader mode (my default, cannot report on the new GUI).

This question is about a particularity of a widely used function, which looks like a bug at the first glance, but is not (after carefully studying the help page).

The function “add” (a built-in function with special evaluation rules) is intended to be used on sequences. If for any reason (in a procedure for example) a sequence degenerates to a single scalar expression and add is applied to it, the expression can change. This is most likely undesired. In the case below (simplified from a real case that happened to me) a product is transformed into a nonsense sum.

data := 1.*Unit(m);
accu_length := add(data);
data := data, 2.*Unit(m);
accu_length := add(data);
                       data := 1. Unit(m)

                  accu_length := 1. + Unit(m)

                 data := 1. Unit(m), 2. Unit(m)

                   accu_length := 3. Unit(m)

It is quite likely that the above unit error will be noticed. In the following case it is more likely that a change in value remains unnoticed.

data := 2/5;
add(data);
                                   2
                           data := -
                                   5

                               7

I was wondering whether Maple could issue a warning to prevent this use error of add, when certain types of expressions are passed to add.
Alternatively Maple could return the expression unchanged. So far, I have not found a case where it makes sense to apply add to operands of a scalar expression (excluding set, list, array, ... ).

This leads to the question of whether this functionality (add working on a scalar expression) is needed at all. I tried a few and none of them is useful

[a = b, a^b, a@b, a/b, sin(a), int(f(x), x), a[b]];
map(add, %);
        [        b       a                            ]
        [a = b, a , a@b, -, sin(a), int(f(x), x), a[b]]
        [                b                            ]

          [                         1                ]
          [a + b, a + b, a + b, a + -, a, f(x) + x, b]
          [                         b                ]

Anything else which could make sense?

For constants I prefer subscripts over indeces.

I noticed that numbers in subscripts are printed in italic. This is against a common prettyprint convention, where variables are in italic and numbers are in roman. In the example below "1" can easily be misread as "l" (which is probably one of the reasons for this convention)

Is there a way to get numbers printed in roman in subscripts? To force roman print I tried

t__`#mo("1");`
Error, missing operator or `;`

In 2d-Math the convention is respected in the input but not in the outut

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