Skip to content

Commit

Permalink
fix: patch to avoid bug
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumJHays committed Oct 24, 2021
1 parent 1ec2d92 commit e11579b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mathpad/simulate_dynamic_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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 = []
Expand Down

0 comments on commit e11579b

Please sign in to comment.