Hi, I'm very new to C++ and programming in general, and I'm trying to solve a particular problem involving the calculation of the mean annual solar radiation on a slope of given angle, aspect, longitude and latitude over a certain time range.
In order to do this I am using the Solar Position Algorithm (SPA) as my base to generate the data I need for the position of the sun. Once I have this I can use data generated from that for another formula that generates the solar radiation on the slope.
However, the problem is that I have 3000 sites (each site has a value for longitude, latitude, slope angle and slope aspect) and for each site I need to apply the SPA at every 20 minute interval throughout the time period (probably over 1 year).
I need a way to be able to input a list of variables in sets of 4 (long. , lat. , angle, aspect) and output the mean annual solar radiation on that slope by summing the individual values and dividing by the number of 20 minute intervals in my time period.
I know that one part of this is possible by using loops, for example to keep generating SPA data and adding 20mins to my variable as the variable update in my "for" loop, but I don't know how to get the program to keep doing this, generate the data and then move onto the next set of data (long, lat, angle, aspect) and display all of the data in a readable format, possibly even as a graph comparing these variables.
I'm obviously not asking for anyone to write out the entire code, but it would be amazing if someone could point me in the right direction in terms of which aspects of C++ I would be using for something like this, as I don't have the experience to know the capabilities of C++ or which functions or characteristics of C would be most beneficial...
I have attached the source code for the SPA as well as the relevant header file and a tester file.
Thank you for your help