exponential_growth.exponential_growth

exponential_growth.exponential_growth(initial_value, growth_rate, time)

Calculate exponential growth over a specified time period.

This function computes the value after exponential growth using the formula:

N(t) = N0 * exp(r * t)

Parameters

Name Type Description Default
initial_value float The starting value at time t = 0. Must be positive. required
growth_rate float The continuous growth rate (decimal, not percentage). Positive values indicate growth; negative values indicate decay. required
time float The time period over which growth occurs. Must be non-negative. required

Returns

Name Type Description
float The calculated value after exponential growth.

Raises

Name Type Description
TypeError If any input is not numeric.
ValueError If any input is NaN, infinite, or violates constraints.
OverflowError If the calculation results in overflow.

Examples

>>> from biomathhh.exponential_growth import exponential_growth
>>> exponential_growth(50, 0.1, 0)
50.0
>>> round(exponential_growth(100, 0.05, 10), 6)
164.872127
>>> round(exponential_growth(1000, -0.03, 5), 6)
860.707976