Solving Root Finding Problem with Sparse Matrix | Krindik

  • Thread starter krindik
  • Start date
  • Tags
    Root
In summary, there is no simplification to finding roots for a system of equations that involve coefficients with common factors.
  • #1
krindik
65
1
Hi,
While trying to simplify a solution I came up with the following sparse matrix but don't know how to solve it. [tex] [A(t)][X] = 0 [/tex]

[tex]
$\left(
\begin{array}{ccccc}
A_0(t) & 1 & 1 & ... & 1 \\
A_1(t) & 1 & 0 & ... & 0 \\
... & ... & ... & ... & ... \\
A_{n-1}(t) & 0 & ... & 1 & 0 \\
A_n(t) & 0 & ... & 0 & 1 \\
\end{array}
\right)
\left(
\begin{array}{c}
x_0 \\
x_1 \\
... \\
x_{n-1} \\
x_n
\end{array}
\right)
= 0
$
[/tex]

I need to find solutions for [tex]t[/tex] satisfying [tex]|A(t)| = 0[/tex]

I would really appreciate if you would point me in finding out
1. Whether there is actually an analytic solution for this
2. If not a suitable numerical technique to find solutions

Thanks

Krindik
 
Physics news on Phys.org
  • #2
Note that if you have a solution [itex] \vec x [/itex] to [itex] M\vec x = 0 [/itex] then [itex] a \vec x [/itex] is also a solution, where [itex] a [/itex] is a number, i.e., the solution is determined up to a scaling.

Hence you are allowed to set [itex] x_0 = a [/itex]. Once you do this you are on your way. You can express the [itex]A_j(t)[/itex] in terms of [itex]x_j[/itex] up to an arbitrary constant [itex]a[/itex].

Hope this helps.
 
Last edited:
  • #3
loveequation said:
Note that if you have a solution [itex] \vec x [/itex] to [itex] M\vec x = 0 [/itex] then [itex] a \vec x [/itex] is also a solution, where [itex] a [/itex] is a number, i.e., the solution is determined up to a scaling.

Hence you are allowed to set [itex] x_0 = a [/itex]. Once you do this you are on your way. You can express the [itex]A_j(t)[/itex] in terms of [itex]x_j[/itex] up to an arbitrary constant [itex]a[/itex].

Hope this helps.
I'm sorry but I didn't get what u meant exactly. My problem is not actually to solve for [tex]x[/tex], rather to solve for [tex]t[/tex] such that [tex]|A(t)|=0[/tex]. Actually I shouldn't have mentioned [tex][A(t)][X] = 0[/tex]. I want to find [tex]t[/tex] such that [tex]|A(t)|=0[/tex] where [tex][A(t)][/tex] is given as:
[tex]

$\left(
\begin{array}{ccccc}
A_0(t) & 1 & 1 & ... & 1 \\
A_1(t) & 1 & 0 & ... & 0 \\
... & ... & ... & ... & ... \\
A_{n-1}(t) & 0 & ... & 1 & 0 \\
A_n(t) & 0 & ... & 0 & 1 \\
\end{array}
\right) = [A(t)]
$
[/tex]
 
Last edited:
  • #4
Confirm that you want the determinant of [itex]A[/itex] equal to zero. If so, I think I know how to solve it.
 
  • #5
Confirm that you want the determinant of equal to zero
Exactly...

Thanks in advance
 
  • #6
For the determinant to be zero you need linear dependence in the matrix. Note that the second, third,...last rows are all linearly independent. To get linear dependence add the second, third,...last rows and compare the result to the first row.

To get linear dependence you want
[tex]
A_0(t) = \sum_{j=1}^n A_j(t).
[/itex]

Does this help?

p.s. You find the same thing if you compute the determinant by expanding in minors. Expanding along the first column for a 4 by 4 case you find
[tex]
det(\sansserif{A}) = A_0 - A_1 - A_2 - A_3,
[/tex]
which gives confidence in the original result.
 
Last edited:
  • #7
Thank you...
Silly me... didnt see it..
Just by doing elementary row operations the ones in first row could be eleminated...

anyway.. I'm back to square one... hoped it could give some easy result eg. [tex]A_1(t), A_2(t), ... = 0[/tex] So that
[tex]A_n(t) = \frac{p_{n2} t^2 + p_{n1} t + p_{n0}}{q_{n2} t^2 + q_{n1} t + q_{n0}}[/tex] is easy to solve for [tex]t[/tex] :cry:

As I mentioned, have to solve for [tex]t[/tex] such that [tex] A_0(t) - \sum_{j=1}^n A_j(t) = 0 [/tex]. So need to find roots of order [tex]2n[/tex].
May be I'll have to do numerically or can a symbolic math tool do this?

Thanks
 
  • #8
If the denominators of the different [itex]A_j(t)[/itex] have common factors then that helps.
Otherwise just use ZBRENT (a root finder). I assume you want all the solutions. If so, you will have to find all the intervals containing roots yourself before calling ZBRENT.
 
  • #9
Hi,
I was wondering whether there is any simplification available to find roots for something like
[tex]
\sum_{j=0}^n A_j(t) = 0.
[/tex]

where,
[tex]
A_n(t) = \frac{p_{n2} t^2 + p_{n1} t + p_{n0}}{q_{n2} t^2 + q_{n1} t + q_{n0}}
[/tex]


