Solving linear equations in Fortran 95

user2995889 picture user2995889 · Nov 15, 2013 · Viewed 7.6k times · Source

I'm newbie in programming and at the moment I'm working on a project that I need to use Fortran 95. Is there any subroutine for solving linear equation, for example finding matrix x in the A*x=b where A is a 2*2 matrix.

I would appreciate if you give me any useful link that help me to solve this problem. thank for your help

Answer

Ignasi Aliguer picture Ignasi Aliguer · Sep 17, 2015

For 2x2 system of equations you should code the Cramer's rule, since the expression of det(A) is fairly simple (also for 3x3). https://en.wikipedia.org/wiki/Cramer%27s_rule