new cmd: ABSEXPAND
Modérateur : xcasadmin
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
new cmd: ABSEXPAND
Hello BP, please can replicate the ABSEXPAND command of the classpad on GIAC
absExpand(|2-x|=1); -> { x-2=1, x-2=-1 }
absExpand(|2-x|=1); -> { x-2=1, x-2=-1 }
Re: new cmd: ABSEXPAND
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)
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: new cmd: ABSEXPAND
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
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
Re: new cmd: ABSEXPAND
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.
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.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: new cmd: ABSEXPAND
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
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
Re: new cmd: ABSEXPAND
id should also work.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: new cmd: ABSEXPAND
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
[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
Re: new cmd: ABSEXPAND
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.
-
- Messages : 562
- Inscription : sam. févr. 04, 2017 11:34 pm
- Localisation : Colombia
- Contact :
Re: new cmd: ABSEXPAND
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
"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