A new flag inspired by ti89 mode

Utilisation de Xcas

Modérateur : xcasadmin

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

A new flag inspired by ti89 mode

Message par compsystems » jeu. mai 24, 2018 3:07 am

Hello BP, in ti89 mode the output is more explicit because it includes the Boolean operators and variables. I think that a flag that allows to see the output only with variables, makes the output more explicit, especially when there are infinite solutions or depends on a parameter. Also to avoid confusion when the variables are not ordered

Example 1:
xcas mode (current)
solve([3x-2*y=1,2*x+3*y=18],[x,y]) returns [[3,4]]
solve([3x-2*y=1,2*x+3*y=18],[y,x]) returns [[4,3]]

ti89 mode
solve([3x-2*y=1,2*x+3*y=18],[x,y]) returns (x=3) and (y=4)
solve([3x-2*y=1,2*x+3*y=18],[x,y]) returns (y=4) and (x=3)

xcas mode and show vars in solutions on [✓]
solve([3x-2*y=1,2*x+3*y=18],[x,y]) returns [[x=3,y=4]]
solve([3x-2*y=1,2*x+3*y=18],[y,x]) returns [[y=4,x=3]]

xcas mode and show vars in solutions off []
solve([3x-2*y=1,2*x+3*y=18],[x,y]) returns [[3,4]]
solve([3x-2*y=1,2*x+3*y=18],[y,x]) returns [[4,3]]

Example 2:
xcas mode (current)
solve([x+y=2, 2x+2y=4],[x,y]) returns [[-y+2, y]]

ti89 mode
solve([x+y=2, 2x+2y=4],[x,y]) returns (x=-y+2) and (y=y)

xcas mode and show vars in solutions on [✓]
solve([3x-2*y=1,2*x+3*y=18],[x,y]) returns [[x=-y+2, (y=y)]]

xcas mode and show vars in solutions off []
solve([x+y=2, 2x+2y=4],[x,y]) returns [[-y+2, y]]

Example 3:
xcas mode (current)
solve((√(x^2-4*x+20)) = 5,x) returns [-1,5]

ti89 mode
solve((√(x^2-4*x+20)) = 5,x) returns (x=-1) or (x=5)

xcas mode and show vars in solutions on [✓]
solve((√(x^2-4*x+20)) = 5,x) returns [x=-1, x=5]

xcas mode and show vars in solutions off []
solve((√(x^2-4*x+20)) = 5,x) returns [-1,5]

Example 4:
cas mode and show vars in solutions on [✓]
solve([y=2*x,2*x^2=8],[x,y]) returns [[x=2,y=4],[x=-2,y=-4]]

Example 5:
xcas mode and show vars in solutions on [✓]
solve(y=2*x,[y,x]) returns [[y=2*x, x=x]]
solve(y=2*x,[x,y]) returns[[x=y/2, y=y]]

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

Re:

Message par parisse » jeu. mai 24, 2018 6:58 am

Run solve([x+y=2, 2x+2y=4],[x,y],'=')

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

Re:

Message par compsystems » jeu. mai 24, 2018 1:13 pm

Ok, but because it returns set [...]

solve(y=2*x,[x,y],'=' ) returns set[[x=(y/2),y=y]]

solve([3x-2*y=1,2*x+3*y=18],[x,y],'=' ) returns set[[x=3,y=4]]

solve([y=2*x,2*x^2=8],[x,y],'=' ) returns set[[x=2,y=4],[x=-2,y=-4]]

What another parameter accepts in the third part?, for example it is important to see the output not as a list of objects but as a Boolean expression

solve([y=2*x,2*x^2=8],[x,y],'bool' ) => (x=2 and y=4) or (x=-2 and y=-4)

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

Re:

Message par parisse » ven. mai 25, 2018 5:18 pm

You have asked conversion functions that I have implemented, now please use them :-)

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

Re:

Message par compsystems » sam. mai 26, 2018 5:03 am

list2exp command is a programming instruction, not intuitive to be executed in the worksheet

list2exp(solve([y=2*x,2*x^2=8],[x,y]),[x,y]) returns (x=2 and y=4) or (x=-2 and y=-4)

Idea: Now, as the solutions return the variables solve([y=2*x,2*x^2=8],[x,y],'='), please optimize the list2exp command, that is, if the output contains variables, set[[x=2,y=4],[x=-2,y=-4]] conform the Boolean expression without the need to specify these variables

Example

current

: list2exp(solve([y=2*x,2*x^2=8],[x,y])) returns
"Error: Bad Argument Value" ok

: list2exp(solve([y=2*x,2*x^2=8],[x,y],'='),[x,y]) returns
(x=x=2) and y=y=4) or (x=x=-2) and (y=y=-4) =(

: list2exp(solve([y=2*x,2*x^2=8],[x,y],'='))
returns (x=2 and y=4) or (x=-2 and y=-4) =)

Répondre