def main():
    x2_history = BooleanTimeSeries([0], [True], 0.5)
    x2_history.label = 'x2'
    x2_history.style = '-r'

    x1_input = BooleanTimeSeries([0, 0.5, 1, 1.5, 2, 2.5, 3], [False], 3)
    x1_input.label = 'x1'
    x1_input.style = '-b'

    delay_parameters = [0.3]
    end_time = 3

    my_bde_solver = \
        BDESolver(my_forcing_input_model, delay_parameters, [x2_history], [x1_input])
    my_bde_solver.solve(end_time)

    my_bde_solver.show_result()
def main():
    x1_history = BooleanTimeSeries([0, 1.5], [True, False], 2)
    x2_history = BooleanTimeSeries([0, 1], [True, False], 2)

    x1_history.label = "x1"
    x1_history.style = "-r"
    x2_history.label = "x2"
    x2_history.style = "-b"

    delay_parameters = [1, 0.5]

    end_time = 6

    my_bde_solver = BDESolver(my_two_variable_model, delay_parameters,
                              [x1_history, x2_history])
    my_bde_solver.solve(end_time)
    my_bde_solver.show_result()

    my_bde_solver.print_result()
Ejemplo n.º 3
0
# Plot the history
BooleanTimeSeries.plot_many([hist_m, hist_ft])
plt.xlabel("Time (hours)")
plt.legend()
plt.show()

# The model uses a forcing input for light

light_t = [0] + list(range(6, 120, 12))
light_y = []
for t in light_t:
    light_y.append(6 <= t % 24 < 18)
light_bts = BooleanTimeSeries(light_t, light_y, 118)
light_bts.label = "light"
light_bts.style = "-g"

# Plot light
light_bts.plot()
plt.show()

# Plot light and the histories
BooleanTimeSeries.plot_many([hist_m, hist_ft, light_bts])
plt.show()

# Define the model equations


def neurospora_eqns(z, forced_inputs):
    m = 0
    ft = 1