Post Reply 
Absolute value: sometimes CAS is very clever, sometimes not!
09-07-2018, 05:55 AM
Post: #5
RE: Absolute value: sometimes CAS is very clever, sometimes not!
(09-06-2018 06:14 PM)jfdHP Wrote:  For simplifications, CAS is generally very impressive and it helps a lot to get simplified results. But sometimes, obvious simplifications are missed, and it is very difficult to overcome the difficulty.

For example:
|a| - a ---> |a| - a
It makes sense because the result depends on the sign of a. No simplification is possible. Now if we assume a>0 and make the same expression, we get:
assume(a>0) ---> a
|a| - a ---> 0
This is very nice because in that case |a| = a and the result is actually zero. Great! This sophisticated simplification can be combined:
|a+1| - a ---> 1
This is still very good. But now, if we consider another positive variable, suddenly, CAS becomes stupid. For example if we continue:
assume(b>0) ---> b
|a+b| - a - b ---> |a+b| - a - b
This is not very clever because in fact we can simplify: |a+b| - a - b = 0 if both a and b are positive. The "simplify" command does not change anything.

I know that any CAS cannot be perfect. This is not a bug, but the fact that HP prime CAS cannot see this simplification is practically very annoying. In my field (I am a professor of physical-chemistry in a French university), I would like students to be able to use HP prime or Xcas for simple cases in order to show them how CAS can help to solve problems in physics and chemistry. It sometimes works, but when it doesn't work, most often it's simply because HP prime cannot simplify the absolute value of the sum of positive variables: |a+b| = a+b when a and b are positive.

As a result, HP prime (and Xcas) do not seem to be very useful in solving many physics and chemistry problems. On the other hand, I checked that Mathematica and Maple can do the simplication without any problems.

This problem (the fact that HP prime cannot simplify |a+b|=a+b if both a and b are positive) occurs in many science questions because in physics and chemistry, second-order equations are often solved together with Taylor expansions, which results in this type of simplification. I saw this absolute value problem which strongly limits the interest of HP prime (and Xcas) in science many times e.g. in electrostatics, kinetics, electrochemistry...

Does anyone know if we can overcome this difficulty? I know that there are specific simplification commands in the CAS. Maybe one of them allows us to do that?

With many thanks!

I tried with assume(a>0) [Enter] additionally(b>0) [Enter]
CAS flags
Simplify: Maximum
Exact: [V] Complex: [ ]
Use V: [V] Use i: [ ]
Principal: [V] Increasing: [ ]

And still the CAS didn't try to group 'a' and 'b' inside the ABS
as well as the 'a' and 'b' outside of the ABS to cancel them out
|a+b| - a - b
nor
simplify(|a+b| - (a+b))
No
It just couldn't do it....so much for competing with Maple/etc Real CAS
In many ways xCAS has taken me with surprise, but you've found it's weakness.

Parisse?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Absolute value: sometimes CAS is very clever, sometimes not! - CyberAngel - 09-07-2018 05:55 AM



User(s) browsing this thread: 10 Guest(s)