Matrix must be a positive definite (geometry problem)
10 views (last 30 days)
Hi, The code i m using is originally for flow past half cylinder. i need to change the geometry so that the semi circle is replaced by half triangle. when i make this change by modifying geometry coordinates i get an error as follows:
Error using ==> chol
Matrix must be positive definite.
Error in ==> ellipt1 at 35
R = chol(A); Y = R'\B; Z = R\Y;
Error in ==> demo2 at 67
ZN = ellipt1(p,t,RDZ,,W);
The part of the code where this 'chol' function is used and the geometry code is shown in the figures below:
Erik S. on 9 Feb 2015
If you are sure the problem is set up correctely you can solve with the general solver:
Z = A\B;
Chol can only be used for special cases when your matrix A has special properties (Symmetric and positive definite). Most matrices are not and than you have to use the \ operator.