Math Relationship Explorer - Logistic Function
Edit Math Relationship Explorer in p5.js Editor
About This MicroSim
This interactive MicroSim helps students understand the logistic function and its mathematical properties through hands-on parameter manipulation. The logistic function is fundamental in modeling growth processes, population dynamics, neural network activation functions, and probability in logistic regression.
The Logistic Function
Where:
- L (carrying capacity): The maximum value the function approaches as x approaches infinity
- k (steepness/growth rate): Controls how quickly the function transitions from 0 to L
- x_0 (midpoint): The x-value where f(x) = L/2 (the inflection point)
Key Mathematical Properties
-
Horizontal Asymptotes: y = 0 (as x approaches negative infinity) and y = L (as x approaches positive infinity)
-
Inflection Point: Located at (x_0, L/2) where the curve changes from concave up to concave down
-
Derivative: The derivative of the logistic function has a particularly elegant form: \(\(f'(x) = k \cdot f(x) \cdot \left(1 - \frac{f(x)}{L}\right)\)\)
-
Maximum Slope: The steepest part of the curve occurs at the inflection point, with slope = kL/4
Key Features
- Animated Parameter Changes: Smooth transitions when adjusting parameters
- Tangent Line Visualization: Draggable point shows instantaneous rate of change
- Integration Area: Shaded region shows definite integral with numerical value
- Derivative Curve: Scaled derivative overlaid on the function
- Mathematical Annotations: Carrying capacity, inflection point, and asymptotes labeled
Controls
| Control | Range | Default | Description |
|---|---|---|---|
| L (carrying capacity) | 0.5 - 15 | 10 | Maximum value of the function |
| k (steepness) | 0.1 - 3 | 1 | Growth rate parameter |
| x_0 (midpoint) | -8 to 8 | 0 | Horizontal shift (inflection point location) |
| Tangent at x | -8 to 8 | 0 | Position of tangent line |
| Integration start | -10 to 10 | -5 | Left bound for integral calculation |
| Integration end | -10 to 10 | 5 | Right bound for integral calculation |
| Show Tangent | On/Off | On | Toggle tangent line display |
| Show Integral | On/Off | On | Toggle shaded integral area |
| Show Annotations | On/Off | On | Toggle mathematical annotations |
| Show Derivative | On/Off | On | Toggle derivative curve |
| Random Parameters | Button | - | Generates random L, k, x_0 values |
Embedding This MicroSim
1 2 3 4 | |
Lesson Plan
Learning Objectives
By the end of this activity, students will be able to:
- Remember: Identify the parameters L, k, and x_0 in the logistic function equation
- Understand: Explain how each parameter affects the shape and position of the curve
- Apply: Predict the behavior of a logistic function given specific parameter values
- Analyze: Design MicroSims that reveal mathematical relationships through parameter manipulation
Prerequisite Knowledge
- Understanding of exponential functions (e^x)
- Basic concept of limits and asymptotes
- Familiarity with derivatives as rate of change
- Understanding of definite integrals as area under a curve
Suggested Activities
Activity 1: Parameter Exploration (10 minutes)
- Set L = 10, k = 1, x_0 = 0 (defaults). Observe the S-curve shape.
- Change L from 5 to 15. What changes? What stays the same?
- Return L to 10. Now vary k from 0.5 to 2.5. Describe the effect.
- With k = 1, shift x_0 from -5 to 5. What moves?
- Write a sentence describing what each parameter controls.
Activity 2: Derivative Investigation (10 minutes)
- Enable "Show Derivative" and "Show Tangent"
- Move the tangent point from x = -5 to x = 5
- Where is the slope maximum? How does this relate to the derivative curve?
- Set k = 0.5, then k = 2. How does this affect the maximum slope?
- Verify that the maximum slope equals kL/4 for different parameter values
Activity 3: Integration Exploration (10 minutes)
- Enable "Show Integral" with bounds from -5 to 5
- Keep L = 10, vary x_0. Does the integral value change significantly?
- Now change L. How does the integral scale?
- Set narrow bounds (e.g., -1 to 1) around the inflection point. What portion of the total area does this capture?
Activity 4: Real-World Modeling (15 minutes)
Choose a scenario and find parameters that model it:
| Scenario | Characteristic |
|---|---|
| Virus spread in a population | L = total population, k relates to infection rate |
| Learning curve | L = maximum skill level, k = learning speed |
| Technology adoption | L = market size, x_0 = time of fastest growth |
| Enzyme reaction rate | L = maximum rate, k = enzyme efficiency |
Assessment Questions
-
If L = 8 and x_0 = 2, what is f(2)? What is the significance of this value?
-
A population model has L = 1000, k = 0.5, x_0 = 10. At what time is the population growing fastest?
-
How would you modify the parameters to create a steeper transition that occurs earlier (more negative x)?
-
The derivative f'(x) = k * f(x) * (1 - f(x)/L) is zero when f(x) = 0 or f(x) = L. Explain why this makes sense graphically.
-
What is the integral of the logistic function from negative infinity to positive infinity approaching?
Key Insights
- Parameter Independence: L controls height, k controls steepness, x_0 controls position - they work independently
- Symmetry: The logistic function is symmetric around its inflection point
- Self-Reference: The derivative depends on the function value itself, making it useful for modeling self-limiting growth
- Universal Shape: Despite different parameters, all logistic functions have the same characteristic S-shape
- Rate vs. Accumulation: The derivative shows instantaneous rate of change; the integral shows total accumulation
Applications
The logistic function appears in many fields:
- Biology: Population growth, epidemic modeling, enzyme kinetics
- Machine Learning: Sigmoid activation function, logistic regression
- Economics: Technology adoption curves, market saturation
- Chemistry: Reaction kinetics, titration curves
- Psychology: Learning curves, response probability
p5.js Editor Template
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |