Differential Equations Calculator

Differential Equations Calculator (Growth & Decay)

Use positive for growth, negative for decay (e.g., 0.05 or -0.1)

Result


Understanding First-Order Differential Equations

A first-order differential equation involves a function and its first derivative. One of the most common applications in physics, biology, and chemistry is the Exponential Growth and Decay model. This model is governed by the differential equation:

dy / dt = ky

In this equation, y represents the quantity at time t, and k is the proportionality constant (the rate). When you solve this differential equation using separation of variables, you arrive at the general solution used in this calculator.

The Solution Formula

To find the value of a quantity at any given time, we use the integrated form of the differential equation:

y(t) = y₀ * e^(kt)

  • y(t): The final quantity after time t.
  • y₀: The initial value or starting amount.
  • e: Euler's number (approximately 2.71828).
  • k: The rate constant (positive for growth, negative for decay).
  • t: The time interval.

Real-World Examples

Example 1: Bacterial Growth (Positive k)
If a bacterial culture starts with 500 cells and grows at a rate of 0.3 per hour, what is the population after 5 hours?
Calculation: y(5) = 500 * e^(0.3 * 5) = 500 * e^1.5 ≈ 2,240 cells.

Example 2: Radioactive Decay (Negative k)
A radioactive substance starts with 100 grams and has a decay constant of -0.02 per year. How much remains after 50 years?
Calculation: y(50) = 100 * e^(-0.02 * 50) = 100 * e^-1 ≈ 36.78 grams.

How to Use This Calculator

  1. Enter the Initial Value (y₀) of the substance or population you are measuring.
  2. Input the Rate Constant (k). Use a decimal format. For example, 5% growth is 0.05.
  3. Enter the Time (t) that has passed. Ensure the time unit matches the rate (e.g., if the rate is per hour, time should be in hours).
  4. Click "Solve for y(t)" to see the final value based on the continuous growth/decay model.
function calculateDifferentialEquation() { var y0 = parseFloat(document.getElementById('initialValue').value); var k = parseFloat(document.getElementById('growthRate').value); var t = parseFloat(document.getElementById('timeDuration').value); var resultContainer = document.getElementById('calcResultContainer'); var finalResultText = document.getElementById('finalResult'); var formulaText = document.getElementById('formulaUsed'); if (isNaN(y0) || isNaN(k) || isNaN(t)) { alert("Please provide valid numeric inputs for all fields."); return; } // Calculation logic: y(t) = y0 * e^(kt) var exponent = k * t; var ePower = Math.exp(exponent); var finalY = y0 * ePower; // Formatting output var formattedResult = finalY.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 4 }); finalResultText.innerHTML = "y(" + t + ") = " + formattedResult; formulaText.innerHTML = "Calculation: " + y0 + " * e^(" + k + " * " + t + ")"; // Show results resultContainer.style.display = "block"; }

Leave a Comment