Calculate solar zenith angle
24 次查看(过去 30 天)
显示 更早的评论
I want to calculate solar zenith angle for inputting a function. i tried with the available codes but didnt work out for me. Any references/guides for estimating solar zenith angle
2 个评论
回答(1 个)
Sam Chak
2022-5-16
I did a web search and found the formula. It's a little strange that your browser didn't show references/guides to calculate the solar zenith angle.
Anyhow, I also tried the code and it works:
prompt1 = "What is the value of the local latitude? ";
Phi = input(prompt1)
prompt2 = "What is the value of the current declination of the Sun? ";
delta = input(prompt2)
prompt3 = "What is the value of the hour angle, in the local solar time? ";
h = input(prompt3)
theta_s = acos(sin(Phi)*sin(delta) + cos(Phi)*cos(delta)*cos(h))
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1000000/image.png)
2 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!