Hello
for linear systems
Example #1
[HP-Prime CAS] solve( 4*x+3*y=10 and 5*x-2*y=1, {x,y} ) [Enter] return { [ 1, 2 ] }
// OK, but best
[Request] tag the answers
solve( 4*x+3*y=10 and 5*x-2*y=1, {x,y} ) [Enter] return { [ x=1, y=2 ] } OK OK and if { [ x=1, and: y=2 ] } OK, OK, OK /!\ "and:" as tag (idea)
http://www.wolframalpha.com/input/?i=solve%28+4*x%2B3*y%3D10+and+5*x-2*y%3D1%2C+%7Bx%2Cy%7D%29
purpose, use the expression (output) in a program
left(x = 3) => x // to extract the variable
right(x = 3) => 3 // to extract the result
[Request] rename left to leftPart and right to rightPart
linSolve( 4*x+3*y=10 and 5*x-2*y=1, {x,y} ) [Enter] return [ 1, 2 ] OK and if [ x=1, y=2 ] OK OK, and if [ x=1, and:y=2 ] OK OK OK
Example #2
[HP-Prime CAS] solve( 4*x+6*y=10 and 2*x-3*y=6, {x,y} ) [Enter] return {}
[Request] Better a boolean output (true/false) like TI-CAS+ calculators
solve( 4*x+6*y=10 and 2*x-3*y=6, {x,y} ) [Enter] return false
purpose use the expression (output) in a program
if solve( 4*x+6*y=10 and 2*x-3*y=6, {x,y} ) == true then ... else ...
now required a "trick" use DIM( ... ) =(
if DIM( solve( 4*x+6*y=10 and 2*x-3*y=6) )== true, {x,y} ) then // ugly use DIM(
equal with linSolve
linSolve( 4*x+6*y=10 and 2*x-3*y=6, {x,y} )return [ ] ?? empty vector, ugly and nothing didactic for teaching and learning of math
best
linSolve( 4*x+6*y=10 and 2*x-3*y=6, {x,y} )return false =)
if linSolve( 4*x+6*y=10 and 2*x-3*y=6, {x,y} ) == true then ...
//
[BUG#0 solve cmds] with SIMULT
simult(
[ [ 4, 6 ] [ [10]
[ 2, 3 ]], [6]]
return [ 0 ; 1 ] ?? // Bug 4*0 + 6 * 1 = 10 => 6 = 10 => false
simult(
[ [ 4, 6 ] [ [10]
[ 2, 3 ]], [6]]
return "Not Solutions Exist" // OK // or "singular matrix" like TI-CAS+ calcs or wolframAlpha
see wolframalpha
http://www.wolframalpha.com/input/?i=solve%28+4*x%2B6*y%3D10+and+2*x%2B3*y%3D6%2C+%7Bx%2Cy%7D%29
Example #3
solve( 4*x+6*y=12 and 2*x-3*y=2, {x,y} ) [Enter] return false =)
simult(
[ [ 4, 6 ] [ [12]
[ 2, 3 ]], [6]]
return [ 1 ; 0 ] ?? // Bug
simult(
[ [ 4, 6 ] [ [12]
[ 2, 3 ]], [6]]
return "Infinite Solutions" // Super OK
Thanks
///////////////////////////////
PD: [spanish]
REQUEST Se requiere un comando para etiquetar similar a ->TAG de la HP50
ejemplo
tag( "cplx1:", 3+4*i ) [Enter] cplx1: 3+4*i
tag({ "x:", "y:", "z:" }, [ 3 4 1 ] ) [Enter] [ x:3, y:4, z:1 ]
/!\ la etiqueta no afectaría los cálculos, es muy útil por ejemplo para indicar en pantalla resultados mas bonitos sin la necesidad de convertirlos a cadenas, pues se cambiaría el tipo de dato
Edited: 6 Aug 2013, 2:57 p.m. after one or more responses were posted