Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=R8), | intent(out), | dimension(1:n_bt) | :: | bt |
vector of parameters |
|
integer(kind=I4), | intent(in) | :: | n_bt |
number of parameters |
||
real(kind=R8), | intent(in), | dimension(1:n_pt) | :: | v_x |
x data to fit |
|
real(kind=R8), | intent(in), | dimension(1:n_pt) | :: | v_y |
y data to fit |
|
integer(kind=I4), | intent(in) | :: | n_pt |
data vector length |
subroutine init_beta_boltz(bt, n_bt, v_x, v_y, n_pt) !================================================================================================ !< @note Function that initializes the fitting *tanh* function [[f_boltz]] parameters. !< !< \[ f_{boltz}(x_i)=\beta_2 + \beta_3 \tanh \left( \dfrac{x_i -\beta_1}{\beta_4} \right) \] !< !< @endnote !------------------------------------------------------------------------------------------------ implicit none integer(kind=I4), intent(in) :: n_bt !! *number of parameters* integer(kind=I4), intent(in) :: n_pt !! *data vector length* real (kind=R8), intent(out), dimension(1:n_bt) :: bt !! *vector \(\beta\) of parameters* real (kind=R8), intent(in ), dimension(1:n_pt) :: v_x !! *x data to fit* real (kind=R8), intent(in ), dimension(1:n_pt) :: v_y !! *y data to fit* real(kind=R8) :: a, pente bt(1) = 0.!v_x(1) +(v_x(n_pt) -v_x(1))/3 bt(2) = ( sum( v_y(n_pt - 9 : n_pt) ) + sum( v_y(1:10) ) )/ (2 * 10) bt(3) = ( sum( v_y(n_pt - 1 : n_pt) ) - sum( v_y(1:02) ) )/ (2 * 2 ) !; a = bt(3) !pente = (v_y(n_pt/2) -v_y(n_pt/4))/(v_x(n_pt/2) -v_x(n_pt/4)) bt(4) = 1.!a/pente return endsubroutine init_beta_boltz