Page 1 sur 1

eigenvals cmd

Publié : lun. nov. 05, 2018 6:19 pm
par compsystems
Hello, BP, the result of eigenvals(A) must be contained between [ ] so that then can operate as a single object

A:=[[1,2],[3,4]]

eigenvals(A) [enter] returns (sqrt(33)+5)/2, (-(sqrt(33))+5)/2

=> [ (sqrt(33)+5)/2,(-(sqrt(33))+5)/2 ]

///
Something similar
When a group of objects is returned, please, after [copy] to enclose them as a list of objects
iquo(23,13); irem(23,13) [enter] returns 1, 10
[copy] then [paste]
list[ 1,10 ] to then be able to operate as a set of objects
list[ 1,10 ]*2 => [ 2,20 ]

jordan(A) [enter] returns [[sqrt(33)-3,-(sqrt(33))-3],[6,6]], [[(sqrt(33)+5)/2,0],[0,(-(sqrt(33))+5)/2]]
[copy] then [paste]
list[ [[sqrt(33)-3,-(sqrt(33))-3],[6,6]], [[(sqrt(33)+5)/2,0],[0,(-(sqrt(33))+5)/2]] ]

list[ [[sqrt(33)-3,-(sqrt(33))-3],[6,6]], [[(sqrt(33)+5)/2,0],[0,(-(sqrt(33))+5)/2]] ][1] => [[(sqrt(33)+5)/2,0],[0,(-(sqrt(33))+5)/2]]
list[ [[sqrt(33)-3,-(sqrt(33))-3],[6,6]], [[(sqrt(33)+5)/2,0],[0,(-(sqrt(33))+5)/2]] ][0] => [[sqrt(33)-3,-(sqrt(33))-3],[6,6]]

Re: eigenvals cmd

Publié : mar. nov. 06, 2018 8:49 am
par parisse
eigenvals returns a sequence for compatibility reasons. You can run [eigenvals()] if you want a list

Re: eigenvals cmd

Publié : mar. nov. 06, 2018 3:12 pm
par compsystems
ok, the problem with the format of the sequences is that when they are copied to a new input line, they can not be operated together.

a, b, c * d => a, b, (c * d)

some automatic solution

eigenvals ([[1,2], [3,4]]) => squ(val1, val2)
squ(val1, val2) * a => squ(val1*a, val2*a)