Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are working on an optimization problem in which we can approximate the eigenvalue calculation by assuming a constant eigenvector, using the formula:

$$ \tilde{\lambda}=\frac{\{\phi_0\}^T[K]\{\phi_0\}}{\{\phi_0\}^T[K_{G_0}]\{\phi_0\}} $$

where $\{\phi_0\}$ is the already calculated eigenvector, $[K_{G_0}]$ is the already calculated differential stiffness matrix and $[K]$ is the new stiffness matrix. We managed already to print $[K]$ using a couple of DMAP commands (see example in this link), but how to print $[K_{G_0}]$?

share|improve this question

migrated from May 12 '13 at 10:01

This question came from our site for active researchers, academics and students of physics.

up vote 2 down vote accepted

After scrutinizing thoroughly the NASTRAN documentation I found the following option to print the stiffness matrix $[K]$:

SOL 101
compile semg
alter 'kjjz.*stiffness' 
matprn kjjz//
SPC = 1
LOAD = 1
INCLUDE 'bulk_data.dat'

That will print the stiffness matrix into the .f06 file.

After printing the stiffness matrix the differential stiffness matrix can be calculated using the approximation above, i.e. dividing the stiffness matrix by the eigenmode:

$$[K_{G_0}] = \frac{[K]}{\lambda_0}$$

Where $\lambda_0$ is the already computed eigenvalue (using SOL 105 for example). There will be a different $[K_{G_0}]$ for each eigenvalue.

A sample code is available here using a Python script to compute the approximated eigenvalue using the equation presented in the question. You have to execute:


Things to be improved here:

  • how to stop the solution just after the stiffness matrix is printed, to avoid running the SOL 101 (but running it with zero load will be fast)

  • how to print the stiffness matrix in a binary file

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.