Skip to content

Commit 1be9940

Browse files
author
Hiroaki Imoto
authored
Move const in continuation.jl to new_curve! args (#63)
* Move const to arguments of new_curve * Fix syntax error * Fix continuation.jl * Bump version to 0.8.2
1 parent 1a01d4d commit 1be9940

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BioMASS"
22
uuid = "324734c7-f323-4536-9335-775d9be9d101"
33
authors = ["Hiroaki Imoto <himoto@protein.osaka-u.ac.jp>"]
4-
version = "0.8.1"
4+
version = "0.8.2"
55

66
[deps]
77
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

src/continuation.jl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
using ForwardDiff: jacobian
22

3-
const MC = 100000 # maximum of counts
4-
const IVAL = 1e-2 # first variation
5-
const RATE = 1e-3 # variation rate
6-
const NEPS = 1e-12 # eps of Newton's method
7-
83

94
function create_diffeq(model_path::String)
105
lines::Vector{String} = []
@@ -93,7 +88,8 @@ function newtons_method!(
9388
bifparam::Int,
9489
n_state::Int,
9590
dim_newton::Int,
96-
n_variable::Int)
91+
n_variable::Int;
92+
NEPS::Float64)
9793
u::Vector{Float64} = zeros(n_state)
9894
vx::Vector{Float64} = zeros(dim_newton)
9995
s::Matrix{Float64} = zeros(dim_newton, dim_newton + 1)
@@ -215,12 +211,21 @@ function new_curve!(
215211
n_state::Int,
216212
n_param::Int=1,
217213
n_variable::Int=n_state + 1,
218-
dim_newton::Int=n_state)
214+
dim_newton::Int=n_state,
215+
MC::Int=100000,
216+
IVAL::Float64=1e-2,
217+
RATE::Float64=1e-3,
218+
NEPS::Float64=1e-12)
219+
# direction : Set to true to +IVAL, false to -IVAL
219220
# bifparam : name(index) of bifurcation parameter
220221
# n_state : num of state variables
221222
# n_param : num of parameters
222223
# n_variable : num of variables
223224
# dim_newton : dim of Newton's method
225+
# MC : maximum of counts
226+
# IVAL : first variation
227+
# RATE : variation rate
228+
# NEPS : eps of Newton's method
224229
count::Int = 1
225230
x::Vector{Float64} = zeros(n_variable)
226231
dx::Vector{Float64} = zeros(n_variable)
@@ -265,6 +270,7 @@ function new_curve!(
265270
n_state,
266271
dim_newton,
267272
n_variable,
273+
NEPS=NEPS,
268274
)
269275

270276
write(FOUT1, @sprintf("%d\t", count))
@@ -306,6 +312,7 @@ function new_curve!(
306312
n_state,
307313
dim_newton,
308314
n_variable,
315+
NEPS=NEPS,
309316
)
310317

311318
# maximum variation

0 commit comments

Comments
 (0)