I need help with my function file
Ältere Kommentare anzeigen
function [SEA] = solarelevation(phi, L, n, T)
%--------------------------------------------------------------------------
% Author(s):
% Date: Day-Month-Year (e.g, 13-Feb-2015)
%--------------------------------------------------------------------------
% Function Description:
% ---Inputs---
% Input1: phi - Latitude in degrees
% Input2: L - Longitude of degrees
% Input3: A -
% Inout4: z - height in Km
% Input5: dayOfYear
% Input6: Time hours in calc
% ---Outputs---
% Output1:SEA - Solar elevation angle
%%Step 1: Calculate D, solar declination
%
% slove for d
d = ((n-1)*360)/365.242;
%solve for l inin degrees
l = 279.9348 + d; % sole for l in deg
% solve for sigma in degrees
sigma = l + 0.4087*sind(l) + 1.8724*cosd(l) - 0.0812*sind(2*l) + ...
0.0083*cosd(2*l);
% solve for sin D in degrees
D = asind( sind(23.44383) * sind(sigma));
% Calculate M
M = 12 + 0.123570*sind(d) - 0.004289*cosd(d) + 0.153809*sind(2*d)...
+0.060783*cosd(2*d);
% Solar Angle
h = 15 .* (T - M) - L;
SEA = asind( sind(phi)*sind(D) + cosd(phi)*cosd(D)*cosd(h) );
3 Kommentare
Avee Patel
am 5 Nov. 2018
per isakson
am 5 Nov. 2018
per isakson
am 5 Nov. 2018
I replaced this text, "where i am using h...where i am using h = 15 .* (t-m) - l it says matrix dimension must agree", in the Tags box by solar and elevation
Antworten (0)
Kategorien
Mehr zu Gravitation, Cosmology & Astrophysics finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!