Exponential Equation¶
- exponential_equation(first_constant, second_constant, precision=4)¶
Generates an exponential function to provide evaluations at variable inputs
- Parameters
first_constant (int or float) – Constant multiple of the resultant exponential function; if zero, it will be converted to a small, non-zero decimal value (e.g., 0.0001)
second_constant (int or float) – Base rate of variable of the resultant exponential function; if zero, it will be converted to a small, non-zero decimal value (e.g., 0.0001)
precision (int, default=4) – Maximum number of digits that can appear after the decimal place of the resultant roots
- Raises
TypeError – First two arguments must be integers or floats
ValueError – Last argument must be a positive integer
- Returns
evaluation – Function for evaluating an exponential equation when passed any integer or float argument
- Return type
func
See also
exponential_derivatives(),exponential_integral(),exponential_roots(),exponential_model()Notes
Standard form of an exponential function: \(f(x) = a\cdot{b^x}\)
Examples
- Import exponential_equation function from regressions library
>>> from regressions.analyses.equations.exponential import exponential_equation
- Create an exponential function with coefficients 2 and 3, then evaluate it at 10
>>> evaluation_first = exponential_equation(2, 3) >>> print(evaluation_first(10)) 118098.0
- Create an exponential function with coefficients -2 and 3, then evaluate it at 10
>>> evaluation_second = exponential_equation(-2, 3) >>> print(evaluation_second(10)) -118098.0
- Create an exponential function with all inputs set to 0, then evaluate it at 10
>>> evaluation_zero = exponential_equation(0, 0) >>> print(evaluation_zero(10)) 0.0001