Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

sign of square of a parameter

Please login with a confirmed email address before reporting spam

Hello my freinds, (^2) can change negetive sign to positive but why we should use ”abs” before for example; abs(ewfd.s11)^2 to calculate norm of S11?


7 Replies Last Post 27.07.2018, 10:08 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 27.07.2018, 04:43 GMT-4

Hi Amir,

Is ewfd.s11 a vector?

Hi Amir, Is ewfd.s11 a vector?

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 27.07.2018, 04:54 GMT-4
Updated: 6 years ago 27.07.2018, 05:26 GMT-4

Dear Nichal, ewfd.S11 is scalar matrix. it can be real ,complex, positive or negetive but here, this matrix is real and mixed of positive and negetive numbers. I dont know why (ewfd.S11)^2 has negetive number ?

Dear Nichal, ewfd.S11 is scalar matrix. it can be real ,complex, positive or negetive but here, this matrix is real and mixed of positive and negetive numbers. I dont know why (ewfd.S11)^2 has negetive number ?


Please login with a confirmed email address before reporting spam

Posted: 6 years ago 27.07.2018, 05:10 GMT-4
Updated: 6 years ago 27.07.2018, 05:11 GMT-4

If it is a scalar matrix with positive and negative numbers then it depends on how COMSOL does the evaluation.

Let me give you an example:

A = [1, -1; -2, 3];

you might be thinking that COMSOL does something like:

A^2 = [(1^2) ,(-1)^2; (-2)^2, 3^2];

that would give all positive values. But what COMSOL might be doing is something like (that is how you might have done it in algebra classes):

A*A = [1, -1; -2 ,3] * [1, -1; -2, 3];

That would give

A*A = [3, -4; -8, 11]

When you use abs() you are despising the signs. My suggestion is to use a simple 2*2 matrix and do some tests in COMSOL that you can also do by hand, just to be sure how COMSOL does this calculation

If it is a scalar matrix with positive and negative numbers then it depends on how COMSOL does the evaluation. Let me give you an example: A = [1, -1; -2, 3]; you might be thinking that COMSOL does something like: A^2 = [(1^2) ,(-1)^2; (-2)^2, 3^2]; that would give all positive values. But what COMSOL might be doing is something like (that is how you might have done it in algebra classes): A*A = [1, -1; -2 ,3] * [1, -1; -2, 3]; That would give A*A = [3, -4; -8, 11] When you use abs() you are despising the signs. My suggestion is to use a simple 2*2 matrix and do some tests in COMSOL that you can also do by hand, just to be sure how COMSOL does this calculation

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 27.07.2018, 05:24 GMT-4

Thank you for your quick reply. S11 is a matrix that have 2 column and many rows(for example 100) and S11(:,1)(means whole of rows and column1) are same (assume they are frequency) for all calculation. so, How we can use matrix multiply if we have S11 with one column that can be changed.

Thank you for your quick reply. S11 is a matrix that have 2 column and many rows(for example 100) and S11(:,1)(means whole of rows and column1) are same (assume they are frequency) for all calculation. so, How we can use matrix multiply if we have S11 with one column that can be changed.

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 27.07.2018, 05:30 GMT-4

I think for COMSOL it does not matter if the first column has the same value and the second has different values. When it sees a matrix it must the algebric matrix product. Imagine you have just a simple matrix with equal elements on the first column:

[1 -3; 1; 2]. If you do the math you can check that this product will give negative numbers in the second column. If you just want to do the calculation using the second column I suppose you can try to store just this column as a variable or you can specify the column that you want during results post-processing.

I have never worked with matrix in COMSOL so I do not know more than this, sorry

I think for COMSOL it does not matter if the first column has the same value and the second has different values. When it sees a matrix it must the algebric matrix product. Imagine you have just a simple matrix with equal elements on the first column: [1 -3; 1; 2]. If you do the math you can check that this product will give negative numbers in the second column. If you just want to do the calculation using the second column I suppose you can try to store just this column as a variable or you can specify the column that you want during results post-processing. I have never worked with matrix in COMSOL so I do not know more than this, sorry

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 27.07.2018, 05:35 GMT-4

Thank you dear Nichal

Thank you dear Nichal

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 6 years ago 27.07.2018, 10:08 GMT-4

I guess there is some confusion about the S-Matrix. The dimensions of the S-Matrix depends on the number of ports the system has. S11 is one scalar element of the S-Matrix characterizing reflections from port 1. It is in general a complex number and that is why S11^2 can be negative.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
I guess there is some confusion about the S-Matrix. The dimensions of the S-Matrix depends on the number of ports the system has. S11 is one scalar element of the S-Matrix characterizing reflections from port 1. It is in general a complex number and that is why S11^2 can be negative. Cheers Edgar

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.