Skip to content

MarkEhler/Sol_Sim_Final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sol-Sim Solar Energy Tool

TOC

  • app/ -- flask package files
  • run.py -- init file for flask package
  • Demo Video

Clearing the Cloudy Skies of Solar Energy

Power is something we, as Americans take for granted. "Where does it come from when I flip on the switch?" Isn't a question most of us think about, nor should we. Our children don't have to think about the billion dollar industry that supplies them with air conditioned schools. We ourselves have become addicted, not so much to screens, as the passage of electrons through our devices that lights them up. It's no wonder that the energy debate is a polarizing one.

At the time of writing this gas and oil companies are advertising that renewable energy's main detraction is it's unreliability. I think this is a false perception. If there is one thing I've learned from working with weather data, it's that people will never beat the machine in recalling historical weather data. It's fortunate that we have decades of weather data recorded; and even, solar energy data. Energy could be said to be surpassing other basic human rights in terms of profitability, and ethics of distribution becomes more and more center stage.

My goal with this project was to create a tool that could be used to give a machine informed plot of data for a specific location using solar and weather data to inform it's estimation. More insight into the ethos of this project can be found on my blog but the goal of this abtract is to familiarize you with the technical details of this app. My goal was to develop a prototype that could be further developed by a solar installation company or a tech service company providing renewable energy installers with tools to grow their business. Similar products as this one do exist. Project Sunroof by Google and Helioscope a paid for software solution by Folsom Labs. While Project Sunroof has taken account for what the industry calls a "shade analysis", it does not seem to adjust for Latitude and weather factors. It's my belief that the two apps could be used in tandem by solar hopefuls to inform their renewable decision.

It's Simple Astronomy

Data Harvested Piecemeal

All data was collected individually from NREL test sites across the United States. This took a fair amount of cajoling because each site uniquely labeled their data, most of them sensing unique values from one another that had to be converted or ignored.

Ultimately, it was important and reliable to collect the solar angles the sun traces across the sky and the temp. Later, known latitude and longitude of each site was added in. It would be possible, with more time and effort, to collect more weather data keyed off of a datetime index using nearby weather stations.

Icarus Was Right

At the center of our solar system lies a very large and very stable nuclear clock. The graphs of geometric values returned from the test sites having watched the sun were so beautiful to a statistician, almost too beautiful. It turns out that renewable energy is indeed reliable and hard to argue against.

The Sun, undeniably the most important factor in generating solar energy, is so reliable that astronomers can calculate where the great ball of fire will be in the sky at any time for any place. This produces wonderfully normal distributions of the sun's location in the sky. After doing feature analysis on some decision tree models, it is clear that the most important thing in solar production is where the sun is located. The industry knows this, so when installing new solar panels we look for what is called a 'solar window', a box in the sky that the sun travels through most of the days throughout most of the year.

Unexpected Scattered Showers

While working on this project there were a few sticking points. As it turns out, there are two ways of calculating Zenith angle. This project uses topocentric, meaning that there is no account for the sun's angle above or below the horizon, it will look the same either way. The model does an okay job accounting for this but nonetheless night time values were silenced on the final graph. Certain categorical features could be expressed with their own columns for getter accuracy but since I want to app to predict on locations that aren't present in the dataset, they have been left as float variables rather than one hot encoded as i would like to do.

I learned on this project that my most accurate model upon initial training, which was accurate to 80 Watts per meter squared, produced downright wacky plots when tested against newly gathered data user input.
**Why was that?**
Accuracy, as it turns out, isn't everything. I found that my dataset could not possibly account for all the factors accounting for solar energy from entirely new locations. In other words, my model had overfit. As I slackened the accuracy by 15 - 20 Watts per meter squared I found that my plots looked a lot more reasonable. What's more important, they still seemed responsive to the weather. In the end I was able to reclaim this accuracy by fine tuning my data, not my parameters, a key lesson in garbage in garbage out. The average error is resting at 77W/m^2 after 3 cross validations at the time of publishing.

The Sun Never Sleeps When it's Light Out

I'm still suspicious of my final model and would like to revise it before shipping as a for-profit tool. What I would expect would be a normal distribution of energy production. The hours from 9am to 3pm are known to produce peak power for energy that tapers while the sun is rising and setting. I had the solar equivalent of unhealthy self-body-image upon launching my tool below.
Above is a calendar from one of the test sites I used for sourcing my data. The three lines represent different types of received solar radiation. The one we are most concerned with is the red line. Knowing that I'm under reporting on weather data, I'm left with the astronomy of the sun as my most important features. I'm hard on myself but happy with this as a live app prototype. My main goal with this project was to educate, so if the sim needs a little refinement I can easily work on it. Rather, the focus should be on this apps ability to take complex astronomy and apply for practical use. I should hope that the app will speak for itself in that regard.

The natural gas industry will boast that their fuel burning plants are reliable. I would argue that the sun that has reliably powered life on this planet for eons will still be reliable even when the coal plants come tumbling down at the end of their shelf life.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published