<commit_before># parameters for pirates - 

######################################################
## DOMAIN \Omega = (x_1, x_2) x (y_1, y_2)
######################################################

x_1 = 0. # minimum value for x
x_2 = 10. # maximum value for x

y_1 = 0. # minimum value for y
y_2 = 20. # maximum value for y

######################################################
## MESH SIZES
## n_x = number of cells in the x-direction
## n_y = number of cells in the y-direction
######################################################

n_x = 200 # integer
n_y = 100 # integer


######################################################
## TIME of simulation
######################################################

tMax = 10. # time of simulation

######################################################
## EQUATION FOR rho (pirates)
######################################################

# Initial Datum for rho (density of piracy)
def InitialDatum_rho (x, y):
    return x*y

# normalization function kappa
def kappa(x):
    eps = 0.2
    v_max = 1.

    A1 = numpy.zeros_like(x)
    A2 = v_max * (x >= 1) / x
    A3 = v_max * numpy.logical_and(x > eps, x < 1) * (x - eps) / (1 - eps)
    
    return A1 + A2 + A3

# coefficients a_i for definition of f (len = M)
a = [1., 1.5, 2.] 


######################################################
## EQUATION FOR A (ships)
######################################################

# Initial Datum for A (density of ships)
def InitialDatum_A (x, y):
    A1 = numpy.logical_and(2 <= x, x <=4) * numpy.ones_like(x) * numpy.logical_and(2 <= y, y <=4) * numpy.ones_like(y)
    A2 = numpy.logical_and(2 <= x, x <=4) * numpy.ones_like(x) * numpy.logical_and(8 <= y, y <=12) * numpy.ones_like(y)
    return A1 + A2

# speed of ships
def speed_ships(A):
    A_max = 1. # maximum density
    v_max = 1. # maximum speed
    return v_max - A/A_max

# geometric vector speed
def nu(x,y):
    x_mesh, y_mesh = numpy.meshgrid(x, y)
    nu_x = numpy.ones_like(x_mesh + y_mesh)
    nu_y = numpy.zeros_like(x_mesh + y_mesh)

    return (nu_x, nu_y)
<commit_msg>Correct error in kappa function<commit_after># parameters for pirates - 

######################################################
## DOMAIN \Omega = (x_1, x_2) x (y_1, y_2)
######################################################

x_1 = 0. # minimum value for x
x_2 = 10. # maximum value for x

y_1 = 0. # minimum value for y
y_2 = 20. # maximum value for y

######################################################
## MESH SIZES
## n_x = number of cells in the x-direction
## n_y = number of cells in the y-direction
######################################################

n_x = 200 # integer
n_y = 100 # integer


######################################################
## TIME of simulation
######################################################

tMax = 10. # time of simulation

######################################################
## EQUATION FOR rho (pirates)
######################################################

# Initial Datum for rho (density of piracy)
def InitialDatum_rho (x, y):
    return x*y

# normalization function kappa
def kappa(x):
    eps = 0.2
    v_max = 1.

    A1 = (x >= 1) * x + (x < 1) * 1
    A2 = v_max * (x < 1) * 0 / A1
    A3 = v_max * numpy.logical_and(x > eps, x < 1) * (x - eps) / (1 - eps)
    
    return A2 + A3

# coefficients a_i for definition of f (len = M)
a = [1., 1.5, 2.] 


######################################################
## EQUATION FOR A (ships)
######################################################

# Initial Datum for A (density of ships)
def InitialDatum_A (x, y):
    A1 = numpy.logical_and(2 <= x, x <=4) * numpy.ones_like(x) * numpy.logical_and(2 <= y, y <=4) * numpy.ones_like(y)
    A2 = numpy.logical_and(2 <= x, x <=4) * numpy.ones_like(x) * numpy.logical_and(8 <= y, y <=12) * numpy.ones_like(y)
    return A1 + A2

# speed of ships
def speed_ships(A):
    A_max = 1. # maximum density
    v_max = 1. # maximum speed
    return v_max - A/A_max

# geometric vector speed
def nu(x,y):
    x_mesh, y_mesh = numpy.meshgrid(x, y)
    nu_x = numpy.ones_like(x_mesh + y_mesh)
    nu_y = numpy.zeros_like(x_mesh + y_mesh)

    return (nu_x, nu_y)

{'fraction_non_alphanumeric': 0.35765379113018597, 'fraction_numerical': 0.026227944682880304, 'mean_word_length': 4.0299760191846525, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 7, '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}}
{'dir': 'git-commits-cleaned', 'id': '1984397', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1355, 'n_words': 405}