<jupyter_start><jupyter_text>solving linear advection equation with CFL no equal to 1<jupyter_code>import numpy as np

def linear_convection_cfl(nx, L=2.0, c=1.0, sigma=0.5, nt=20): 
    #sigma=CFL, nx= grid points, L=domain (no. of space steps)
    #c=convection speed, dt=teme-step size, nt=no. of time steps to compute
    
    d=L/(nx-1)
    x=np.linspace(0.0, L, num=nx)
    dt=sigma*dx/c
    u0=np.ones(nx)
    mask=np.where(np.logical_and(x>=0.5,x<=1.0))
    u0[mask]=2.0
    u=u0.copy()    
    for in in range(1,nt): # in range of number of time steps<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14915254237288136, 'fraction_numerical': 0.03728813559322034, 'mean_word_length': 3.6171875, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '91270', 'license': 'CC-BY-3.0', 'n_tokens_mistral': 264, 'n_tokens_neox': 258, 'n_words': 58, 'path': 'working/cflCondition.ipynb', 'repo_name': 'iamkundan/numerical-mooc', 'size': '590'}