Thanks
 
  • #10
Hi:

You might want to post your question at the top level so it gets noticed. My guess is no, not for arbitrary coefficients p and q. The only special case which is analytically solvable is where the numerator of each term in the sum has the same root.

If you decide you're going to bite the bullet and program it up using ZBRENT then be sure that the first thing you do in the program is to identify the zeros of each of the denominators. This is where the function blows-up and has an asymptote. You could get a sign change across an asymptote and these should not be mistaken as roots.

Finally, and this makes the job easier, note that the function has flat horizontal asymptotes (i.e., the limits as t tends to infinity). Hence you can choose your
search interval depending based on how close the function is to its horizontal asymptotes.

Good luck. This would take me two hours to complete.
 
  • #11
Thanks a lot...

Instead of writing my own solver I tried MATLAB root finder. It took more than an hour(but still couldnt) to find roots. Since my requirement is to find roots in terms of some variables in [tex] p_{n0}, p_{n1},... q_{n0}, ...[/tex] what I thought of doing was to do a parameter sweep for and find the roots(instead of symbolic root finding). Since that time is not acceptable I went looking for a simplification but in vain...

I googled for ZBRENT but couldn't find any such package/software. Found a single zbrent.c file..
 
  • #12
Hi:

Give me an idea. What is the value of "n". I assume you have 6*n p's and q's to vary. What are the ranges of the p's and q's and what is the range of "t".

For certain cases you can be certain there is no root. For example for t > 0 and all the p's and q's strictly positive there is no root.

For a fortran subroutine just google zbrent fortran.
 
  • #13
Thanks again
n is usually less than 10. p and q are consists of other parameters eg. x, y

it is something like
[tex]

A_n(t) = \frac{(x-a_n) t^2 + (y-b_n) t + b_n^2}{ (y-a_n)^2 t^2 + 2(x-a_n) t + 2b_n}

[/tex]

a_n and b_n are numeric constants different for each A_n but the this form is exactly same for all A_n's. i.e only a_n and b_n change.

What I want to find is roots of t as functions of x and y. Since it was possible to do it symbolically, i tried to do a parameter sweep of x and y and find roots of t. That too takes long time for a pair of values for x,y
 
Last edited:
  • #14
You want to explore a two-dimensional parameter space. That's easy. But you're going to have to write your own solver with zbrent at its core. The writing of a solver should take about two hours of human work.

Here is a hybrid way to go, i.e., partially symbolic and partially numerical---I suspect both steps can be done in mathematica. If n = 10 then you can put everything over a common denominator and get a single rational polynomial of degree 20. Then the roots will be the roots of the numerator polynomial (provided the denominator doesn't have the same root, which is easily checked). The advantage of this approach over the one above is that you don't have to worry about the vertical asymptotes where the original function blows up.
You're also dealing with a polynomial so that Desartes rule of signs can be used and you know how many roots to expect.

Out of curiosity what is the application?
 
  • #15
That is so very kind of you... thanks

I don't have mathematica, but believe MATLAB symbolic toolbox can do the first part. (if it fails i'll try to get hold of mathemetica somehow)

I found zbrent.c below. (I've never learned fortran...). If it basically means using this program I'll definitely do it no matter 2 hours or 2weeks it takes :)
http://astronomy.nmsu.edu/cwc/Teaching/ASTR545/HW/zbrent.c"

Actually the application is stability analysis of a system.
Will definitely let u know of the progress.

Thanks again
 
Last edited by a moderator:
  • #16
Good luck.

Here is another think that will help. Suppose you find set of roots for one (x, y). Then if you go to a neighboring (x, y) pair then obviously use the previous roots as a starting guess.
This will go faster this way.
 

FAQ: Solving Root Finding Problem with Sparse Matrix | Krindik

What is the root finding problem?

The root finding problem is a mathematical problem that involves finding the values of one or more variables that satisfy a given equation or system of equations. These values are known as roots or solutions.

What is a sparse matrix?

A sparse matrix is a type of matrix that contains a large number of zero elements. This means that there are relatively few non-zero elements compared to the total number of elements in the matrix. Sparse matrices are commonly used to represent data sets that have a lot of empty or missing data points.

How is the root finding problem solved with a sparse matrix?

The root finding problem can be solved with a sparse matrix using various numerical methods, such as the bisection method, Newton's method, or the secant method. These methods involve iterative processes that use the sparse matrix to approximate the roots of the given equation or system of equations.

What are some advantages of using a sparse matrix to solve the root finding problem?

Using a sparse matrix to solve the root finding problem can lead to faster computation times and reduced memory usage. This is because sparse matrices only store non-zero elements, which reduces the size of the data set and allows for more efficient calculations.

Are there any limitations to solving the root finding problem with a sparse matrix?

One limitation of using a sparse matrix to solve the root finding problem is that some numerical methods may not be suitable for all types of equations or systems of equations. Additionally, if the matrix is not properly structured, it may lead to inaccurate or incorrect solutions. It is important to choose an appropriate numerical method and carefully construct the sparse matrix to ensure accurate results.

Similar threads

Replies
1
Views
1K
Replies
5
Views
1K
Replies
2
Views
2K
Replies
1
Views
1K
Replies
7
Views
1K
Replies
7
Views
1K
Replies
7
Views
1K
Replies
1
Views
1K
Replies
2
Views
1K
Back
Top