Skip to content

Commit ee7d5cb

Browse files
Update wronskian_second_order_de.py
1 parent 4bbaafc commit ee7d5cb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

maths/wronskian_second_order_de.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
wronskian_second_order_de.py
3-
A symbolic and numerical exploration of the Wronskian for second-order linear differential equations.
3+
A symbolic and numerical exploration of the Wronskian
4+
for second-order linear differential equations.
45
56
This program:
67
1. Takes coefficients (a, b, c) for a*y'' + b*y' + c*y = 0.
@@ -65,12 +66,14 @@ def classify_solution_type(root1: complex, root2: complex) -> str:
6566
return "Distinct Real Roots"
6667

6768

69+
from typing import Callable
70+
6871
def compute_wronskian(
6972
function_1: Callable[[float], float],
7073
function_2: Callable[[float], float],
7174
derivative_1: Callable[[float], float],
7275
derivative_2: Callable[[float], float],
73-
evaluation_point: float,
76+
evaluation_point: float
7477
) -> float:
7578
"""
7679
Compute the Wronskian of two functions at a given point.
@@ -85,9 +88,8 @@ def compute_wronskian(
8588
Returns:
8689
float: Value of the Wronskian at the given point.
8790
"""
88-
return function_1(evaluation_point) * derivative_2(evaluation_point) - function_2(
89-
evaluation_point
90-
) * derivative_1(evaluation_point)
91+
return function_1(evaluation_point) * derivative_2(evaluation_point) - \
92+
function_2(evaluation_point) * derivative_1(evaluation_point)
9193

9294

9395
def construct_general_solution(root1: complex, root2: complex) -> str:
@@ -153,3 +155,4 @@ def main() -> None:
153155

154156
if __name__ == "__main__":
155157
main() # doctest: +SKIP
158+

0 commit comments

Comments
 (0)