Author Topic: Solve system Ax = 0  (Read 1175 times)

quim.soler

  • Newbie
  • *
  • Posts: 2
Solve system Ax = 0
« on: October 21, 2016, 04:51:49 PM »
Dears,

I am trying to solve a linear system Ax = 0 within a utility in c++.
I would like to obtain the non trivial solution (i.e. having non null values in x) socalled kernel of the homogeneous matrix A.
Is there any existing way (library or c++ command) to obtain this in KRATOS?

Thank you very much in advanced.
Salut!
Quim.

Ignasi de Pouplana

  • Newbie
  • *
  • Posts: 21
Re: Solve system Ax = 0
« Reply #1 on: October 21, 2016, 07:18:14 PM »
Hi Quim,

I don't know whether there is an utility in Kratos to obtain the null space of a matrix, but you can check this out:

https://eigen.tuxfamily.org/dox/group__TutorialLinearAlgebra.html

Regards,

Ignasi

quim.soler

  • Newbie
  • *
  • Posts: 2
Re: Solve system Ax = 0
« Reply #2 on: October 25, 2016, 08:02:16 PM »
Thank you Ignasi!
I have solved by doing:

Eigen::MatrixXf A (3,3);
A(0,0)=-1.0e0;
...
Eigen::MatrixXf x = A.fullPivLu().kernel();