yaeos
This module provides all the relevant mathematical functions used in this library. Most important ones are:
use yaeos__math, only: sq_error
real(pr) :: x = 2.5, y = 3.0, error
print *, sq_error(2.5, 3.0)
------------------------------------
use yaeos__math, only: sq_error
real(pr) :: x = [2.5, 5.0], y = [3.0, 4.5], error
! It also works with arrays
print *, sq_error(x, y)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | x | |||
real(kind=pr), | intent(out) | :: | f | |||
real(kind=pr), | intent(out) | :: | df |
Represents the single point of a line segment.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | i |
Index of the first line segment |
|||
integer, | public | :: | j |
Index of the second line segment |
|||
real(kind=pr), | public | :: | x |
X coordinate |
|||
real(kind=pr), | public | :: | y |
Y coordinate |
Calculate the mole fraction second derivatives respect to mole numbers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | n(:) |
Calculate the mole fraction first derivatives respect to mole numbers
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | n(:) |
Convert the mole fraction derivatives of a quantity (calculated so they do not sum to 1) to mole number derivatives (where the mole fractions do sum to one). Requires the derivatives and the mole fractions of the mixture. From https://chemicals.readthedocs.io/chemicals.utils.html?highlight=dxs_to_dns#chemicals.utils.dxs_to_dns
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | x(:) | |||
real(kind=pr), | intent(in) | :: | dx(:) |
Linear interpolation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | x1 |
First point x value |
||
real(kind=pr), | intent(in) | :: | x2 |
Second point x value |
||
real(kind=pr), | intent(in) | :: | y1 |
First point y value |
||
real(kind=pr), | intent(in) | :: | y2 |
Second point y value |
||
real(kind=pr), | intent(in) | :: | x_obj |
Desired x value to interpolate |
y value at x_obj
Find the intersections of a single line with itself.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | lx(:) | |||
real(kind=pr), | intent(in) | :: | ly(:) |
…
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | exp | |||
real(kind=pr), | intent(in) | :: | pred |
Calculate the intersection between two line segments.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | x1 | |||
real(kind=pr), | intent(in) | :: | x2 | |||
real(kind=pr), | intent(in) | :: | x3 | |||
real(kind=pr), | intent(in) | :: | x4 | |||
real(kind=pr), | intent(in) | :: | y1 | |||
real(kind=pr), | intent(in) | :: | y2 | |||
real(kind=pr), | intent(in) | :: | y3 | |||
real(kind=pr), | intent(in) | :: | y4 | |||
real(kind=pr), | intent(out) | :: | s | |||
real(kind=pr), | intent(out) | :: | t |