2 from matplotlib
import pyplot
as plt
3 from demo_pos_pos_spr_friction
import pos_pos_spr_friction
5 plt.rcParams[
"svg.fonttype"] =
"none" 6 plt.rcParams[
"font.size"] = 10
7 plt.rcParams[
"text.usetex"] =
False 8 plt.rcParams[
"savefig.directory"] =
"../../Figures/Master" 9 plt.rcParams[
"savefig.format"] =
"svg" 16 flags = {
"no_pad":
"--nopad"}
19 shown_indexes = [0, 100]
20 run_name =
"demo/bk_decrease_seed_106" 21 sys.argv.append(flags[
"no_pad"])
22 print(
"\n\nYou have chosen to run a demo of the Burridge-Knopoff model.",
23 "\nThis data for this run starts at a velocity og 1.49 and down ",
24 "to 0.0. Only a sample is plotted." 25 "\nHit \"Enter\" amd the run will start in approximately",
27 input(
"\nHit \"Enter\" to start animation: ")
30 shown_indexes = [0, 100]
31 run_name =
"demo/bk_pad_increase_seed_116" 33 print(
"\n\nYou have chosen to run a demo of the Burridge-Knopoff-Pad model.",
34 "\nThis data for this run starts at a velocity og 0.12 and up",
35 "to 1.49. Only a sample is plotted." 36 "\nHit \"Enter\" amd the run will start in approximately",
38 input(
"\nHit \"Enter\" to start animation: ")
41 velocity_index=velocity_index)
44 if __name__ ==
"__main__":
45 valid_demo_numbers = [
"1",
"2"]
46 if(len(sys.argv) == 2):
47 if(sys.argv[1]
in valid_demo_numbers):
50 print(
"1: BK model, decreasing velocity")
51 print(
"2: BKP model, increasing velocity")
52 demo_number = input(
"Please enter 1 or 2 for a demo and anything else to quit: ")
53 if(demo_number
in valid_demo_numbers):
def run_demo(demo_number)
def pos_pos_spr_friction(run_name, shown_indexes, shift_amount_per_frame=1, frames=800, live_plotting=True, sample_range=[0, velocity_index=40)