Find Determinant/or Row Reduce parameter dependent matrix

In summary: I mean number of zeros in the matrix.I did try to put up the code, but I'm not really sure where to start. I think I might have messed up the way I formatted the matrix. I've attached a new file that I think is a bit more clear. Thanks.In[4]:= Det[t2]Out[4]= 2.2272666733337655*^26 + 9.645234733908778*^26*κ + 4.371330048350632*^27*κ^2 + 8.861942706420684*^25*κ^3 - 2.2393
  • #1
tau1777
30
0
I'm trying to find the determinant of a band diagonal matrix that has a parameter, κ, in some of the entries. Some entries are just numerical ones, others (κ X number), while others are (κ + number). I have been told that they way to solve for κ is to find the determinant of the this matrix and then find values of κ that make the determinant zero.

The main issue I'm having is that when my matrix becomes large the determinant just results to zero,and in other cases to calculation overflow. (I'm trying to work out all the bugs in the code, so det =0, might be some error I'm making, but the overflow error is not avoidable).

I have already tried an LUDecomposition on the matrix, and that seems to take forever, I don't have a problem waiting, but working out the scaling, it seemed like I would have to wait a couple of days for a 500X500 matrix, and my real problem might have to be done on a 1000X1000 matrix.

I was also thinking that maybe I could somehow get the matrix into an upper triangular form and then just multiple the diagonal elements. For this I tried using Mathematica's RowReduce command, but for some weird reason that just results in the identity matrix. I thought that row reduce might give me an upper triangular matrix with f(κ) on the diagonal , and I could just multiple the diagonal elements and get a polynomial for κ and solve.

Any and all help is greatly appreciated. I'm not really sure how to put up my code, or the matrix for that matter. That is the thing that would probably help you guys the most. If there is a way for me to put up the matrix please let me know.

Thanks again.
 
Physics news on Phys.org
  • #2
Start with a 10x10 or 20x20 matrix that is very similar to what your full scale matrix will be like. Make the diagonals like you expect, the size of numbers like what you expect, with or without decimal points like you expect, etc.

Put that matrix in a notebook with the simplest clearest best example of your code that you can come up with. Attach that notebook to your next post with clear specific questions about what you need help with. That will give you the best chance of getting a correct useful answer.

Then when you are sure everything is as correct as it is going to be you can scale it up to gigabytes and months to complete
 
  • #3
Hey Bill,

Thanks for the post. I've attached a Mathematica file, with a 10X10 matrix, that has the essence of my matrix.

Thanks.
 

Attachments

  • physicsForumpost.nb
    6.6 KB · Views: 554
  • #4
Thank you. This makes the question much more concrete.

In[2]:= Det[t2]

Out[2]= 2.2272666733337655*^26 + 9.645234733908778*^26*κ +
4.371330048350632*^27*κ^2 + 8.861942706420684*^25*κ^3 -
2.239345794822683*^25*κ^4 - 3.605118272791786*^24*κ^5 -
2.6482517171741852*^22*κ^6 - 3.8768184082651635*^17*κ^7

In[3]:= Solve[Det[t2]==0,κ]

Out[3]= {{κ -> -68173.53229501807}, {κ -> -129.73732341256942},
{κ -> -7.963334721970968 - 8.383566010522163*I},
{κ -> -7.963334721970968 + 8.383566010522163*I},
{κ -> -0.11026869176116452 - 0.19753775539064541*I},
{κ -> -0.11026869176116452 + 0.19753775539064541*I},
{κ -> 9.49259645600023}}

So you have a combination of moderately large coefficients, up to +/-1000 or so along with high degrees of k in your determinant.

When you want 1000x1000 matricies like this the coefficients in your determinant are going to be stunning.

Now for the larger matricies you have tried, is the determinant becoming zero because you just have enough zero entries? Or does it look like this is because of accumulated error in the determinant calculation?

You might be able to answer that by writing a little code to check each of the diagonals to see if there is a zero somewhere in every one of them. That might be done with some nested For loops and subscripting to extract individual entries to test against zero. If there is a zero in every diagonal then you may need to think about what it means to have a zero polynomial for your problem.

If the problem seems to be mostly overflow of the exponent in the calculation of the determinant you might wonder whether your matrix can be conditioned in some way to avoid the overflow.

This

Solve[Det[t2/1000.] == 0, κ]

won't change the solutions but it will dramatically decrease the size of the coefficients in the polynomial. But I'm not at all certain this is what you want.

What are the bugs you think you are falling into?

What is the code you want to use on this matrix?
 
  • #5
Hi Bill,

Thanks again for the help. I did basically try what you put up, i.e. using Solve to find the values of κ, and had success for small matrices. But after I increased the grid size the coefficients get out of control, and eventually I get an overflow error, or just zero determinant. And as I said earlier I'm pretty sure the zero is happening because of the craziness of the coefficients.

I have also thought about trying this: Solve[Det[t2/1000.] == 0, κ], and it did seem to help, but I guess one thing that's hard to notice with the examples I have is that my real matrix has plenty of small numbers as well, and in fact I run into an underflow problem.

Indeed I think I need to go back to the equations that lead up the matrix and see if can write down the problem a different way. I've posted this problem in a different forum, where they are suggesting that I use a Singular Value Decomposition of the matrix, and then apply a root-finder to that. That forum is here if you are interested:

http://mathematica.stackexchange.co...nant-or-row-reduce-parameter-dependent-matrix

Thanks again.
 
  • #6
Hey Bill,

Just wondering if you had any suggestions for my issues with RowReduce. If you try RowReduce[t2] you should see what I mean. How come κ is totally removed from the matrix?
Is there any code out there where I can just implement RowReduce without actually using the function, I don't really need the matrix in row-echelon form, just upper triangular will do.

Thanks.
 
  • #7

1. What is the purpose of finding the determinant of a matrix?

The determinant of a matrix is a numerical value that can provide important information about the properties of the matrix. It can tell us if the matrix is invertible, the number of solutions to a system of linear equations, and the scale factor of the transformation represented by the matrix.

2. How do I find the determinant of a matrix?

To find the determinant of a matrix, you can use various methods such as the cofactor expansion method, the row reduction method, or using a calculator. The most commonly used method is the row reduction method, also known as Gaussian elimination, which involves performing elementary row operations on the matrix until it is in reduced row-echelon form.

3. What is a parameter dependent matrix?

A parameter dependent matrix is a matrix that contains variables or parameters instead of numerical values. This means that the elements of the matrix are not fixed and can change depending on the values of the parameters. These types of matrices are often used in systems of equations and to represent transformations with variables.

4. How do I row reduce a parameter dependent matrix?

To row reduce a parameter dependent matrix, you can follow the same steps as you would with a regular matrix. The only difference is that you will need to keep the parameters in the matrix until the final step. Once you have the matrix in reduced row-echelon form, you can substitute in the values for the parameters to get the final solution.

5. Can I find the determinant of a parameter dependent matrix?

Yes, you can find the determinant of a parameter dependent matrix using the same methods as you would with a regular matrix. However, since the elements of the matrix are not fixed, the determinant will also be a function of the parameters. This means that the determinant can change depending on the values of the parameters.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
0
Views
429
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
786
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
846
  • Calculus and Beyond Homework Help
Replies
1
Views
629
  • Linear and Abstract Algebra
Replies
3
Views
2K
  • Precalculus Mathematics Homework Help
Replies
1
Views
497
  • Engineering and Comp Sci Homework Help
Replies
18
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
11
Views
1K
Back
Top