What is the best way to check if a parameter increase in a mathematical expression increases or decreases the expression as a whole (in Python, preferably SymPy)?
Assumptions: all parameters are positive (i.e. > 0).
Example A*B/(A+C)
: A
should be found as proportional to the expression and C
should be found as inverse proportional.
One obvious solution would be to assign 1 to all parameters, 1 and 100 to C respectively and apply eval()
, but that is very crude and might yield errors (e.g. with (A-B)/C
where the best case would be to give an error instead of a wrong result).