Вопрос

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

Это было полезно?

Решение 2

There are many libraries you can use. A de facto standard is the LAPACK package with more algorithms you can choose. There are many free and commercial implementations of the same subroutines, for example, OpenBLAS, Intel MKL or Sun Performance Library.

If your system is very large, you would look for some iterative solver. There are many of them, just search for GMRES, BiCGSTAB or similar methods and their implementations (for example, http://people.sc.fsu.edu/~%20jburkardt/f_src/templates/templates.html).

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top