From 988717825b29901dff1ac22432be1372434badd7 Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Wed, 10 Sep 2025 10:44:31 -0600 Subject: Added fsolve with lambda fundtion --- tutorials/module_2/2_num_methods_1.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tutorials/module_2/2_num_methods_1.md') diff --git a/tutorials/module_2/2_num_methods_1.md b/tutorials/module_2/2_num_methods_1.md index 1ab4fa8..d50088c 100644 --- a/tutorials/module_2/2_num_methods_1.md +++ b/tutorials/module_2/2_num_methods_1.md @@ -30,6 +30,14 @@ solution = fsolve(equations, initial_guess) print("Solution:", solution) ``` +```python +from scipy.optimize import fsolve + +f = lambda x: x**3-100*x**2-x+100 + +fsolve(f, [2, 80]) +``` + ## root from SciPy ```python from scipy.optimize import root -- cgit v1.2.3