Consistent Singular System

Asked by Mo

Hi Folks,

Just a quick question. Is there any chance one could solve a consistent singular system by computing the rigid body modes and pseudo-inverse matrix? Anyone tried that? I know about the SingularSolver in FEniCS, but this is not what I need.

Thanks,
Mo

Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Joachim Haga
Solved:
Last query:
Last reply:
Revision history for this message
Joachim Haga (jobh) said :
#1

There's a Moore-Penrose pseudoinverse demo in cbc.block (development
version). I wouldn't use this for production code, but it may be useful for
experimentation.The development version of dolfin is required. The demo
itself should work with the stable version of cbc.block (and dolfin) with
only minor changes.

Download: bzr branch lp:cbc.block
Demo: cbc.block/demo/moore-penrose.py

The pseudoinverse is "Apinv" on line 66, I guess the rigid modes are all
mixed together in "(1 - Apinv * A)" on line 78. There's currently no
eigensolver implemented in cbc.block, so separating them is a problem...
(it's on the todo list somewhere, but hasn't actually been requested by
anybody yet).

-j.

On 25 April 2012 00:00, Mo <email address hidden> wrote:

> New question #194632 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/194632
>
> Hi Folks,
>
> Just a quick question. Is there any chance one could solve a consistent
> singular system by computing the rigid body modes and pseudo-inverse
> matrix? Anyone tried that? I know about the SingularSolver in FEniCS, but
> this is not what I need.
>
> Thanks,
> Mo
>
> --
> You received this question notification because you are a member of
> FEniCS Team, which is an answer contact for FEniCS Project.
>

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

Thank you Joachim for your answer. CBC.block sounds very interesting. Would you please let me know how can I get the development version of dolfin? Do I need to uninstall my current version of FEniCS and install the development version?

Thanks,
Mo

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

It turns out the demo is also in the stable version of cbc.block, which
works with dolfin stable (1.0.x). I had just forgotten.

It is not in the tarball however, so you'll need to do "bzr branch
lp:cbc.block/1.0".

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

Thank you. I have a question and I know it may sound stupid. This bzr branch is totally new to me. When I want to run moore-penrose.py , I get the error: ImportError: No module named block. I would be grateful if you could let me know how to resolve this issue.

Thanks,
Mo

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

Sure! "bzr branch" just makes a copy of the source code into a directory
(which may be named "1.0" in this case, feel free to rename it to something
more descriptive like "cbc.block"). Since it's pure python, no compilation
is necessary.

Next step, you can choose to install it to a system location by running
"python setup.py install" (I don't know exactly which location, I don't use
this method). Or alternatively you can set PYTHONPATH to include the
directory which was created by "bzr.branch", something like:
  export PYTHONPATH=~/src/cbc.block:$PYTHONPATH

...and then it should work.

(If PyTrilinos isn't installed, you'll have to remove the "import trilinos"
bit and all references to ML.)

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

Great! It works. Thank you so much for taking the time to explain it precisely.

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

Thanks Joachim Haga, that solved my question.