moore-penrose.py

Asked by Mo

Hi folks,

Just a quick question about Apinv in demo moore-penrose.py. When we assemble stiffness matrix (say A in this demo), I can easily print it as:

print A.array()

But for Apinv, I cannot do something like this or save it to a .mat file. When I want to print it, I get the following error:

AttributeError: 'ConjGrad' object has no attribute 'array'

I want to be able to save Apinv to a .mat file similar to what I can do for assembled stiffness matrix easily.
Any help is deeply deeply appreciated.

Thanks,
Mo

Question information

Language:
English Edit question
Status:
Solved
For:
CBC.Block Edit question
Assignee:
No assignee Edit question
Solved by:
Joachim Haga
Solved:
Last query:
Last reply:
Revision history for this message
Mo (mo-h) said :
#1

I really appreciate if anyone could help me out!

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Joachim Haga (jobh) said :
#3

Sorry, I didn't notice this question. Looks like we haven't set up the mail subscriptions properly. Is the question still relevant?

Revision history for this message
Mo (mo-h) said :
#4

Yes, I would be grateful if you could help me in this regard.

Thanks,
Mo

Revision history for this message
Best Joachim Haga (jobh) said :
#5

The inverse (and hence the pseudo-inverse) are not matrices, but actions. The inverse is not computed explicitly - that would be a very expensive operation, and result in a dense matrix.

If the matrices are small, the (dense) pseudoinverse can be calculated for example by multiplying by the unit vectors, one by one; each result is one row or column of the inverse. Or just calculate it with numpy/scipy/octave/matlab.

Revision history for this message
Mo (mo-h) said :
#6

Thanks Joachim Haga, that solved my question.