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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

## MathCAD Function to create Positive Definite Matrices?  3-Visitor

## 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?

1 ACCEPTED SOLUTION

Accepted Solutions  21-Topaz I
(To:dbinner)

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 2  21-Topaz I
(To:dbinner)

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 I
(To:dbinner)

Sorry forgot the file 