Okay, let's create a simple interactive demonstration of the Jevons Paradox using HTML, CSS, and JavaScript.
This demo will allow you to control the "Efficiency" of a resource use (e.g., miles per gallon, watts per lumen). Based on a simple model, the demand for the service provided by that resource (e.g., miles driven, total light output) will increase as efficiency makes the service cheaper. The simulation will then show the total resource consumption.
We'll set up a scenario where the demand increase is significant enough to demonstrate the paradox (i.e., the rebound effect is > 100%).
HTML (index.html):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jevons Paradox Interactive Demo</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>Jevons Paradox Demo</h1>
<p>
The Jevons Paradox states that as technological efficiency increases the efficiency with which a resource is used, the *rate of consumption* of that resource will increase, rather than decrease.
</p>
<p>
This simple model illustrates the concept. As you increase the "Efficiency", the "Demand for Service" increases because the service becomes effectively cheaper. Observe how the "Total Resource Consumption" changes.
</p>
<div class="controls">
<label for="efficiencySlider">Efficiency (Units of Service per Unit of Resource):</label>
<input type="range" id="efficiencySlider" min="100" max="500" value="100" step="10">
<span id="efficiencyValue">100</span>
</div>
<div class="results">
<div class="metric">
<span class="label">Initial State (at Efficiency 100):</span>
<span class="value">Demand: <span id="initialDemandValue"></span>, Total Consumption: <span id="initialConsumptionValue"></span></span>
</div>
<div class="metric">
<span class="label">Current Efficiency:</span>
<span class="value" id="currentEfficiencyDisplay"></span>
</div>
<div class="metric">
<span class="label">Current Demand for Service:</span>
<span class="value" id="currentDemandValue"></span>
</div>
<div class="metric total-consumption">
<span class="label">Total Resource Consumption:</span>
<span class="value" id="totalConsumptionValue"></span>
</div>
<div class="explanation">
<p>
In this simulation:
<ul>
<li><strong>Efficiency</strong> is how much service you get per unit of resource (e.g., miles per gallon). Higher efficiency means less resource needed for the *same amount of service*.</li>
<li><strong>Demand for Service</strong> is the total amount of the service people want (e.g., total miles driven). This model assumes Demand *increases* significantly as Efficiency increases (service becomes cheaper).</li>
<li><strong>Total Resource Consumption</strong> is calculated as (Demand for Service) / (Efficiency). This shows the *total amount of the resource used*.</li>
</ul>
The Jevons Paradox is demonstrated if increasing efficiency leads to an *increase* in Total Resource Consumption.
</p>
</div>
</div>
</div>
<script src="script.js"></script>
</body>
</html>
CSS (style.css):
body {
font-family: sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f4f4f4;
color: #333;
}
.container {
max-width: 800px;
margin: 20px auto;
background-color: #fff;
padding: 30px;
border-radius: 8px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #0056b3;
}
p {
margin-bottom: 15px;
}
.controls {
margin: 25px 0;
padding: 15px;
background-color: #e9e9e9;
border-radius: 5px;
display: flex;
flex-direction: column;
align-items: flex-start;
}
.controls label {
font-weight: bold;
margin-bottom: 10px;
}
.controls input[type="range"] {
width: 100%;
margin-bottom: 10px;
}
.results {
margin-top: 25px;
padding: 15px;
border-top: 1px solid #ccc;
}
.metric {
margin-bottom: 10px;
padding: 8px;
background-color: #f9f9f9;
border-left: 4px solid #0056b3;
border-radius: 4px;
}
.metric .label {
font-weight: bold;
display: inline-block;
width: 250px; /* Align labels */
}
.metric .value {
font-weight: normal;
color: #555;
}
.total-consumption {
background-color: #d4edda; /* Highlight color */
border-left-color: #28a745; /* Green border */
font-size: 1.1em;
font-weight: bold;
margin-top: 20px;
}
.total-consumption .label,
.total-consumption .value {
color: #155724; /* Dark green text */
}
.explanation {
margin-top: 20px;
padding: 10px;
background-color: #f0f8ff;
border-left: 4px solid #add8e6;
border-radius: 4px;
font-size: 0.9em;
}
.explanation ul {
margin-top: 10px;
padding-left: 20px;
}
.explanation li {
margin-bottom: 5px;
}
JavaScript (script.js):
document.addEventListener('DOMContentLoaded', () => {
const efficiencySlider = document.getElementById('efficiencySlider');
const efficiencyValueSpan = document.getElementById('efficiencyValue');
const initialDemandValueSpan = document.getElementById('initialDemandValue');
const initialConsumptionValueSpan = document.getElementById('initialConsumptionValue');
const currentEfficiencyDisplaySpan = document.getElementById('currentEfficiencyDisplay');
const currentDemandValueSpan = document.getElementById('currentDemandValue');
const totalConsumptionValueSpan = document.getElementById('totalConsumptionValue');
// --- Simulation Parameters ---
const initialEfficiency = parseFloat(efficiencySlider.min); // Get base efficiency from slider min
const initialDemand = 1000; // Base demand at initial efficiency
// This parameter determines how much demand increases as efficiency increases.
// A value > 1 (or > 100%) for the 'demand increase sensitivity' relative to
// the 'efficiency increase' can lead to the Jevons paradox.
// We'll use a simple multiplier relative to the *percentage* efficiency increase.
// Let's say for every 1% increase in efficiency, demand increases by 1.5%.
const demandIncreaseSensitivity = 1.5; // If this is > 1, Jevons paradox is likely
// --- Initial Calculation and Display ---
const initialConsumption = initialDemand / initialEfficiency;
initialDemandValueSpan.textContent = initialDemand.toFixed(0);
initialConsumptionValueSpan.textContent = initialConsumption.toFixed(2);
// Set initial values on display
efficiencyValueSpan.textContent = initialEfficiency;
currentEfficiencyDisplaySpan.textContent = initialEfficiency;
currentDemandValueSpan.textContent = initialDemand.toFixed(0);
totalConsumptionValueSpan.textContent = initialConsumption.toFixed(2);
// --- Update Function ---
function updateSimulation() {
const currentEfficiency = parseFloat(efficiencySlider.value);
efficiencyValueSpan.textContent = currentEfficiency; // Update slider value display
currentEfficiencyDisplaySpan.textContent = currentEfficiency; // Update current efficiency display
// Calculate percentage increase in efficiency relative to the initial state
const efficiencyIncreaseFactor = (currentEfficiency / initialEfficiency) - 1; // 0 at initial efficiency
// Calculate current demand based on initial demand and efficiency increase sensitivity
// Demand = Initial Demand * (1 + DemandIncreaseSensitivity * EfficiencyIncreaseFactor)
// This models that as efficiency goes up (EfficiencyIncreaseFactor increases), demand goes up.
// If demandIncreaseSensitivity > 1, demand grows faster than efficiency.
const currentDemand = initialDemand * (1 + demandIncreaseSensitivity * efficiencyIncreaseFactor);
// Calculate total resource consumption
// Consumption = Demand / Efficiency
const totalConsumption = currentDemand / currentEfficiency;
// Update display values
currentDemandValueSpan.textContent = currentDemand.toFixed(0); // Round demand for simplicity
totalConsumptionValueSpan.textContent = totalConsumption.toFixed(2); // Show consumption with decimals
}
// --- Event Listener ---
efficiencySlider.addEventListener('input', updateSimulation);
// Initial call to set up the display
updateSimulation();
});
How it Works:
- HTML: Sets up the structure: a title, explanations, a slider for controlling "Efficiency", and display areas (
<span> elements with IDs) for showing the values of Efficiency, Demand for Service, and Total Resource Consumption.
- CSS: Provides basic styling to make the page readable and visually organize the information. It highlights the "Total Resource Consumption" as the key output.
- JavaScript:
- Waits for the DOM to be fully loaded.
- Gets references to all the necessary HTML elements.
- Defines core parameters:
initialEfficiency, initialDemand, and demandIncreaseSensitivity. The demandIncreaseSensitivity is the crucial parameter determining how much demand reacts to increased efficiency. Setting it greater than 1 models the rebound effect being strong enough to potentially cause the paradox.
- Calculates and displays the initial state (at the minimum efficiency).
- The
updateSimulation function is the core logic:
- It reads the current value from the efficiency slider.
- It calculates how much efficiency has increased relative to the initial state (as a factor).
- It calculates the
currentDemand using the initialDemand and the demandIncreaseSensitivity. The formula initialDemand * (1 + demandIncreaseSensitivity * efficiencyIncreaseFactor) means that demand increases proportionally to the efficiency increase, scaled by demandIncreaseSensitivity. If demandIncreaseSensitivity is, say, 1.5, and efficiency increases by 100% (doubles), demand increases by 1.5 * 100% = 150% (becomes 2.5 times the initial demand).
- It calculates
totalConsumption as currentDemand / currentEfficiency. This is the amount of resource units needed to meet the calculated demand at the current efficiency level.
- It updates the corresponding HTML elements to display these calculated values.
- An event listener is attached to the efficiency slider. Every time the slider's value changes (
input event), the updateSimulation function is called, making the numbers update in real-time.
updateSimulation() is called once when the page loads to set the initial state.
To Use:
- Save the three code blocks above as
index.html, style.css, and script.js in the same folder.
- Open
index.html in your web browser.
- Move the "Efficiency" slider and observe how the "Current Demand for Service" and, most importantly, the "Total Resource Consumption" values change.
You should see that as you increase the efficiency slider from the initial value (100), the total resource consumption initially stays the same or increases slightly, and then often increases significantly as efficiency gets much higher, demonstrating the Jevons Paradox.