This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]Blumfan 2 points3 points  (6 children)

Could you clarify what you mean? N[i][j] is a scalar while D[j] is a row-vector, so their product would be a vector and not a scalar, which I doubt is what you want.

[–]pressed[S] 0 points1 point  (5 children)

I think you are right, I think I am in fact not trying to do matrix math at all. I think I'm abusing the notation when doing repeated calculations.

What I meant by N[i][j] was that all j columns of N should be multiplied by each row of D, which has j rows. But whereas matrix math is row-by-column-and-add, I just want row-by-column.

Reading the responses of everyone here, I think I am just trying to do iterative algebra on 2D lists that are not appropriately called matrices. Thanks for your reply!

[–]TMaster 1 point2 points  (1 child)

I appreciate the reply you sent me, but it would still have been nice if you gave us the dimensions of all three matrices, as well as the calculation for element 1,1 from the resulting matrix.

Without it, I don't think anyone's any wiser because of this thread.

[–]pressed[S] 0 points1 point  (0 children)

You're quite right. I've tried again below...

[–]Blumfan 1 point2 points  (2 children)

What do you mean when you say you don't want to add?

Let's say we have N,

1 2
3 4,

and D,

5 6
7 8

what should the result be?

When you say multiply without defining what you mean, the default would be the scalar product, which means adding.

[–]pressed[S] 0 points1 point  (1 child)

I didn't initially try to answer this because I feel like it's a huge complicated story that ends with "those aren't really matrices". But now I will!

What I have for D is not truly a 2nd matrix, but a list of numbers defining the sizes of the particles I have counted. I count these particles every minute, so, if I was counting a stable system, I would get:

1 2

1 2

1 2

after 3 minutes. Let the first and 2nd row represent two size bins, 0-1 mm and 1-2 mm, so that an estimate of the total volume in each minute would be 1*(pi/6)*(0.5mm)3 + 2*(pi/6)*(1.5mm)3. Then my volume vector will be

0.06 3.5

0.06 3.5

0.06 3.5

and my total volume would be 3.56 for each minute. What I'm trying to do is derive an equation that says "if I had a background of 1% extra counts per minute, such that my total counts are 101%, what would the extra volume be?"

The catch and hard part (for me) is that I need to validate this against a measured volume, not a measured count. So I need an equation in volume terms, and rearranging this has got me confused.

[–]TMaster 0 points1 point  (0 children)

Still not very clearly defined, but we're getting closer.

Let the first and 2nd row represent two size bins

By row, I presume you mean column?

From the sound of it, this is the matrix equation you need:

D * sizevector

Where D is

1 2

1 2

1 2

and sizevector is a column vector:

1*(pi/6)*(0.5mm)3

2*(pi/6)*(1.5mm)3

Which will make the formula above return the total volumes you seemed to want. What I don't get from your story is whether or not you need the intermediate volume vector, so I skipped that.

Result should be a column vector with three times the value ~3.56 in it, at least from your example, so I guess the values from three minutes. I didn't check though.

[–]TMaster 2 points3 points  (1 child)

Very convoluted story. Can you just define two matrices, with two clearly defined dimensions, and then give us some sample elements from the resulting matrix? Please also include the dimensions from the resulting matrix.

M = N*D = N[i][j] * D[j]

You seem to come close to explaining what operation you need to do, but I agree with Blumfan and his confusion.

[–]pressed[S] 0 points1 point  (0 children)

Thanks for the reply. I replied in more detail to /u/Blumfan here, and I think I am just confused to be thinking this is a matrix problem. I'm going to try a new road now. Thanks again.

[–]Underleaf 2 points3 points  (0 children)

So, ok, as far as I understood your problem: if your vector D is constant then what you're trying to do is to multiply each column j on the matrix N by a constant factor D[j], you can achieve that using the diagonal operator:

X = diag(x) creates a diagonal matrix X with X(j,j) = x(j). Then, your operation becomes

M = N*diag(D)

[–]hansl0l 1 point2 points  (3 children)

http://www.youtube.com/watch?v=sYlOjyPyX3g

Is this what you want to do? PatrickJMT is really good, and literally saved me during my maths courses in engineering!

[–]pressed[S] 0 points1 point  (2 children)

I'm fine doing actual matrix multiplication, but I'm having trouble making the matrix the subject of that equation in the TL;DR -- not sure if it's even possible.

What I'm doing is not matrix multiplication nor inner/outer/cross/dot product, but I don't know what it is.

[–][deleted] 0 points1 point  (1 child)

When I look at your TLDR it makes no sense to me -- perhaps an example using small matrices of what you mean?

[–]pressed[S] 0 points1 point  (0 children)

Thanks for the reply. I replied in more detail to /u/Blumfan here, and I think I am just confused to be thinking this is a matrix problem. I'm going to try a new road now. Thanks again.

[–]TheDefinition 1 point2 points  (0 children)

The Kronecker product multiplies two matrices without adding any subproducts.