mm-415 === Subject: Cholesky question Is it possible to use Cholesky Decomposition on a complex matrix? In fact, can a complex, Hermitian matrix be positive definite? === Subject: Re: Cholesky question Is it possible to use Cholesky Decomposition on a complex matrix? In fact, can a complex, Hermitian matrix be positive definite? Yes. The subroutine CCHDC of Linpack does this. See for example the Fortran 90 translation of John Burkardt at http://www.csit.fsu.edu/~burkardt/f_src/linpackc/linpackc.f90 or the original Fortran 77 version at http://www.netlib.org/linpack/ . In quantum mechanics, the Hamiltonian matrix is complex Hermitian, but the eigenvalues -- which are the energies of the equilibirum states -- are real. === Subject: Re: Help, if you can >What do these numbers have in common - 7, 3, 10, 11, and 12 ?? > One of the four words in Help, if you can shares the property, > as does one of the seven words in What do these numbers have in common. ============================================================================ Possible answers :[.....] ====== Another answer: The integers a_1=-7 , a_2=3 , a_3=10 , a_4=11 , a_5=12 satisfy the recurrence ====================================== a_k= A(k)*a_{k-1}+B(k)*a_{k-2} +C(k) , k=1,2,... , ====================================== where a_{-1}=a_{0}=0 , C(j)=17*j - 24 for j in {1,2}, k+1-(k-3)(-1)^k (-1)^k - 1 1+(-1)^k A(k)= --------------- , B(k)= ---------- , C(k) = ---------- , k=3,4,... . 4 2 2 === Subject: Re: ill-conditioned system of linear equations I have a big problem concerning the solution of an ill-conditioned system of linear equations. It is of the form A.x=b, where A can be square or rectangular depending on the application. The problem is that really small errors in the experimentally obtained values of A and x result in absurd values of the solution x. I solve the system by taking the inverse of the matrix A (if a is square) and then multiplying b by this inverse. What software are you using to solve the system? Some of the popular packages have functions that may help you , but I need to know what you're using. I think this isn't the problem, since when I do the calculation (A.A^-1)-(unity matrix) the resulting matrix has elements smaller then e.g. 10^-14. So I conlude that the problem is not the inversion. If A is rectangular I use the pseudo inverse in order to derive the least square solution of the system. Also, when I do the calculation A.x, I find b again! Does anyone has an idea how I can solve my problem? Does a pre-conditioning of the matrix A can help me? Does this relax the accuracy-needs for A and x? Can I make my calculation more robust by apllying a certain scaling of my rows? Please give me a suggestion, I'm quite desperate! Sam. === Subject: News in the site www.bymath.com News in www.bymath.com: Theoretical questions: reciprocal fractions repeating decimals coplanar vectors operations with complex numbers in trigonometric form common and natural logarithms mathematical induction de L'Hospital's rule integral with variable upper limit of integration Problems: more than 100 new problems with help, solutions and answers New pages: mathematical symbols jokes links to us about us site map Future news in the site: Theory: sets - basic notions - examples of sets - operations with sets probability - events - definition and basic properties of probability - conditional probability, independence of events - random variables - characteristics of random variables - normal ( Gaussian ) distribution analytic geometry - transformations of coordinates - straight line - circle - ellipse - hyperbola - parabola - plane - sphere Problems: 40-50 problems in all new sections === Subject: Re: Averaging quaternions I've finally realized that all I contributed was questions and complaints and no alternative solutions. If I were doing this, I would probably convert the quaternions to Euler (or Bryant) angles first (convert the quaternion to a direction cosine matrix, then extract the Euler angles). Then, I would compute the average of the Euler angles, and then convert the resulting average Euler angles back to a quaternion (convert the Euler angles to a direction cosine matrix, then extract the quaternion). The only thing you have to worry about with Euler (or Bryant) angles is that there will always be a singularity for any chosen sequence. For example, if you choose a 3-2-1 Bryant sequence (i.e., first rotation about the 3-axis, second rotation about the subsequent 2-axis, third rotation about the subsequent 1-axis) then there will be a singularity whenever the second rotation angle is an odd multiple of 90 degrees (in that case, there is no unique solution for the first and third rotation angles). However, you can always look at the data and select an Euler (or Bryant) sequence that has no singularity. John Does anyone know if it is possible to take an average of regularly sampled quaternions to get a mean orientation (i.e. a mean rotation matrix)? I seem to recall there being a trick involved but beyond re-normalizing the resuling (averaged) quaternion, I cannot remember what it is. === Subject: Re: Computationally cheap sin/acos approximations > Can anyone suggest *fast* approximations to sin and acos? > Over what domains should the approximations work? How about [0, pi/2] > for sin(x) and [0, 1] for acos(x)? > Also, just to make sure, am I right to think that you wish to minimize > the maximum of |absolute error|, rather than |relative error|? Phew! I was using the range [-pi,pi] for sin(x), but I just recalculated by coefficients for [0,pi/2] and the error dropped to 0.00001, which is definitely good enough. Acos is still a problem though...domain [0,1] is fine, and yes, I am looking to minimise |absolute error|. Of most interest, I seem to have discovered an error in Abramowitz and Stegun. But I find that difficult to believe. It's more likely that _I_ made a mistake. Please see below. Pierre's suggestion was good, but I suspect that approximating Acos(x) by Sqrt(1-x)*(polynomial in x) works better here. Using a cubic polynomial, I obtained the following approximation for Acos(x) when 0 <= x <= 1: Sqrt(1-x)*(a + x*(b + x*(c + x*d))) with a = pi/2, b = -0.213300989, c = 0.077980478, and d = -0.02164095 . This approximation is computationally less expensive that the one you had been using, and it has |error| < 0.000045 . After having done the above, I thought to myself This is still not optimal. Let me see what Abramowitz and Stegun have. Not surprisingly, their 4.4.45 (on p. 81) gives a similar approximation, with the claim that |error| < 0.00005 . But I was not able to verify that claim. Rather, it seems clear to me that their |error| reaches a maximum of approximately 0.000068 when x = 0. So is there a mistake in 4.4.45 of A&S, or did I make a mistake somehow? BTW, I still think that my approximation above is not optimal for the form Sqrt(1-x)*(cubic polynomial in x), that is, unless one insists that error must be 0 when x = 0. Probably, by slightly changing a from pi/2, an approximation with slightly smaller max|error| could be obtained. David Cantrell === Subject: Re: Computationally cheap sin/acos approximations Excellent, I think this is what I'm looking for - it should be pretty damn fast, since the on the target cpu I can issue the sqrt, then do the polynomial in parallel while the sqrt completes. Ah, the joy of being able to scatter sin()s and asin()s all over my code with no performance worries! All the suggestions posted were much appreciated (even if a couple went over my head somewhat :) ), thanks for the help. Sqrt(1-x)*(a + x*(b + x*(c + x*d))) with a = pi/2, b = -0.213300989, c = 0.077980478, and d = -0.02164095 . This approximation is computationally less expensive that the one you had been using, and it has |error| < 0.000045 . === Subject: Re: Computationally cheap sin/acos approximations Acos is still a problem though...domain [0,1] is fine, and yes, I am looking to minimise |absolute error|. If you can tolerate a square root, acos(x) is a pretty boring function of sqrt(1-x) over 0