Skip to content

Commit

Permalink
Fixing the polynomial function
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah-Kst committed Nov 2, 2021
1 parent b4da46b commit 92c4bcc
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 20 deletions.
Binary file modified bin/FiberCpp.exe
Binary file not shown.
Binary file modified bin/FiberCpp.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion code/FiberCpp/FiberSim_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
using namespace std::filesystem;

// Variables
static inline std::string const code_version = "2.0.0";
static inline std::string const code_version = "2.0.1";
7 changes: 0 additions & 7 deletions code/FiberCpp/half_sarcomere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,13 +854,6 @@ void half_sarcomere::initialise_filament_y_z_coordinates(int m_n)
exit(1);
}

// Check for valid m_n
if (m_n != 9)
{
printf("m_n is not == 3. Intialize filament_y_z_coordinates has not been checked\n");
//exit(1);
}

// Variables
int n_rows = (int)round(sqrt(m_n)); /**< no_of_rows of myosins, y_direction */
int n_cols = n_rows; /**< no of cols of myosins, z direction */
Expand Down
10 changes: 5 additions & 5 deletions code/FiberCpp/transition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ transition::transition(const rapidjson::Value& tr, m_state* set_p_parent_m_state
const rapidjson::Value& rp = tr["rate_parameters"];

rate_parameters = gsl_vector_alloc(MAX_NO_OF_RATE_PARAMETERS);
gsl_vector_set_zero(rate_parameters);
gsl_vector_set_all(rate_parameters, GSL_NAN);

for (int i = 0; i < (int)rp.Size(); i++)
{
Expand Down Expand Up @@ -210,7 +210,7 @@ double transition::calculate_rate(double x, double x_ext, double node_force, int
{
double x_center = gsl_vector_get(rate_parameters, 3); // optional parameter defining the zero of the polynomial

if (isnan(x_center)) { // optional parameter is not specified, use the state extension instead
if (gsl_isnan(x_center)) { // optional parameter is not specified, use the state extension instead
x_center = x_ext;
}

Expand All @@ -223,9 +223,9 @@ double transition::calculate_rate(double x, double x_ext, double node_force, int
// Poly_asymmetric
if (!strcmp(rate_type, "poly_asym"))
{
double x_center = gsl_vector_get(rate_parameters, 3); // optional parameter defining the zero of the polynomial
double x_center = gsl_vector_get(rate_parameters, 5); // optional parameter defining the zero of the polynomial

if (isnan(x_center)) { // optional parameter is not specified, use the state extension instead
if (gsl_isnan(x_center)) { // optional parameter is not specified, use the state extension instead
x_center = x_ext;
}

Expand All @@ -236,7 +236,7 @@ double transition::calculate_rate(double x, double x_ext, double node_force, int
else
rate = gsl_vector_get(rate_parameters, 0) +
(gsl_vector_get(rate_parameters, 2) *
gsl_pow_int(x - x_center, (int)gsl_vector_get(rate_parameters, 3)));
gsl_pow_int(x - x_center, (int)gsl_vector_get(rate_parameters, 4)));
}

// Curtail at max rate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@
"rate_parameters": [
75,
1,
2
2,
0
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This page discusses how to install FiberSim and the necessary support software.

FiberSim is available for free download under the GPL3 license. The latest release in hosted on Zenodo and can be downloaded [here](https://doi.org/10.5281/zenodo.4929389).

1. Download the .zip file hosted on <https://doi.org/10.5281/zenodo.4929389>. Make sure you download version 2.0.0.
1. Download the .zip file hosted on <https://doi.org/10.5281/zenodo.4929389>. Make sure you download version 2.0.1.
2. Extract the data. We recommend to use a simple path to extract them, such as `C:\Users\<user-name>\Documents`.
3. Rename the extracted folder to `FiberSim` (instead of `Campbell-Muscle-Lab-FiberSim-xxxxxx`).
4. Make sure the `FiberSim` folder look like this:
Expand Down
15 changes: 14 additions & 1 deletion docs/pages/structures/kinetics/kinetics.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,22 @@ Super-relaxed heads can only exist as dimers. Thus, if a head transitions from a
+ b, depends on c
+ c, integer
+ d, nm (optional)
+ rate = a + b * (x - d)<sup>c
+ rate = a + b * (x - d)<sup>c</sup>

Note: if d is not specified, the code sets d = the state extension (5.0 in the myosin scheme example shown above)

+ `poly_asym`
+ rate_parameters
+ a, s<sup>-1</sup>
+ b, depends on d
+ c, depends on d
+ d, integer
+ e, integer
+ f, nm (optional)
+ rate = a + b * (x - f)<sup>d</sup> if x > f
+ rate = a + c * (x - f)<sup>e</sup> if x < f

Note: if f is not specified, the code sets f = the state extension (5.0 in the myosin scheme example shown above)



7 changes: 3 additions & 4 deletions docs/pages/structures/model/model.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Inevitably, even a simple model file is quite long. Here is an example from [iso

````
{
"FiberSim": {
"version": "2.0.0"
"FiberSim": {
"version": "2.0.0"
},
"muscle": {
"no_of_half_sarcomeres": 1,
Expand Down Expand Up @@ -132,8 +132,7 @@ Inevitably, even a simple model file is quite long. Here is an example from [iso
"rate_parameters": [
75,
1,
2,
0
2
]
}
]
Expand Down

0 comments on commit 92c4bcc

Please sign in to comment.