Python, Physics, Math, Statistics, Computer Science.
((sigma**2)/(2*(dx**2)) + (mu)/(2*dx)) b = -((sigma**2)/dx**2) c = ((sigma**2)/(2*(dx**2)) - (mu)/(2*dx)) return a, b, c # This function calculates the tridiagonal matrix Lambda. def compute_lambda( a,b,c,l ): a_col = np.ones(l)*a b_col = np.ones(l)*b c_col = np.ones(l)*c return scipy.sparse.diags(