Skip to content

Commit

Permalink
Added "force_dep_gaussian" in transition.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah-Kst committed Sep 1, 2021
1 parent 8bbf1cf commit 65731c5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
Binary file modified bin/FiberCpp.exe
Binary file not shown.
Binary file modified bin/FiberCpp.pdb
Binary file not shown.
10 changes: 9 additions & 1 deletion code/FiberCpp/FiberSim_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ FiberSim_options::FiberSim_options(char JSON_options_file_string[])
// Initialise

// Set default values
x_pos_rel_tol = 0.001; /**< default value of relative tolerance for
x_pos_rel_tol = 0.001; /**< default value of absolute tolerance for
calculating x positions */

adjacent_bs = 0; /**< default value of adjacent binding sites
Expand Down Expand Up @@ -200,6 +200,14 @@ void FiberSim_options::set_FiberSim_options_from_JSON_file_string(char JSON_file
x_pos_rel_tol = options["x_pos_rel_tol"].GetDouble();
}

// In FiberSim versions > 1.2.0, x_pos_tol notation is preferred over x_pos_rel_tol

if (JSON_functions::is_JSON_member(options, "x_pos_tol"))
{
JSON_functions::check_JSON_member_number(options, "x_pos_tol");
x_pos_rel_tol = options["x_pos_tol"].GetDouble();
}

// Check if the dump precision was specified.
if (JSON_functions::is_JSON_member(options, "dump_precision"))
{
Expand Down
28 changes: 28 additions & 0 deletions code/FiberCpp/transition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,34 @@ double transition::calculate_rate(double x, double node_force, int mybpc_state,
(1e18 * 1.38e-23 * 310.0));
}

// Force-dependent Gaussian

if (!strcmp(rate_type, "force_dependent_gaussian"))
{

FiberSim_model* p_model = p_parent_m_state->p_parent_scheme->p_fs_model;
double k_cb = p_model->m_k_cb;

rate = gsl_vector_get(rate_parameters, 0) *
exp(-(0.5 * k_cb * gsl_pow_int(x, 2)) /
(1e18 * 1.38e-23 * 310.0)) *
(1.0 + gsl_max(node_force, 0.0) * gsl_vector_get(rate_parameters, 1));
}

// Force-dependent Gaussian for MyBPC

if (!strcmp(rate_type, "force_dependent_gaussian_pc"))
{

FiberSim_model* p_model = p_parent_m_state->p_parent_scheme->p_fs_model;
double k_pc = p_model->c_k_stiff;

rate = gsl_vector_get(rate_parameters, 0) *
exp(-(0.5 * k_pc * gsl_pow_int(x, 2)) /
(1e18 * 1.38e-23 * 310.0)) *
(1.0 + gsl_max(node_force, 0.0) * gsl_vector_get(rate_parameters, 1));
}

// Poly
if (!strcmp(rate_type, "poly"))
{
Expand Down

0 comments on commit 65731c5

Please sign in to comment.