# Adjustment of AssumptionsMaxNonlinearVariables which avoids both blocking and partial solutions

I write an application which calls Mathematica via API. However, as it turns out, I would need to manually tune

SetSystemOptions[SimplificationOptions->AssumptionsMaxNonlinearVariables->?]


in-between these calls for all this to work. Is there an algorithm which would at least very roughly adjust that value instead? Maybe as an alternative, I can reformulate the expressions somehow, so that there would be a single universal value of AssumptionsMaxNonlinearVariables? Not necessarily a perfect one, but a good one.

I do not need any extensive finetuning. I only want to avoid a huge ineffectiveness caused by large values of that variable (as in blocking for minutes on an equation which could otherwise be solved in a fraction of a second) and on the other hand, partial or incomplete solutions caused by its small values.

Example. This equation

Assuming[vF0 > 0 && vR0 > 0 && bFx > 0 && rho > 0 && aRx > 0 && bRm1 > 0 && bRm2 > 0 && bRis > 0 && bFx > bRm1 && bFx > bRm2 && bRis < (aRx*rho + vR0)^2/(2*bRm2) && (aRx*rho + bRm2*rho + vR0 - Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/bRm2 < (aRx*rho + bRm2*rho + vR0)/bRm2 && bRm1 < ∞ && bRm2 < ∞ && aRx < ∞ && bRm1 < ∞ && rho < ∞ && bRm1 < ∞ && bRm2 < ∞ && rho < ∞ && bRm1 < ∞ && vR0 < ∞ && bRm1 < ∞ && bRis < ∞ && bRm2 < ∞ && aRx < ∞ && rho < ∞ && vR0 < ∞ && bRm2 < ∞ && bRis < ∞ && bRm2 < ∞ && aRx < ∞ && rho < ∞ && vR0 < ∞, Simplify[vF0/bFx >= (aRx*bRm1*rho + bRm1*bRm2*rho + bRm1*vR0 - bRm1*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] + bRm2*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/(bRm1*bRm2)]]


simplifies (in a reasonable time, if at all) only if AssumptionsMaxNonlinearVariables <= 8. At the same time, Mathematica fully refines this equation

Assuming[0 < t && t < vF0/bFx && vF0 > 0 && vR0 > 0 && bFx > 0 && rho > 0 && aRx > 0 && bRm1 > 0 && bRm2 > 0 && bRis > 0 && bFx > bRm1 && bFx > bRm2 && bRis < (aRx*rho + vR0)^2/(2*bRm2) && (aRx*rho + bRm2*rho + vR0 - Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/bRm2 < (-1.*(0. - aRx*rho - bRm2*rho - vR0))/bRm2 && 0 < vF0/bFx && vF0/bFx < rho && rho < (aRx*rho + bRm2*rho + vR0 - Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/bRm2 && (aRx*rho + bRm2*rho + vR0 - Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/bRm2 < (aRx*bRm1*rho + bRm1*bRm2*rho + bRm1*vR0 - bRm1*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] + bRm2*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/(bRm1*bRm2), Refine[s[t] <= Piecewise[{{(aRx*t^2 + 2*t*vR0)/2, t >= 0 && t <= rho}, {(-(aRx*rho^2) - bRm2*rho^2 + 2*aRx*rho*t + 2*bRm2*rho*t - bRm2*t^2 + 2*t*vR0)/2, t >= rho && t <= (aRx*rho + bRm2*rho + vR0 - Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/bRm2}, {(2*bRis*bRm1*bRm2 - 2*bRis*bRm2^2 - 2*aRx^2*bRm1*rho^2 + 2*aRx^2*bRm2*rho^2 - 2*aRx*bRm1*bRm2*rho^2 + aRx*bRm2^2*rho^2 - bRm1*bRm2^2*rho^2 + 2*aRx*bRm1*bRm2*rho*t + 2*bRm1*bRm2^2*rho*t - bRm1*bRm2^2*t^2 - 4*aRx*bRm1*rho*vR0 + 4*aRx*bRm2*rho*vR0 - 2*bRm1*bRm2*rho*vR0 + 2*bRm2^2*rho*vR0 + 2*bRm1*bRm2*t*vR0 - 2*bRm1*vR0^2 + 2*bRm2*vR0^2 + 2*aRx*bRm1*rho*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] - 2*aRx*bRm2*rho*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] + 2*bRm1*bRm2*rho*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] - 2*bRm2^2*rho*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] - 2*bRm1*bRm2*t*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] + 2*bRm2^2*t*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] + 2*bRm1*vR0*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] - 2*bRm2*vR0*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/(2*bRm2^2), t >= (aRx*rho + bRm2*rho + vR0 - Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/bRm2 && t <= (aRx*bRm1*rho + bRm1*bRm2*rho + bRm1*vR0 - bRm1*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2] + bRm2*Sqrt[-2*bRis*bRm2 + (aRx*rho + vR0)^2])/(bRm1*bRm2)}}, 0], Element[s, Reals]]]


to s[t] <= (aRx*t^2 + 2*t*vR0)/2 only if AssumptionsMaxNonlinearVariables >= 10.