Transfer Matrix Method - matlab

In summary, the person is working on evaluating electron transmissions through barriers using the transfer matrix method in MATLAB. They are currently facing issues with singular matrices when taking inverses, and are looking for alternative methods such as LU decomposition and Cholesky decomposition. They are seeking help and suggestions for solving their system of equations.
  • #1
Apasz
4
0
Hi, I am working on evaluating electron transmissions through barriers using the transfer matrix method (like in optics) in matlab.

In the general simplest case, matching boundary conditions gives me two sets of equations:
Ax=By and Cy=Dz where A,B,C,D are 4x4 matrices and x,y,z are column vectors (4x1).

So by the transfer matrix method:
x=(A^-1)By and y=(C^-1)Dz so x={(A^-1)B(C^-1)D}z where the stuff inside the curly brackets is the transfer matrix (call it N).

Now at the moment, my code is N = inv(A)*B*inv(C)*D.

The issue is that for certain parameters, MATLAB returns that the matrix is nearly singular. It still calculates it and it seems to be fine most of the time (no goofy transmissions) but sometimes it just blows up. From what I have read, inverses isn't really something you do anyways in programming.

So my question is, how can I obtain my transfer matrix without taking inverses?

Matlab can solve equations of the form Ax=b, by the command x=A\b which I've read is far superior to taking inverses.The problem though is I have Ax=By and I don't want to multiply y into B.

In otherwords for the equations again: Ax=By and Cy=Dz, I would get x=A\(B*y) and y=C\(D*z) and so x=A\(B*C\(D*z)) but this is not a transfer matrix, this is a column vector since z has been multiplied into it. The whole point is to get the form x=Nz where x,z are the column vectors and N is the transfer matrix (4x4 in my case).

I am quite baffled by this whole thing, since I don't feel it should be difficult at all. Though my inexperience in computational physics is quite evident.

Any help would be MUCH appreciated.
Cheers!
 
Physics news on Phys.org
  • #2


Hi there,

Thank you for sharing your progress with us. It seems like you are making good progress in your research. I understand your concern about using inverses in programming and the potential issues with singular matrices.

One suggestion I have is to consider using the LU decomposition method to solve your system of equations instead of taking inverses. This method decomposes a matrix into a lower triangular matrix (L) and an upper triangular matrix (U). Once you have these matrices, you can easily solve the system of equations using forward and backward substitution. This method is more stable and efficient than taking inverses, especially for large matrices.

You can also consider using the Cholesky decomposition method, which is specifically designed for symmetric positive definite matrices. This method decomposes a matrix into a lower triangular matrix (L) and its transpose (L^T). Then, you can use these matrices to solve your system of equations similar to the LU decomposition method.

I hope this helps and good luck with your research!
 

FAQ: Transfer Matrix Method - matlab

1. What is the Transfer Matrix Method?

The Transfer Matrix Method is a mathematical technique used in engineering and physics to analyze the behavior of wave propagation through a series of interconnected elements. It is commonly used to model the behavior of optical systems, electronic circuits, and mechanical structures.

2. How does the Transfer Matrix Method work?

The Transfer Matrix Method works by breaking down a complex system into smaller, interconnected elements. Each element is represented by a transfer matrix, which describes how the input variables of the element (such as voltage, current, or optical intensity) are related to the output variables. By multiplying the transfer matrices of each element together, the overall transfer matrix for the entire system can be calculated, allowing for the prediction of system behavior.

3. What are the advantages of using matlab for the Transfer Matrix Method?

Matlab is a powerful software tool that allows for efficient and accurate calculations using the Transfer Matrix Method. It has built-in functions and tools specifically designed for matrix operations, making it easy to manipulate and analyze transfer matrices. Additionally, matlab has a user-friendly interface and a variety of visualization options, making it a popular choice for scientists and engineers.

4. Can the Transfer Matrix Method be used for any type of system?

The Transfer Matrix Method is a versatile technique that can be applied to a wide range of systems, including optical systems, electronic circuits, and mechanical structures. However, it is most commonly used for linear systems, where the output variables are directly proportional to the input variables. Nonlinear systems may require additional modifications to the transfer matrix equations.

5. Are there any limitations to the Transfer Matrix Method?

While the Transfer Matrix Method is a powerful tool, it does have some limitations. It assumes that the system being analyzed is linear and time-invariant, meaning that its behavior does not change with time. It also assumes that the elements in the system are connected in series, which may not always be the case. Additionally, the Transfer Matrix Method is most accurate for systems with a large number of elements, and may become less accurate for systems with only a few elements.

Similar threads

Replies
2
Views
3K
Replies
2
Views
1K
Replies
6
Views
2K
Replies
1
Views
2K
Replies
2
Views
1K
Replies
2
Views
11K
Replies
2
Views
1K
Back
Top