init_beta_boltz Subroutine

private subroutine init_beta_boltz(bt, n_bt, v_x, v_y, n_pt)

Note

Function that initializes the fitting tanh function f_boltz parameters.

Arguments

Type IntentOptional 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


Called by

proc~~init_beta_boltz~~CalledByGraph proc~init_beta_boltz init_beta_boltz proc~calcul_asfc_hermite calcul_asfc_hermite proc~calcul_asfc_hermite->proc~init_beta_boltz proc~calcul_asfc_lin_all calcul_asfc_lin_all proc~calcul_asfc_lin_all->proc~init_beta_boltz proc~calcul_asfc_spl_all calcul_asfc_spl_all proc~calcul_asfc_spl_all->proc~init_beta_boltz proc~calcul_asfc calcul_asfc proc~calcul_asfc->proc~calcul_asfc_hermite proc~calcul_asfc->proc~calcul_asfc_lin_all proc~calcul_asfc->proc~calcul_asfc_spl_all program~test_asfc test_asfc program~test_asfc->proc~calcul_asfc_hermite

Source Code

   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