Contains a 4th order Runge-Kutta-Fehlberg ODE solver and a linear system of equations solver
Solves the linear equation of the form A*x = b for x. A is an (n,n) arrays x and b are (n) arrays Uses Gaussian elimination, so will have issues if nbody_system is ill-conditioned. Uses quad precision intermidiate values, so works best on small arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=DP), | intent(in), | dimension(:,:) | :: | A | ||
| real(kind=DP), | intent(in), | dimension(:) | :: | b | ||
| integer(kind=I4B), | intent(in) | :: | n | |||
| logical, | intent(out) | :: | lerr |
Solves the linear equation of the form A*x = b for x. A is an (n,n) arrays x and b are (n) arrays Uses Gaussian elimination, so will have issues if nbody_system is ill-conditioned. Uses quad precision intermidiate values, so works best on small arrays.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=QP), | intent(in), | dimension(:,:) | :: | A | ||
| real(kind=QP), | intent(in), | dimension(:) | :: | b | ||
| integer(kind=I4B), | intent(in) | :: | n | |||
| logical, | intent(out) | :: | lerr |
Uses Brent’s method to find the root of a function f
| Type | Intent | Optional | Attributes | Name | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
private function f(x) result(y)Arguments
Return Value real(kind=DP) |
||||||||||||||||||||
| real(kind=DP), | intent(inout) | :: | x |
Initial guess and also the final answer |
||||||||||||||||
| real(kind=DP), | intent(in), | optional | :: | tol |
The relative tolerance on the solution |
|||||||||||||||
| logical, | intent(out), | optional | :: | lerr |
Returns .true. if a root was found, otherwise returns .false. |
|||||||||||||||