1616
1717import cmath
1818
19+
1920def compute_characteristic_roots (
2021 a : float , b : float , c : float
2122) -> tuple [complex , complex ]:
2223 """
2324 Compute characteristic roots for a second-order homogeneous linear DE.
2425 a, b, c -> coefficients
25-
26+
2627 >>> compute_characteristic_roots(1, -3, 2)
2728 (2.0, 1.0)
2829 >>> compute_characteristic_roots(1, 2, 5)
@@ -69,7 +70,7 @@ def compute_wronskian(
6970 function_2 : Callable [[float ], float ],
7071 derivative_1 : Callable [[float ], float ],
7172 derivative_2 : Callable [[float ], float ],
72- evaluation_point : float
73+ evaluation_point : float ,
7374) -> float :
7475 """
7576 Compute the Wronskian of two functions at a given point.
@@ -84,7 +85,9 @@ def compute_wronskian(
8485 Returns:
8586 float: Value of the Wronskian at the given point.
8687 """
87- return function_1 (evaluation_point ) * derivative_2 (evaluation_point ) - function_2 (evaluation_point ) * derivative_1 (evaluation_point )
88+ return function_1 (evaluation_point ) * derivative_2 (evaluation_point ) - function_2 (
89+ evaluation_point
90+ ) * derivative_1 (evaluation_point )
8891
8992
9093def construct_general_solution (root1 : complex , root2 : complex ) -> str :
@@ -112,7 +115,7 @@ def analyze_differential_equation(a: float, b: float, c: float) -> None:
112115 """
113116 Analyze the DE and print the roots, type, and general solution.
114117 a, b, c -> coefficients
115-
118+
116119 >>> analyze_differential_equation(1, -3, 2) # doctest: +ELLIPSIS
117120 Characteristic Roots: (2.0, 1.0)
118121 Solution Type: Distinct Real Roots
@@ -150,4 +153,3 @@ def main() -> None:
150153
151154if __name__ == "__main__" :
152155 main () # doctest: +SKIP
153-
0 commit comments