Re: [HP Prime CAS] Solve Commands (Bugs and Request) Message #8 Posted by CompSystems on 8 Aug 2013, 9:48 a.m., in response to message #7 by CompSystems
El TI-CAS es un CAS mas "inteligente" que el HP-CAS, por que se aproxima mas a como un ser humano lo haría, mientras que el HP-CAS sus respuestas no son tan intuitivas y como es para un mercado estudiantil pre-universitario, dudo que tenga buena acogida, casi siempre en la HP-Prime hay que estar re-escribiendo las expresiones para obtener algo mas facil de manipular
Ejemplo: Sistemas de ecuaciones lineales con "Soluciones infinitas"
x1-3*x2+x3 = 1
2*x1-x2-2*x3 = -1
2*x1-6*x2+2*x3 = 2
en forma A*x=b
[[1,-3,1,1], [ x1; x2; x3 ] = [ 1; -1; 2 ]
[2,-1,-2,-1], *
[2,-6,2,2]]
M1:=
[[1,-3,1],
[2,-1,-2],
[2,-6,2]]
x:= [[ x1],[x2][x3]]
b: = [[1], [-1],[2]]
sol:={}
Aplicando RREF (reduced row echelon form)
rref( concat( M1, b ) ) [Enter] =>
[[1,0,-7/5,-4/5],
[0,1,-4/5,-3/5],
[0,0,0,0]]
x1=(7/5)*x3-4/5
x2=(4/5)*x3-3/5
x3=x3
[TI-CAS] solve( x1 -3*x2 +x3 = 1 and 2*x1 -x2 -2*x3 = -1 and 2*x1 -6*x2 +2*x3 = 3), { x1, x2, x3 } )
:)
x1=(7* c1 -4)/5 and
x2=(4*c1-3 /5) and
x3=c1
sol:= Ans
sol:= x1=(7* c1 -4)/5 and x2=(4*c1-3 /5) and x3=c1
reemplaza x3 = c1, en la parte derecha de las expresiones, salida en función de un parámetro, el cual tiene un propósito evaluar las expresiones sin afectar la variable parametro
x1=(7* c1 -4)/5 and x2=(4*c1-3 /5) and x3=c1 | (c1 =2) =>
x1=1 and x2 = 1 and x3=2
pueden observar con mas detalle la solución en:
http://www.math.odu.edu/~bogacki/cgi-bin/lat.cgi?cmd=sys;m1_1=1;m1_2=-3;m1_3=1;m1_4=1;m2_1=2;m2_2=-1;m2_3=-2;m2_4=-1;m3_1=2;m3_2=-6;m3_3=2;m3_4=2;curn=3;curn=4;vdat=3;vdat=R3;whid=V;whid=1;submit21=Submit;hideops=1
[HP-CAS] solve( x1 -3*x2 +x3 = 1 and 2*x1 -x2 -2*x3 = -1 and 2*x1 -6*x2 +2*x3 = 3), { x1, x2, x3 } )
:(
{ [ x1, -1/35*(-20*x1+5), -1/4*(5/35*(-20*x1+5)-3) ] }
Comparen las dos respuestas anteriores, por cual calculadora se inclinarían?
sol:= Ans
sol:= { [ x1, -1/35*(-20*x1+5), -1/4*(5/35*(-20*x1+5)-3) ] }
re-escribiendo las expresiones anterior
sol := simplify( Sol )
sol := simplify( { [ x1, -1/35*(-20*x1+5), -1/4*(5/35*(-20*x1+5)-3)] } =>
sol := [ x1, (4*x1-1)/7, (5*x1+4)/7]
reescribiendo para que sea útil dentro de un programa
x := sol // fail
transpose(x) := sol // fail
vx : = [ x1, x2, x3 ] // se requiere una nueva definición del vector x como vector fila
sol: = (vx = sol) =>
sol:= ([ x1, x2, x3 ] = [ x1, (4*x1-1)/7, (5*x1+4)/7 ])
sol:=([ x1 = x1, x2 = (4*x1-1)/7, x3=(5*x1+4)/7 ] )
todos los pasos anteriores para poder tener una respuesta mejor :(
en resulmen en la HP-Prime
[ x1, x2, x3 ] = simplify ( solve ( x1 -3*x2 +x3 = 1 and 2*x1 -x2 -2*x3 = -1 and 2*x1 -6*x2 +2*x3 = 3), { x1, x2, x3 } ) )
[ x1 = x1, x2 = (4*x1-1)/7, x3=(5*x1+4)/7 ]
mientras que en la TI-CAS
solve ( x1 -3*x2 +x3 = 1 and 2*x1 -x2 -2*x3 = -1 and 2*x1 -6*x2 +2*x3 = 3), { x1, x2, x3 } )
x1=(7* c1 -4)/5 and x2=(4*c1-3 /5) and x3=c1
con el comando LInSolve las cosas son mejores
[ x1, x2, x3 ] = solve ( x1 -3*x2 +x3 = 1 and 2*x1 -x2 -2*x3 = -1 and 2*x1 -6*x2 +2*x3 = 3), { x1, x2, x3 } )
[ x1=(7/5* x3 -4), x2=(4/5*x3-3 ), x3=x3 ]
pero hay un problema [ x1=(7/5* x3 -4), x2=(4/5*x3-3 ), x3=x3 ] | x=3 =>
[ x1 = 2, x2=1, 2=2 ] ver tercer elemento ( 2 =2 )
Si linsolve arrojara en función de un parámetro seria fabuloso y si incluyera las variables, se igualria al CAS de las TI-calculators
linSolve ( x1 -3*x2 +x3 = 1 and 2*x1 -x2 -2*x3 = -1 and 2*x1 -6*x2 +2*x3 = 3), { x1, x2, x3 } )
[ x1=(7/5* t -4), x2=(4/5*t-3 ), x3=t ] // Super CAS
[ x1=(7/5* t -4), x2=(4/5*t-3 ), x3=t ] | t = 2
[ x1 = 2, x2=1, x3=2 ]
Edited: 8 Aug 2013, 10:11 a.m.
|