From 4653a9d746ed1529d831616db8d2ed54696f2370 Mon Sep 17 00:00:00 2001 From: wallbryce Date: Fri, 29 Aug 2025 11:23:25 -0600 Subject: [PATCH 1/2] Fixed division in quadroots.py --- utils/quadroots.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/quadroots.py b/utils/quadroots.py index 460f2b1..4cb77ed 100644 --- a/utils/quadroots.py +++ b/utils/quadroots.py @@ -21,7 +21,7 @@ def quadroots(a, b, c): Roots of the equation. """ - x1 = (-b + np.sqrt(b**2 - 4*a*c))/2*a - x2 = (-b - np.sqrt(b**2 - 4*a*c))/2*a + x1 = (-b + np.sqrt(b**2 - 4*a*c))/(2*a) + x2 = (-b - np.sqrt(b**2 - 4*a*c))/(2*a) return (x1, x2) From 8be2b598ba5555562adfe7cbdd2185899a034645 Mon Sep 17 00:00:00 2001 From: wallbryce Date: Fri, 29 Aug 2025 12:31:47 -0600 Subject: [PATCH 2/2] added docstring to chebD(n) --- utils/chebutils.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/utils/chebutils.py b/utils/chebutils.py index 0d7e38a..cf47567 100644 --- a/utils/chebutils.py +++ b/utils/chebutils.py @@ -2,8 +2,19 @@ def chebD(n): """ - Hint: https://people.maths.ox.ac.uk/trefethen/book.pdf, Chapter 6, pages - 51-55. + Computes a spectral differentiation matrix and Chebysev grid + + Parameters + ---------- + n: + An integer defining the number of grid points (n+1) + + Returns + ------- + D: (n+1)x(n+1) matrix + differentiation matrix + x: (n+1)-d array + Chebysev grid """ if n == 0: x = 1; D = 0; w = 0