Hello to any users of the Numerics.osax. I’m working my way through the math functions. Looking at this series of linear equations:
2w + 4v + 6z = 2
3w + 3v + 7z = 3
6w - 2v + 8z = 5
I’d expect an answer that looks like {-1.5,-1.0,1.5} in a column per MS Excel. I use this Applescript:
set n to 3
set m to {2, 4, 6, 3, 3, 7, 6, -2, 8}
set A to {class:matrix, nrows:n, ncols:n, array of real:m}
set b to {class:matrix, nrows:n, ncols:1, array of real:{2, 3, 5}}
return solve linear system A RHS (array of real of b)
I get this back:
«data Lido4E6F742061207265636F726462756F64000000000000F8BFFEFFFFFFFFFFEFBF000000000000F83F»
Which, as AEPrint, is this:
‘Lido’(‘utf8’("-1.5
-0.9999999999999998
1.5
"))
Almost close enough, but what is Lido data?
If I change the Applescript to this mathematical equivalent:
set n to 3
set m to {2, 4, 6, 3, 3, 7, 6, -2, 8}
set A to {class:matrix, nrows:n, ncols:n, array of real:m}
set b to {class:matrix, nrows:n, ncols:1, array of real:{2, 3, 5}}
set Inverse_A to invertmatrix A
return multmatrix Inverse_A with b
I get this back:
nrows: 3
ncols:1
array of real:«data Lido4E6F742061207265636F726462756F64100000000000F8BFF8FFFFFFFFFFEFBF040000000000F83F»
Which in AEPrint is
{ ‘ncol’:1, ‘nrow’:3, ‘Lido’:‘Lido’(‘utf8’("-1.500000000000004
-0.9999999999999991
1.500000000000001
")) }
Not as close. You can find the differences in the Lido string.
What’s going on? Do I have to worry about the user-unfriendly Lido data? Late Night Software gives a AEPrint command, but I don’t like that I should need it. There is a LIDO acronym: Lightweight Information Describing Objects. Is that it?
At the moment, not enthused with the osax.
…Mick (Happy New Year to all)