Menu

#226 MAtrix multiplication syntax issue

0.0.19
open
nobody
None
2
2021-10-24
2021-10-19
Buenos
No
I was trying to multiply a vector from an AC simulation result with a matrix, in an equation block, unsuccessfully.

Start with these:
ID=eye(40)
x=linspace(1,40,40)

y=ID*x
This results in an error. checker error, no appropriate function for `(ID*x)' found

y=[ID]*x
Using brackets for the matrix's name, This will not result in an error, but the resulting vector y is all zeroes. Multiplying a vector with the identity matrix should return the original vector, not all zeroes.

y=[ID[:,2]]*x
Results in an error. Even though the online documentation says this is completely correct.

creating a matrix manually, a 90degree rotated identity matrix, for the purpose of vector reversal, has the same issues as using the generated identity matrix (eye). Resulting in all zeros in the vector.
[rev]=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1;0,0,0,0,0,0,0,... and so on...

Please either:
- Tell me the exact syntax (asci character sequence_ that i have to type into the equation block, to get a correct matrix multiplication. How do we access a matrix in QUCS? 
- Fix the bug of matrix multiplications.

The reason why I am trying to do this is to implement a vector reversal. Doing it bit by bit like this [z[1022],z[1021],z[1020],z[1019],z[1018],z[1017]... is extremely slow. 1400 bit reversal takes 5 minutes. Doing it with the matrix multiplications would be 20 seconds. It would be even better to have a rev() function for the measurement equations, to turn a 1000bit vector like [1,2,3,4] into [4,3,2,1]. This is important for preparing symmetrical spectrum for IFFT after AC-sim, and for time reversal for the reverse pulse technique.

Discussion

  • Buenos

    Buenos - 2021-10-19

    If I expand my vector into a matrix like this m3=[zaza;nh] where nh is a 39x40 matrix of zeroes, then I am able to multiply it by a matrix like the identity matrix or my reversal matrix like m4=m3*ID. But then I need to get a vector from the resulting matrix. The online manual claims that I can get a row or a column out of a matrix like this m5=m4[1,:] , but then I get an error. I am using the released 0.19 windows binary.
    So, several existing features dont work:
    - matrix by vector multiplication
    - vector extraction from matrix
    - reversing a vector like this b=a[39:0] that would work in VHDL or verilog.

     
  • Buenos

    Buenos - 2021-10-24

    This doesnt work, even though the documentation lists it as an existing feature:
    M[:,3] Vector consisting of 3rd column of matrix M
    checker error, no appropriate function for `M[range('?','?'),3]' found

     

Log in to post a comment.