Ejemplo n.º 1
0
protocol = 1

solve_start, solve_end, solve_timestep, stimulus_magnitude, stimulus_duration, stimulus_period, stimulus_start_time = ms.get_protocol_details(
    protocol)

solve_timestep = 0.1
num_solves = 5

params_file = "gary_decker_params.txt"
traces_file = "gary_decker_traces.txt"

seed = 2
npr.seed(seed)

model_number = 8  # Decker dog
original_gs, g_parameters = ms.get_original_params(model_number)
original_gs = np.array(original_gs)
print original_gs, "\n"

lower_bounds = 0.5 * original_gs
upper_bounds = 2.0 * original_gs

times = np.arange(solve_start, solve_end + solve_timestep, solve_timestep)

ap = ap_simulator.APSimulator()

ap.DefineStimulus(stimulus_magnitude, stimulus_duration, stimulus_period,
                  stimulus_start_time)
ap.DefineSolveTimes(solve_start, solve_end, solve_timestep)
ap.DefineModel(model_number)
ap.SetNumberOfSolves(num_solves)
Ejemplo n.º 2
0
expt_dir = "/home/rossj/Documents/roche_data/2017-01_data/170123_2_2"
traces_dir = expt_dir + '/traces'
output_dir = expt_dir + '/output'
trace_number = 65
AP = np.loadtxt(traces_dir + '/{}.csv'.format(trace_number), delimiter=',')
expt_times = AP[:, 0]
expt_trace = AP[:, 1]

fig = plt.figure()
ax = fig.add_subplot(111)
ax.grid()
ax.plot(expt_times, expt_trace, color='red')

model = 7
original_gs, g_parameters = ms.get_original_params(model)  # list, list
#original_gs[0] *= 4

solve_start = expt_times[0]
solve_end = expt_times[-1]
solve_timestep = expt_times[1] - expt_times[0]

data_clamp_on = 50
data_clamp_off = 52

num_solves = 100

stimulus_magnitude, stimulus_duration, stimulus_period, stimulus_start_time = 0, 1, 1000, 0

# need to make sure these are always same as in C++ protocol
# might have to change it to have protocols hard-coded into Python instead of C++