cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

MathCAD Function to create Positive Definite Matrices?

dbinner
3-Newcomer

MathCAD Function to create Positive Definite Matrices?

Does MathCAD offer a function that creates Real, Positive Definite Matrices of a specified size? For example, say I'd like a square matrix of size 10 x 10 that is positive definite. Is there a function that does this?

 

Alternately, if that is not available, perhaps I could use a work-around: create the Lower Triangular (L), or Upper Triangular (U), portion of a symmetric matrix, multiply it myself to create the full symmetric matrix. Hopefully, the result would be a positive definite matrix. Does MathCAD offer a function that outputs L or U?

ACCEPTED SOLUTION

Accepted Solutions

Positive Definite Matrices of any size like 10 cannot be answered as their are thoudands of matrices that will fit this bill, so there is no function.  

You can take eigenvals(M) of a matrix M to prove it is positive definite.  

The simplest to produce is a square matrix size(n,n) that has the two positive eigenvalues 1 and n+1

The code enclosed has created such a function that will create a positive definite matrix of any size n x n.

View solution in original post

2 REPLIES 2

Positive Definite Matrices of any size like 10 cannot be answered as their are thoudands of matrices that will fit this bill, so there is no function.  

You can take eigenvals(M) of a matrix M to prove it is positive definite.  

The simplest to produce is a square matrix size(n,n) that has the two positive eigenvalues 1 and n+1

The code enclosed has created such a function that will create a positive definite matrix of any size n x n.

Sorry forgot the file

Announcements

Top Tags