Exemplo n.º 1
0
def delta_icsd_forward_solution_matrix(depths, diameter, sigma_above):
    """ Docstring found below """
    num_depths, h, z, r_sq, it = utils.get_forward_solution_variables(depths, diameter, sigma_above)

    result = numpy.matrix(numpy.empty((num_depths, num_depths), dtype=numpy.float64))
    for i, j in itertools.product(range(num_depths), range(num_depths)):
        result[j, i] = (h / 2.0) * (
            (numpy.sqrt((z[j] - z[i]) ** 2 + r_sq) - abs(z[j] - z[i]))
            + it * (numpy.sqrt((z[j] + z[i]) ** 2 + r_sq) - abs(z[j] + z[i]))
        )
    return result
Exemplo n.º 2
0
def step_icsd_forward_solution_matrix(depths, diameter, sigma_above):
    ''' Docstring found below '''
    num_depths, h, z, r_sq, it = utils.get_forward_solution_variables(
            depths, diameter, sigma_above)

    result = numpy.matrix(numpy.empty((num_depths, num_depths), 
            dtype=numpy.float64))
    for i, j in itertools.product(range(num_depths), range(num_depths)):
        ub = z[i] + (h/2.0)
        lb = z[i] - (h/2.0)
        this_result = (1/4.0)*(
                source_term_one(z[j], r_sq, z=ub) -
                source_term_one(z[j], r_sq, z=lb) -
                source_term_two(z[j], ub=ub, lb=lb) +
                image_term(it=it, j=z[j], r_sq=r_sq, z=ub) - 
                image_term(it=it, j=z[j], r_sq=r_sq, z=lb)) 
        result[j,i] = this_result
    return result