Skip to content

Commit

Permalink
Put time constraint on elimination step in EWSB
Browse files Browse the repository at this point in the history
in case a substitution leads to non-polynomial
EWSB equations that cannot be handled
  • Loading branch information
Dylan Harries committed Dec 6, 2016
1 parent 6548bb8 commit bb988b0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions meta/EWSB.m
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@
IsNoSolution[expr_] :=
Head[expr] === Solve || Flatten[expr] === {};

TimeConstrainedEliminate[eqs_List, par_] :=
Module[{result},
result = TimeConstrained[Eliminate[eqs, par],
FlexibleSUSY`FSSolveEWSBTimeConstraint, {}];
If[result === {},
DebugPrint["unable to eliminate ", par, ": ", eqs];
];
result
];

TimeConstrainedSolve[eq_, par_] :=
Module[{result, independentEq = eq, Selector},
If[Head[eq] === List,
Expand Down Expand Up @@ -388,10 +398,10 @@
];
DebugPrint["eliminate ", p1, " and solve for ", p2, ": ", {eq1, eq2}];
reduction[[1]] =
TimeConstrainedSolve[Eliminate[{eq1, eq2}, p1], p2];
TimeConstrainedSolve[TimeConstrainedEliminate[{eq1, eq2}, p1], p2];
DebugPrint["eliminate ", p2, " and solve for ", p1, ": ", {eq1, eq2}];
reduction[[2]] =
TimeConstrainedSolve[Eliminate[{eq1, eq2}, p2], p1];
TimeConstrainedSolve[TimeConstrainedEliminate[{eq1, eq2}, p2], p1];
If[IsNoSolution[reduction[[1]]] || IsNoSolution[reduction[[2]]],
DebugPrint["Failed"];
Return[{}];
Expand Down

0 comments on commit bb988b0

Please sign in to comment.