From e11579bf0e48de8f09d068d7154480aca98f3fa9 Mon Sep 17 00:00:00 2001 From: CallumJHays Date: Sun, 24 Oct 2021 19:32:15 +1000 Subject: [PATCH] fix: patch to avoid bug --- mathpad/simulate_dynamic_system.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mathpad/simulate_dynamic_system.py b/mathpad/simulate_dynamic_system.py index a94ecf4..969f80c 100644 --- a/mathpad/simulate_dynamic_system.py +++ b/mathpad/simulate_dynamic_system.py @@ -37,6 +37,7 @@ def simulate_dynamic_system( plot_static: bool = False, plot_static_figsize: Tuple[int, int] = (960, 400), plot_title: str = "Solution #{solutionNo}", + _NEW_SOLVE: bool = False # TODO: fix this properly ) -> List[List[Tuple[float, List[float]]]]: "simulates a differential system specified by dynamics_equations from initial conditions at x_axis=0 (typically t=0) to x_final" @@ -125,11 +126,11 @@ def simulate_dynamic_system( solutions = sympy.solve( [eqn.as_sympy_eq() for eqn in problem_eqns], - solve_for, + solve_for if _NEW_SOLVE else solve_for_highest_derivatives, dict=True, ) - assert any(solutions), "sympy solving failed!" + assert any(solutions), "No Solution Found" _print_if(verbose, "Solving finished.") all_data = []