After scrutinizing thoroughly the NASTRAN documentation I found the following option to print the stiffness matrix $[K]$:
SOL 101
TIME 20
DIAG 8
compile semg
alter 'kjjz.*stiffness'
matprn kjjz//
CEND
SPC = 1
LOAD = 1
SUBCASE 1
BEGIN BULK
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:
python test_01.py
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