<jupyter_start><jupyter_text>Volcanic island model demonstrationThis notebooks illustrates the usage of the `VolcanicIslandSimulator`.Created by CU Boulder Geomorphology Seminar team, spring semester 2022.<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from src.volcanic_island_simulator import VolcanicIslandSimulator
from landlab import imshow_grid
params = {
    'grid': {
        'num_rows': 81,
        'num_cols': 81,
        'spacing': 500.0,
    },
    'cone': {
        'relief': 1500.0,
        'angle': 6.0,
        'noise': 40.0
    },
    'timing': {
        'run_duration': 1000.0,
        'timestep_size': 1.0
    },
    'output': {
        'output_interval_fraction': 0.05,  # e.g., 0.05 means 5% intervals: 5, 10, 15, 20...100%
        'output_file_basename': 'volcanic_island',
    },
    'space': {
        "K_sed": 0.01,  # sediment erodibility
        "K_br": 0.0001,  # bedrock erodibility
        "F_f": 0.0,  # fraction of fines
        "phi": 0.3,  # sediment porosity
        "H_star": 0.1,  # characteristic sediment thickness (roughness height)
        "v_s": 0.001,  # settling velocity
        "m_sp": 0.5,  # area exponent in stream power equation
        "n_sp": 1.0,  # slope exponent in stream power equation
        "sp_crit_sed": 0.0,  # threshold to erode sediment?
        "sp_crit_br": 0.0,  # threshold to erode bedrock?
        "discharge_field": "surface_water__discharge",
        "solver": "basic",
        "dt_min": 0.001,
    },
    'marine': {
        'sea_level': 0.,
        'wave_base': 5.0,
        'shallow_water_diffusivity': 100.0,   
    }
}
vsim = VolcanicIslandSimulator(params)

initial_topo = vsim.topo.copy()
vsim.run()
imshow_grid(vsim.grid, 'topographic__elevation')
imshow_grid(vsim.grid, vsim.topo - initial_topo)
imshow_grid(vsim.grid, 'drainage_area')
imshow_grid(vsim.grid, vsim.soil)
# Plot 2 cross-sections
plt.plot(vsim.grid.x_of_node.reshape(81, 81)[41,:], vsim.topo.reshape(81, 81)[41,:])
plt.plot(vsim.grid.x_of_node.reshape(81, 81)[21,:], vsim.topo.reshape(81, 81)[21,:])
plt.xlabel('Distance (m)')
plt.ylabel('Elevation (m)')
# Check mass balance
print('Starting mean topo', np.mean(initial_topo))
print('Final mean topo', np.mean(vsim.topo))
# Write to obj file so we can import into Blender
from landlab.io.obj import write_obj

write_obj('evolved_island.obj', vsim.grid, clobber=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1403071814030718, 'fraction_numerical': 0.0448318804483188, 'mean_word_length': 3.280639431616341, 'pattern_counts': {'":': 13, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '527643', 'license': 'MIT', 'n_tokens_mistral': 985, 'n_tokens_neox': 879, 'n_words': 196, 'path': 'volcanic_island_model_demo.ipynb', 'repo_name': 'CU-Boulder-Computational-Geomorphology/volcanic-island-model', 'size': '2409'}