## 20 Reputation

4 years, 119 days

## Difficulty in Creating a Post...

MaplePrimes

I had difficulty in making my latest post.  It would fail at Submit.

I had success when I saved a draft post.  I was able to edit the draft to submit.

Lee

## Ease of Manipulating Formulae in Maple...

Maple

I am interested in how easy it is to work with formulae in the Maple language.  For example, you can easily add two equations together with '+'.

 > e1:=x^2+1=2*x;
 (1)
 > e2:=x^3+x=5;
 (2)
 > e1+e2;
 (3)

I was pleased when the following example added (x+1) to both sides of an equation,

 > e3:=x+1;
 (4)
 > e1+e3;
 (5)

Some other algebraic operations work.

 > e1-e3;
 (6)
 > e1*e3;
 (7)
 > e1/e3;
 (8)
 > e1^(1/2);
 (9)

Build-in functions do not work, though, but there is a simple solution.

 > exp(e1);
 > exp(rhs(e1))=exp(lhs(e1));
 (10)
 > map(exp,e1);
 (11)

The methods also apply to inequality formulae.  I'm not as pleased about how it does '*' and '/' for inequalities.  You can get more control using rhs and lhs functions.  Here are some examples:

 > e4:=x^3<5*(x+1);
 (12)
 > e4+e3;
 (13)
 > e4-e3;
 (14)
 > e4*e3;
 (15)
 > e4/e3;
 (16)
 > eval(%,x=4);
 (17)
 > evalb(%);
 (18)
 > (16)/x^2;
 (19)
 > simplify(%);
 (20)
 > lhs(e4)/e3/x^2 < rhs(e4)/e3/x^2;
 (21)
 > simplify(%);
 (22)
 >

## StringTools Questions (Maple 2020)...

Maple 2020

I was reviewing the StringTools features and I'm curious about some parts of it.

(1)     Here is a section from the StringTools[Length] help topic:

Notice that, like length, the Length command counts the number of bytes in the string, not the number of characters.
Length("d303251cembre");
9

When I execute the command in Maple 2020, it actually returns 13 instead of 9.  The length command also returns 13.  I do not understand the information from StringTools[Length] help.  I looked back to Maple 18 and it did not include these lines in the help topic.

(2)   I am confused about the rng argument in StringTools commands of LowerCase, UpperCase and OtherCase.  It seems that these commands consider -2 as the last character in the string.  The help topic shows this:

UpperCase("abcdefghij", 3 .. -2);
"abCDEFGHIJ"

I'm expected to use -1 as the last character such as:

S:="This is a test";
S[-4..-1];
"test"

(3)  Next, I looked at StingTools[SubString].  The help topic gives the following example:

SubString("abcdef", -5 .. -3);
"bcd"
That works like I expected.  So, -1 is the last character for SubString.

Thanks,
Lee

 Page 1 of 1
﻿