School of Science & Engineering, AUI
Practical part
Solar Energy and Rainwater Harvesting Simulation in MATLAB
In this problem, you will develop a MATLAB script to analyze the relationship between solar energy
production and rainwater harvesting in Ifrane, Morocco. You will simulate weather conditions,
calculate the energy output of a 5 kW solar panel system, and estimate the total rainwater
collected over a year.
Initial investment is 40000 Dirham operational cost is 500DH in Year 1 and increase by 100DH ach
year over 10 years the energy cost 1DH for KWh
Objectives
1. Simulate hourly weather data for one year (8760 hours) with:
o Solar irradiance values (200–1000 W/m²).
o Rainfall levels (0–5 mm/h).
2. Compute solar energy production using the formula: P=η×A×GP where:
o P is power output (W).
o Η is panel efficiency (18%).
o A is the panel area (25 m²).
o G is irradiance (W/m²).
o If rainfall exceeds 2 mm/h, reduce efficiency by 20%.
3. Calculate total energy produced over the year in kWh.
4.
5. Estimate yearly rainwater harvesting using the formula: V=C×Ar×R
where:
o V is the total water collected (liters).
o C is the collection efficiency (85%).
o Ar is the rooftop area (100 m²).
o R is annual rainfall (1100 mm).
6. Plot results:
o Power output vs. time.
o Monthly rainwater collection.
Deliverables
• A MATLAB script that performs all calculations.
• A command window output displaying:
o Total yearly energy produced (kWh).
o Total yearly rainwater collected (liters).
2 plots:
o Power output over time.
o Rainwater collection per month.
Bonus Challenges
o Cashflow plot
• Modify the simulation to use real weather data instead of random values.
• Optimize panel efficiency based on temperature.
• Explore the impact of different panel sizes or locations.
4/4