new cmd: ABSEXPAND

Messages in english

Modérateur : xcasadmin

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

new cmd: ABSEXPAND

Message par compsystems » mar. juin 06, 2017 8:16 pm

Hello BP, please can replicate the ABSEXPAND command of the classpad on GIAC

Image

absExpand(|2-x|=1); -> { x-2=1, x-2=-1 }

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: new cmd: ABSEXPAND

Message par parisse » mer. juin 07, 2017 1:02 pm

I don't see why they call it absexpand. You can get the same functionnality with subst(abs(2x-1)=1,abs,nop) and subst(abs(2x-1)=1,abs,neg)

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: new cmd: ABSEXPAND

Message par compsystems » dim. juin 11, 2017 1:00 pm

What would you name this cmd?

could be extendABS()

The statement works fine,

[ subst(abs(2x-1)=1,'abs', 'nop'), subst(abs(2x-1)=1, 'abs', 'neg') ]
or
[ subst(abs(2x-1)=1,abs,nop), subst(abs(2x-1)=1,abs,neg) ] ->
[2*x-1=1,-2*x+1=1]

but a script to do step-by-step demonstrations does not look so clean because it is a replacement of strings and not mathematical operation, for this reason, I think it should be as a default function in the symbolic computational kernel, another function that is required are
not(x<13) -> x>=13
not(x>13) -> 13>=x

[ subst(±5,±,nop), subst(±5,±,'neg') ]-> [±5,±5] =(
extendPlusMinusSign(±5) -> [ 5, -5]
https://en.wikipedia.org/wiki/Plus-minus_sign

Thanks BP

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: new cmd: ABSEXPAND

Message par parisse » dim. juin 11, 2017 4:59 pm

I won't add an absexpand command, because subst does that and more.
I don't plan to implement not(x<5) or things like that, because either it is trivial or it requires algorithms that I don't know and I prefer to work on other areas.

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: new cmd: ABSEXPAND

Message par compsystems » lun. juin 12, 2017 3:33 am

That you do not know the algorithm is a valid excuse, but not if it is trivial, because a CAS tries to automate the math, even if this is a trivial function.

What is the equivalent in the hp-prime of NOP?

[ subst(abs(2x-1)=1,'abs', 'nop'), subst(abs(2x-1)=1, 'abs', 'neg') ] ->
[(nop(2*x-1)) = 1,(-2*x+1) = 1]

Thanks

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: new cmd: ABSEXPAND

Message par parisse » lun. juin 12, 2017 6:18 am

id should also work.

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: new cmd: ABSEXPAND

Message par compsystems » lun. juin 12, 2017 2:41 pm

ok with id on the hp-prime

[subst((abs(2*x-1)) = 1,'abs','id'),subst((abs(2*x-1)) = 1,'abs','neg')] -> [(2*x-1) = 1, (-2*x+1) = 1]

In another forum mentioned, that to support double inequalities, requires modifying the core of xCAS, =(

-3 < ((2*x+5)/3) <= 5 -> -7 < x <= 5

Inequations is one of the first topics of mathematics in engineering, I insist at least should add the option NOT(inequation), Although it is a trivial user function to program, I prefer the functions embedded in the kernel

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: new cmd: ABSEXPAND

Message par parisse » mar. juin 13, 2017 5:36 am

You are mixing two different things, parsing -3 < ((2*x+5)/3) <= 5 as an and of two inequations and handling inequations. I will try to add support for parsing double inequations and support for this in solve but that's all. I don't see why someone would spend time keying in inequations if the calc can only handle trivial operations on it.

compsystems
Messages : 562
Inscription : sam. févr. 04, 2017 11:34 pm
Localisation : Colombia
Contact :

Re: new cmd: ABSEXPAND

Message par compsystems » mer. juin 14, 2017 7:18 pm

solve( (2/3*x+5/3)>-3 AND 5≥(2/3*x+5/3)) ) ->
"Unable to isolate x in ((((2*x)/3+5/3)>-3) and (5>=((2*x)/3+5/3)))" =(


solve( -3< (2*x+5)/3 <= 5 ) enter
"Inequation inside inequation not implemented (-8)<((2*x+5)/3-5) Error: Bad Argument Value" =(

You can take the idea of GeoGebra, uses the ∧ symbol to rewrite the double inequality.

#1 -3< (2*x+5)/3 <= 5 enter

((2/3*x) + 5/3 > -3) (5 ≥ (2/3 * x) + 5 / 3)

solve( #1 ) ->

solve( -3< (2*x+5)/3 <=5 ) ->

solve( ((2 / 3 * x) + 5 / 3 > -3) (5 ≥ (2/3 * x) + 5 / 3) ) ->

x>-7 x <= 5



In the image above there is command, to concatenate two expressions as a double equation

andConnect( (2*x+5)/3 > -3), ((2*x+5)/3 <= 5) enter
((2/3*x) + 5/3 > -3) (5 ≥ (2/3 * x) + 5 / 3)

orConnect(x<13,x<5) enter
x<13

xorConnect( x<13, x<5 ) enter
x>=5 ∧ x<13

Répondre