From 05f77a67d93207a4622f720ac10bfcab9cac1d11 Mon Sep 17 00:00:00 2001
From: Archie Shah <103347688+Archiesachin@users.noreply.github.com>
Date: Mon, 10 Jun 2024 23:21:07 +0530
Subject: [PATCH] Added Solar Power Saving Calculator (#1195)
---
.../Solar-Power-Saving-Calculator/README.md | 17 ++++
.../Solar-Power-Saving-Calculator/index.html | 66 ++++++++++++++
.../Solar-Power-Saving-Calculator/script.js | 89 +++++++++++++++++++
.../Solar-Power-Saving-Calculator/style.css | 56 ++++++++++++
index.html | 14 +++
5 files changed, 242 insertions(+)
create mode 100644 Calculators/Solar-Power-Saving-Calculator/README.md
create mode 100644 Calculators/Solar-Power-Saving-Calculator/index.html
create mode 100644 Calculators/Solar-Power-Saving-Calculator/script.js
create mode 100644 Calculators/Solar-Power-Saving-Calculator/style.css
diff --git a/Calculators/Solar-Power-Saving-Calculator/README.md b/Calculators/Solar-Power-Saving-Calculator/README.md
new file mode 100644
index 000000000..66bfea1ff
--- /dev/null
+++ b/Calculators/Solar-Power-Saving-Calculator/README.md
@@ -0,0 +1,17 @@
+#
Solar Power Saving Calculator
+
+## Description :-
+
+A Solar Power Savings Calculator helps users estimate the potential savings from installing solar panels on their property. This tool considers various factors such as local solar insolation (sunlight exposure), electricity consumption, current electricity rates, and the cost of solar installation to provide an estimate of both short-term and long-term financial benefits.
+
+## Tech Stacks :-
+
+- HTML
+- CSS
+- JavaScript
+
+## Screenshots :-
+
+![image](https://github.com/Rakesh9100/CalcDiverse/assets/73993775/46452036-92d7-4a72-aa96-6c44936b14da)
+
+![image](https://github.com/Rakesh9100/CalcDiverse/assets/73993775/6476cf0f-0666-4dc9-b0b5-2b6d28bbcb95)
diff --git a/Calculators/Solar-Power-Saving-Calculator/index.html b/Calculators/Solar-Power-Saving-Calculator/index.html
new file mode 100644
index 000000000..ee421554b
--- /dev/null
+++ b/Calculators/Solar-Power-Saving-Calculator/index.html
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ Solar Power Saving Calculator
+
+
+ Solar Power Saving Calculator
+
+
+
+
+
+
+
diff --git a/Calculators/Solar-Power-Saving-Calculator/script.js b/Calculators/Solar-Power-Saving-Calculator/script.js
new file mode 100644
index 000000000..035b27dfd
--- /dev/null
+++ b/Calculators/Solar-Power-Saving-Calculator/script.js
@@ -0,0 +1,89 @@
+const stateData = {
+ maharashtra: {
+ avgSunHours: 5.5,
+ electricityRate: 8,
+ co2Reduction: 0.85,
+ installationCost: 100000,
+ incentives: 20000
+ },
+ karnataka: {
+ avgSunHours: 5.8,
+ electricityRate: 7.5,
+ co2Reduction: 0.82,
+ installationCost: 95000,
+ incentives: 15000
+ },
+ rajasthan: {
+ avgSunHours: 6.0,
+ electricityRate: 7,
+ co2Reduction: 0.88,
+ installationCost: 90000,
+ incentives: 18000
+ },
+ tamilnadu: {
+ avgSunHours: 5.6,
+ electricityRate: 8.2,
+ co2Reduction: 0.83,
+ installationCost: 110000,
+ incentives: 22000
+ },
+ gujarat: {
+ avgSunHours: 5.9,
+ electricityRate: 7.8,
+ co2Reduction: 0.86,
+ installationCost: 105000,
+ incentives: 21000
+ },
+ // Add more states as needed
+};
+
+function updateStateData() {
+ const state = document.getElementById('state').value;
+ if (stateData[state]) {
+ document.getElementById('installationCost').value = stateData[state].installationCost;
+ document.getElementById('incentives').value = stateData[state].incentives;
+ } else {
+ document.getElementById('installationCost').value = '';
+ document.getElementById('incentives').value = '';
+ }
+}
+
+function calculateSavings() {
+ const state = document.getElementById('state').value;
+ const roofArea = parseFloat(document.getElementById('roofArea').value);
+ const roofOrientation = document.getElementById('roofOrientation').value;
+ const electricityConsumption = parseFloat(document.getElementById('electricityConsumption').value);
+ const systemSize = parseFloat(document.getElementById('systemSize').value);
+ const installationCost = parseFloat(document.getElementById('installationCost').value);
+ const incentives = parseFloat(document.getElementById('incentives').value);
+ const financingOptions = document.getElementById('financingOptions').value;
+
+ const avgSunHoursPerDay = stateData[state].avgSunHours;
+ const electricityRate = stateData[state].electricityRate;
+ const co2ReductionPerKWh = stateData[state].co2Reduction;
+
+ const systemEfficiency = 0.75; // Efficiency of the solar system
+
+ // Annual energy production calculation
+ const annualEnergyProduction = systemSize * avgSunHoursPerDay * 365 * systemEfficiency;
+
+ // Annual savings calculation
+ const annualSavings = annualEnergyProduction * electricityRate;
+
+ // Payback period calculation
+ const netInstallationCost = installationCost - incentives;
+ const paybackPeriod = netInstallationCost / annualSavings;
+
+ // Lifetime savings calculation
+ const lifetimeSavings = annualSavings * 25; // Assuming a 25-year lifespan
+
+ // Environmental impact calculation
+ const annualCo2Reduction = annualEnergyProduction * co2ReductionPerKWh;
+
+ // Display results
+ document.getElementById('annualEnergyProduction').innerText = `Annual Energy Production: ${annualEnergyProduction.toFixed(2)} kWh`;
+ document.getElementById('annualSavings').innerText = `Annual Savings: ₹${annualSavings.toFixed(2)}`;
+ document.getElementById('paybackPeriod').innerText = `Payback Period: ${paybackPeriod.toFixed(2)} years`;
+ document.getElementById('lifetimeSavings').innerText = `Total Lifetime Savings: ₹${lifetimeSavings.toFixed(2)}`;
+ document.getElementById('environmentalImpact').innerText = `Environmental Impact: ${annualCo2Reduction.toFixed(2)} kg CO2 avoided annually`;
+}
diff --git a/Calculators/Solar-Power-Saving-Calculator/style.css b/Calculators/Solar-Power-Saving-Calculator/style.css
new file mode 100644
index 000000000..612ff52a7
--- /dev/null
+++ b/Calculators/Solar-Power-Saving-Calculator/style.css
@@ -0,0 +1,56 @@
+body {
+ font-family: Arial, sans-serif;
+ margin: 20px;
+ background: slateblue;
+}
+
+h1 {
+ text-align: center;
+}
+
+form {
+ max-width: 600px;
+ margin: 0 auto;
+ padding: 20px;
+ border: 1px solid #ccc;
+ border-radius: 10px;
+ background-color: #f9f9f9;
+}
+
+.form-group {
+ margin-bottom: 15px;
+}
+
+label {
+ display: block;
+ margin-bottom: 5px;
+}
+
+input[type="text"],
+input[type="number"],
+select {
+ width: 100%;
+ padding: 8px;
+ box-sizing: border-box;
+}
+
+button {
+ padding: 10px 20px;
+ background-color: slateblue;
+ color: white;
+ border: none;
+ cursor: pointer;
+}
+
+.results {
+ max-width: 600px;
+ margin: 20px auto;
+ padding: 20px;
+ border: 1px solid #ccc;
+ border-radius: 10px;
+ background-color: #f9f9f9;
+}
+
+.results p {
+ margin: 5px 0;
+}
diff --git a/index.html b/index.html
index 9fe758128..0dda634ab 100644
--- a/index.html
+++ b/index.html
@@ -2570,6 +2570,20 @@ Calculator that determines whether a given number is a Smith number or not.<
+
+
+
Solar Power Saving Calculator
+ Calculates the amount one can save on electricity by installing solar panels.
+
+
+