Skip to main content
1-Visitor
August 31, 2017
Solved

MathCAD Function to create Positive Definite Matrices?

  • August 31, 2017
  • 2 replies
  • 1954 views

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?

Best answer by terryhendicott

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.

2 replies

21-Topaz II
August 31, 2017

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.

21-Topaz II
August 31, 2017

Sorry forgot the file