goal
My goal is that i need to solve some linear equations for some electrical circuits
rectangular matrix - not singular - resistive model
with variable Matrix size = Resistive model so no complex numbers
Later on i would like to use complex numbers model but not possible using integrated BASIC in LO
general description
problem is that i will have some rows representing data’s on one sheet
so macro has to read a column and determine the size of the matrix needed so solve the linear equations then do all the matrix calculations on another sheet
independent of the original data’s location
then i have to get the Matrix inversion results and do other calculations to get final results and write back to the first sheet.
my data’s represent a physical electrical circuit so always rectangular and not singular
is there some way to test if input matrix is singular cause of some errors?
so in macro i will built an upper triangular matrix then do the inverse then keep going till i get the final results required
@karolus
interesting using Phython
but this won’t work in BASIC !
BASIC is already included in LO so easier to use
i can sent an LO file with macro and can be use directly with Python user first need to install python which is complicated for a basic users!
i would prefer to work with Python which i use in another soft call Blender 3D modelisation
never took the time to install LO to use Python
and looks much more complicated
but looks interesting even using numpy can it also use sympy and Plot modules?
can it do Complex Matrix too using sympy ?
@mikekaganski
i use the safer version of LO not the 7 version yet
i tested your little code snippet and looks like it works
i can see the results on MSG box - very nice
i can see that the uno command has been changed for this array function call
from
svc = createUnoService(“com.sun.star.sheet.FunctionAccess”)
to
matrix_inverse = createUnoService(“com.sun.star.sheet.FunctionAccess”).callFunction(“MINVERSE”, array(a))
i did search the WEB for this and could not find anything for latest LO version
so thanks for pointing it out
Note:
is it possible to upload sample file in LO thread ?
i could use another free site call PASTALL and change file name!
will try to modify my macro and see if it works
will come back later on
thanks a lot to all for feedback
have a nice day