How bhagath555/solar-analysis-tilt-surface works
Project Type and Purpose
• Type: A small open-source MATLAB computation library/tool.
• Purpose: Given geographic and tilt parameters plus monthly sunshine data, compute the total annual solar radiation on a tilted surface.
File Structure
• Top-level files:
– declination.m (calculates solar declination angle)
– sunshine_angle.m (computes incident angle based on tilt/orientation)
– monthly_rad.m (computes monthly radiation values per month)
– sunshine_hours.m (handles monthly sunshine-hours data)
– yearly_rad.m (orchestrator that calls the above to output annual sum)
• README.md explains usage, sample inputs, and expected outputs.
Main Components
a. Input Module
– Parameters: latitude (p), tilt angle (b), azimuth/orientation (g)
– Data array: monthly sunshine hours s_yr[1..12]
b. Core Function Modules (Processing Layer)
– declination.m
– sunshine_angle.m
– sunshine_hours.m
– monthly_rad.m
– yearly_rad.m (coordinates calls and aggregates results)
c. Output Module
– Annual radiation result (KWh/m²)
d. External/Extension Points (optional)
– Future GUI or CLI wrapper
– Integration into larger simulation pipelines
Relationships and Interactions
• Data Flow:
Inputs → declination.m → sunshine_angle.m → monthly_rad.m → yearly_rad.m → Output
• Call Graph:
– yearly_rad.m invokes:
• declination.m (to get daily declination angles over the year)
• sunshine_angle.m (for each month/day combination)
• sunshine_hours.m (to process or validate s_yr)
• monthly_rad.m (to compute kWh/m² per month)
– yearly_rad.m then sums monthly results into the final annual radiation.
• Pipeline nature (functional decomposition).
Important Patterns and Principles
• Single Responsibility: each .m file handles one calculation step.
• Data Pipeline: outputs of one function become inputs to the next.
• Stateless Functions: purely mathematical with no side effects—easy to test.
Technologies & Artifacts
• MATLAB scripting (.m files)
• README for usage examples and parameter definitions