예제 #1
0
def vary_parameters(model, parameters, watch, duration, steps, fromzero=False, layered=False):
    trials = Trials(model, parameters)
    X, Y, Z = trials.run(duration, steps, watch)

    ylabel = model.find_label(trials.parameters[0].parameter[-1])
    zlabel = model.find_label(watch)

    if layered:
        plot.plot_layered(X, Y, Z, ylabel, zlabel)
    else:
        plot.plot_series(np.array(trials.model.records['t']), trials.parameters[0].series(steps), Z, ylabel, zlabel, fromzero)
예제 #2
0
def run_trials(steps, change, variable, reverse=False, layered=False):
    trials = HHTrials(steps, change)
    X, Y, Z = trials.run()
    if reverse:
        Z = list(Z)
        Z.reverse()
        Z = np.array(Z)

    if layered:
        plot.plot_layered(X, Y, Z, variable)
    else:
        plot.plot_series(np.array(trials.hh.records['time']), steps, Z, variable)