Friday, June 15, 2018

Maine Teacher Workshop on Artificial Intelligence in Engineering Education

In June 10-12, we hosted a successful teacher professional development workshop in York, Maine for 29 teachers from seven states. The theme was around the application of artificial intelligence (AI) in engineering education to assist teaching and foster learning. The workshop was supported by generous funding from General Motors and the National Science Foundation.

The teachers explored how the AI tools built in Energy3D could help students learn STEM concepts and skills required by the Next Generation Science Standards (NGSS), especially engineering design. Together we brainstormed how AI applications such as generative design might change their teaching. We believed that AI could transform STEM education from the following four aspects: (1) augment students with tools that accelerate problem solving, thereby supporting them to explore more broadly; (2) identify cognitive gaps between students' current knowledge and the learning goals, thereby enabling them to learn more deeply; (3) suggest alternative solutions beyond students' current work, thereby spurring them to think more creatively; and (4) assess students' performance by computing the distances between their solutions and the optimal ones, thereby providing formative feedback during the design process. The activities that the teachers tried were situated in the context of building science and solar engineering, facilitated by our Solarize Your World Curriculum. We presented examples that demonstrated the affordances of AI for supporting learning and teaching along the above four directions, especially in engineering design (which is highly open-ended). Teachers first learned how to design a solar farm in the conventional way and then learned how to accomplish the same task in the AI way, which -- in theory -- can lead to broader exploration, deeper understanding, better solutions, and faster feedback.

View my PowerPoint slides for more information.

Friday, June 1, 2018

Generative Design of Concentrated Solar Power Towers

In a sense, design is about choosing parameters. All the parameters available for adjustment form the basis of the multi-dimensional solution space. The ranges within which the parameters are allowed to change, often due to constraints, sets the volume of the feasible region of the solution space where the designer is supposed to work. Parametric design is, to some extent, a way to convert design processes or subprocesses into algorithms for varying the parameters in order to automatically generate a variety of designs. Once such algorithms are established, users can easily create new designs by tweaking parameters without having to repeat the entire process manually. The reliance on computer algorithms to manipulate design elements is called parametricism in modern architecture.

Parametricism allows people to use a computer to generate a lot of designs for evaluation, comparison, and selection. If the choice of the parameters is driven by a genetic algorithm, then the computer will also be able to spontaneously evolve the designs towards one or more objectives. In this article, I use the design of the heliostat field of a concentrated solar power tower as an example to illustrate how this type of generative design may be used to search for optimal designs in engineering practice. As always, I recorded a screencast video that used the daily total output of such a power plant on June 22 as the objective function to speed up the calculation. The evaluation and ranking of different solutions in the real world must use the annual output or profit as the objective function. For the purpose of demonstration, the simulations that I have run for writing this article were all based on a rather coarse grid (only four points per heliostat) and a pretty large time step (only once per hour for solar radiation calculation). In real-world applications, a much more fine-grained grid and a much smaller time step should be used to increase the accuracy of the calculation of the objective function.

Video: The animation of a generative design process of a heliostat field on an area of 75m×75m for a hypothetical solar power tower in Phoenix, AZ.

Figure 1: A parametric model of the sunflower.
Heliostat fields can take many forms (the radial stagger layout with different heliostat packing density in multiple zones seems to be the dominant one). One of my earlier (and naïve) attempts was to treat the coordinates of every heliostat as parameters and use genetic algorithms to find optimal coordinates. In principle, there is nothing wrong with this approach. In reality, however, the algorithm tends to generate a lot of heliostat layouts that appear to be random distributions (later on, I realized that the problem is as challenging as protein folding if you know what it is -- when there are a lot of heliostats, there are just too many local optima that can easily trap a genetic algorithm to the extent that it would probably never find the global optimum within the computational time frame that we can imagine). While a "messy" layout might in fact generate more electricity than a "neat" one, it is highly unlikely that a serious engineer would recommend such a solution and a serious manager would approve it, especially for large projects that cost hundreds of million of dollars to construct. For one thing, a seemingly stochastic distribution would not present the beauty of the Ivanpah Solar Power Facility through the lens of the famed photographers like Jamey Stillings.

In this article, I chose a biomimetic pattern proposed by Noone, Torrilhon, and Mitsos in 2012 based on Fermat's spiral as the template. The Fermat spiral can be expressed as a simple parametric equation, which in its discrete form has two parameters: a divergence parameter β that specifies the angle the next point should rotate and a radial parameter b that specifies how far the point should be away from the origin, as shown in Figure 1.

Figure 2: Possible heliostat field patterns based on Fermat's spiral.
When β = 137.508° (the so-called golden angle), we arrive at Vogel's model that shows the pattern of florets like the ones we see in sunflowers and daisies (Figure 1). Before using a genetic algorithm, I first explored the design possibilities manually by using the spiral layout manager I wrote for Energy3D. Figure 2 shows some of the interesting patterns I came up with that appear to be sufficiently distinct. These patterns may give us some ideas about the solution space.
Figure 3: Standard genetic algorithm result.
Figure 4: Micro genetic algorithm result.

Then I used the standard genetic algorithm to find a viable solution. In this study, I allowed only four parameters to change: the divergence parameter β, the width and height of the heliostats (which affect the radial parameter b), and the radial expansion ratio (the degree to which the radial distance of the next heliostat should be relative to that of the current one in order to evaluate how much the packing density of the heliostats should decrease with respect to the distance from the tower). Figure 3 shows the result after evaluating 200 different patterns, which seems to have converged to the sunflower pattern. The corresponding divergence parameter β was found to be 139.215°, the size of the heliostats to be 4.63m×3.16m, and the radial expansion ratio to be 0.0003. Note that the difference between β and the golden angle cannot be used alone as the criterion to judge the resemblance of the pattern to the sunflower pattern as the distribution also depends on the size of the heliostat, which affects the parameter b.

I also tried the micro genetic algorithm. Figure 4 shows the best result after evaluating 200 patterns, which looks quite similar to Figure 3 but performs slightly less. The corresponding divergence parameter β was found to be 132.600°, the size of the heliostats to be 4.56m×3.17m, and the radial expansion ratio to be 0.00033.

In conclusion, genetic algorithms seem to be able to generate Fermat spiral patterns that resemble the sunflower pattern, judged from the looks of the final patterns.

Thursday, May 24, 2018

Using Artificial Intelligence to Design a Solar Farm

Everyone loves to maximize the return of investment (ROI). If you can effortlessly find a solution that pays a higher profit -- even only a few dollars more handsomely, why not? The problem is that, in many complicated engineering cases in the real world, such as designing a solar farm, we often don't know exactly what the optimal solutions are. We may know how to get some good solutions based on what textbooks or experts say, but no one in the world can be 100% sure that there aren't any better ones waiting to be discovered beyond the solution space that we have explored. As humans, we can easily get complacent and settled with the solutions that we feel good about, leaving the job (and the reward) of finding better solutions to another time or someone else.

Artificial intelligence (AI) is about to change all that. As design is essentially an evolution of solutions, AI techniques such as genetic algorithms (GA) are an excellent fit to the nature of many design problems and can generate a rich variety of competitive designs in the same way genetics does for biology (no two leaves are the same but they both work). These powerful tools have the potential to help people learn, design, and discover new things. In this article, I demonstrate how GA can be used to design a photovoltaic (PV) solar farm. As always, I first provide a short screencast video in which I used the daily output or profit as the objective function to speed up the animation so that you can see the evolution driven by GA. The actual assessments are based on using the annual output or profit as the objective function, presented in the text that follows the video. Note that the design process is still geared towards a single objective (i.e., the total output in kWh or the total profit in dollars over a given period of time). Design problems with multiple objectives will be covered later.

In GA, the solution depends largely on the choice of the objective function (or the fitness function), which specifies how the main goal is calculated. For example, if the main goal is to generate as much electricity as possible on a given piece of land without the concern of the cost of the solar panels, a design in which the solar panels are closely packed may be a good choice. On the other hand, if the main goal is to generate as much electricity as possible from each individual solar panel because of their high price, a design in which rows of solar panels are far away from one another would be a good choice. Unsurprisingly, in the case shown in the video, a single row of solar panels was found as the best solution. Aiming at maximizing the profit, the real-world problems always lie between these two extremes, which is why they must be solved using the principles of engineering design. The video above clearly illustrates the design evolution driven by GA in the three cases (the two extremes and an intermediate).

Figure 1. An Energy3D model of an existing solar farm in Massachusetts.
To test the usefulness of the GA implementation in Energy3D for solving real-world problems, I picked an existing solar farm in Massachusetts (Figure 1) to see if GA could find better solutions. A 3D model of the solar farm had been created in the Virtual Solar Grid based on the information shown on Google Maps and its annual output calculated using Energy3D. Because I couldn't be exactly sure about the tilt angle, I also tweaked it a bit manually and ensured that an optimal tilt angle for the array be chosen (I found it to be around 32° in this case). The existing solar farm has 4,542 solar panels, capable of generating 2,255 MWh of electricity each year, based on the analysis result of Energy3D. [I must declare here that the selection of this site was purely for the purpose of scientific research and any opinion expressed as a result of this research should be viewed as exploratory and should not be considered as any kind of evaluation of the existing solar farm and its designer(s). There might be other factors beyond my comprehension that caused a designer to choose a particular trade-off. The purpose of this article is to show that, if we know all the factors needed to be considered in such a design task, we can use AI to augment our intelligence, patience, and diligence.]

Figure 2. The results of 10 iterations.
Energy3D has a tool that allows the user to draw a polygon within which the solar farm should be designed. This polygon is marked by white lines. Using this tool, we can ensure that our solutions will always be confined to the specified area. I used this tool to set the boundary of the solar farm under design. This took care of an important spatial constraint and guaranteed that GA would always generate solutions on approximately the same land parcel as is situated by the existing solar farm.

For the objective function, we can select the total annual output, the average annual output of a solar panel, or the annual profit. I chose the annual profit and assumed that the generated electricity would sell for 22.5 cents per kWh (the 2018 average retail price in Massachusetts) and the daily cost of a solar panel (summing up the cost of maintenance, financing, and so on) would be 20 cents. I didn't know how accurate these ROI numbers would be. But let's just go with them for now. The annual profit is the total sale income minus the total operational cost. Qualitatively, we know that a higher electricity price and a lower operational cost would both favor using more solar panels whereas a lower electricity price and a higher operational cost would both favor using less solar panels. Finding the sweet spots in the middle requires quantitative analyses and comparisons of many different cases, which can be outsourced to AI.

Figure 3: The best design from 2,000 solutions
Figure 4: The second best design from 2,000 solutions.
In Energy3D, GA always starts with the current design as part of the first generation (so if you already have a good design, it will converge quickly). In order for GA not to inherit anything from the existing solar farm, I created an initial model that had only a rack with a few solar panels on it and a zero tilt angle. The size of the population was set to be 20. So at the beginning, this initial model would compete with 19 randomly generated solutions and was almost guaranteed to lose the chance to enter the next generation. In order to stop and check the results, I let GA run for only 10 generations. For convenience, let's call every 10 generations of GA evolution an iteration. Figure 2 shows that GA generated solutions below the supposed human performance in the first two iterations but quickly surpassed it after that. The solution kept improving but got stuck in iterations 5-7 and then it advanced again and stagnated again in iterations 8-10. This process could continue indefinitely, but I decided to terminate it after 10 iterations, or 100 generations. By this time, the software had generated and evaluated 2,000 solutions, which took a few hours as it had to run 2,000 annual simulations for thousands of solar panels.

The best solution (Figure 3) that emerged from these 2,000 generated solutions used 5,420 solar panels fixed at a tilt angle of 28.3° to generate 2,667 MWh per year and was about 16% better than the existing one based on the ROI model described above. The second best solution (Figure 4) used 4,670 solar panels fixed at a tilt angle of 38.6° to generate 2,340 MWh per year and was about 5.5% better than the existing one based on the ROI model. Note that if we use the average annual output per solar panel as the criterion, the second best solution would actually be better than the best one, but we know that the average panel output is not a good choice for the fitness function as it can result in an optimal solution with very few solar panels.

In conclusion, the generative design tools in Energy3D powered by AI can be used to search a large volume of the solution space and find a number of different solutions for the designer to pick and choose. The ability of AI to transcend human limitations in complex design is a significant application of AI and cannot be more exciting! We predict that future work will rely more and more on this power and today's students should be ready for the big time.

Friday, May 18, 2018

Using Artificial Intelligence to Design Energy-Efficient Buildings

The National Science Foundation issued a statement on May 10, 2018 in which the agency envisions that "The effects of AI will be profound. To stay competitive, all companies will, to some extent, have to become AI companies. We are striving to create AI that works for them, and for all Americans." This is probably the strongest message and the clearest matching order from a top science agency in the world about a particular area of research thus far. The application of AI to the field of design, and more broadly, creativity, is considered by many as the moonshot of the ongoing AI revolution, which is why I have chosen to dedicate a considerable portion of my time and effort to this strategically important area.

I have added two more application categories of using genetic algorithms (GAs) to assist engineering design in Energy3D, the main platform based on which I am striving to create a "designerly brain." One example is to find the optimal position to add a new building with glass curtain walls to an open space in an existing urban block so that the new building would use the least amount of energy. The other example is to find the optimal sizes of the windows on different sides of a building so that the building would use the least amount of energy. To give you a quick idea about how GAs work in these cases, I recorded the following two screencast videos from Energy3D. To speed up the search processes visualized in the videos, I chose the daily energy use as the objective function and only optimized for the winter condition. The solutions optimized for the annual energy use are shown later in this article.

Figure 1: A location of the building recommended by GA if it is in Boston.
Figure 2: A location of the building recommended by GA if it is in Phoenix.
For the first example, the energy use of a building in an urban block depends on how much solar energy it receives. In the winter, solar energy is good for the building as it warms up the building and saves the heating energy. In the summer, excessive heating caused by solar energy must be removed through air conditioning, increasing the energy use. The exact amount of energy use per year depends on a lot of other factors such as the fenestration of the building, its insulation, and its size. In this demo, we only focus on searching a good location for a building with everything else fixed. I chose a population with 32 individuals and let GA run for only five generations. Figures 1 and 2 show the final solutions for Boston (a heating-dominant area) and Phoenix (a cooling-dominant area), respectively. Not surprisingly, the GA results suggest that the new building be placed in a location that has more solar access for the Boston case and in location that has less solar access for the Phoenix case.

Figure 3: Window sizes of a building recommended by GA for Chicago.
Figure 4: Window sizes of a building recommended by GA for Phoenix.
For the second example, the energy use of a building depends on how much solar energy it receives through the windows and how much thermal energy transfers through the windows (since windows typically have less thermal resistance than walls). In the winter, while a larger window allows more solar energy to shine into the building and warm it up during the day, it also allows more thermal energy to escape through the larger area, especially at night. In the summer, both solar radiation and heat transfer through a larger window will contribute to the increase of the energy needed to cool the building. And this complicated relationship changes when the solution is designed for a different climate. Figures 3 and 4 show the final solutions for Chicago and Phoenix as suggested by the GA results, respectively. Note that not all GA results are acceptable solutions, but they can play advisory roles during a design process, especially for novice designers who do not have anyone to consult with.

In conclusion, artificial intelligence such as GA provides automated procedures that can help designers find optimal solutions more efficiently and thereby free them up from tedious, repetitive tasks if an exhaustive search of the solution space is necessary. Energy3D provides an accessible platform that integrates design, visualization, and simulation seamlessly to demonstrate these potential and capabilities. Our next step is to figure out how to translate this power into instructional intelligence that can help students and designers develop their abilities of creative thinking.

Monday, February 19, 2018

Virtual Solar Grid adds Crescent Dunes Solar Tower

The Crescent Dues Solar Tower as modeled in Energy3D
A light field visualization in Energy3D
A top view
The Crescent Dunes Solar Power Tower is a 110 MW utility-scale concentrated solar power (CSP) plant with 1.1 GWh of molten salt energy storage, located about 190 miles northwest of Las Vegas in the United States (watch a video about it). The plant includes a whopping number of 10,347 large heliostats that collect and focus sunlight onto a central receiver at the top of a 195-meter tall tower to heat 32,000 tons of molten salt. The molten salt circulates from the tower to some storage tanks, where it is then used to produce steam and generate electricity. Excess thermal energy is stored in the molten salt and can be used to generate power for up to ten hours, providing electricity in the evening or during cloudy hours. Unlike other CSP plants, Crescent Dunes' advanced storage technology eliminates the need for any backup fossil fuels to melt the salt and jumpstart the plant in the morning. Each heliostat is made up of 35 6×6 feet (1.8 m) mirror facets, adding up to a total aperture of 115.7 square meters. The total solar field aperture sums to an area of 1,196,778 square meters, or more than one square kilometer, in a land area of 1,670 acres (6.8 square kilometers). That is, the plant is capable of potentially collecting one seventh of all the solar energy that shines onto the field. Costing about $1 billion to construct, it was commissioned in September 2015.

A close-up view of accurate modeling of heliostat tracking
Since its inception in January 2018, our Virtual Solar Grid has included the Energy3D models of nearly all the existing large CSP power plants in the world. That covers more than 80 large CSP plants capable of generating more than 11 TWh per year. The ultimate goal of the Virtual Solar Grid is to mirror every solar energy system in the world in the computing cloud through crowdsourcing involving a large number of students interested in engineering, creating an unprecedentedly detailed computational model for learning how to design a reliable and resilient power grid based completely on renewable energy (solar energy in this phase). The modeling of the Crescent Dunes plant has put our Energy3D software to a stress test. Can it handle such a complex project with so many heliostats in such a large field?
A side view

Near the base of the tower
Over the shoulder of the tower
The solar field
This became my President's Day project. To make this happen, I had to first increase the resolution of Google Maps images supported in Energy3D. A free developer account of Google Maps can only get images of 640 × 640 pixels. When you are looking at an area that is as big as a few square kilometers, that resolution gets you very blurry images. To fetch high-resolution images from Google without paying them, I had to basically make Energy3D download many more images and then knit them together to create a large image that forms an Earth canvas in Energy3D (hence you see a lot of Google logos and copyrights in the ground image that I could not get rid of from each patch). Once I had the Earth canvas, I then drew heliostats on top of it (that is, one by one for more than 10,000 times!) and compared their orientations and shadows rendered by Energy3D with those shown in the Google Maps images. Now, the problem is that Google doesn't tell you when the satellite image was taken. But based on the shadows of the tower and other structures, I could easily figure out an approximate time and date. I then set that time and date in Energy3D and confirmed that the shadow of the tower in the Energy3D model overlaps with that in the satellite image. After this calibration, every single virtual heliostat that I copied and pasted then automatically aligned with those in the satellite image (as long as the original copy specifies the tower that it points to), visually testifying that the tracking algorithm for the virtual heliostats in Energy3D is just as good as the one used by the computers that control the motions of the real-world heliostats. Matching the computer model with the satellite image is essential as the procedure ensures the accuracy of our numerical simulation.

The solar field
After making numerous other improvements for Energy3D, the latest version (V7.8.4) was finally capable of modeling this colossal power plant. This includes the capability of being able to divide the whole project into nine smaller projects and then allow Energy3D to stitch the smaller 3D models together to create the full model using the Import Tool. This divide-and-conquer method makes the user interface a lot faster as neither you nor Energy3D need to deal with 9,000 existing heliostats while you are adding the last 1,000. The predicted annual output of the plant by Energy3D is 462 GWh, as opposed to the official projection of 500 GWh, assuming 90% of mirror reflectance and 25% of thermal-to-electric conversion.

One thing I had to do, though, was to double the memory requirement for the software from the default 256 MB to 512 MB for the Windows version (the Mac version is fine), which would make the software fail on really old computers that have only 256 MB of total memory (but I don't think such old computers would still work properly today anyways). The implication of this change is that, if you are a Windows user and have installed Energy3D before, you will need to re-install it using the latest installer from our website in order to take advantage of this update. If you are not sure, there is a way to know how much memory your Energy3D is allocated by checking the System Information and Preferences under the File Menu. If that number is about 250 MB, then you have to re-install the software -- if you really want to see the spectacular Crescent Dunes model in Energy3D without crashing it.

With basically only the three Ivanpah Solar Towers left to be modeled and uploaded, the Virtual Solar Grid has nearly incorporated all the operational solar thermal power plants in the world. We will continue to add new CSP plants as they come online and show up in Google Maps. In our next phase, we will move to add more photovoltaic (PV) solar power plants to the Virtual Solar Grid. At this point, the proportion of the modeled capacity from PV stands at only 8% in the Virtual Solar Grid, compared with 92% from CSP. Adding PV power plants will really require crowdsourcing as there are many more PV projects in the world -- there are potentially millions of small rooftop systems in existence. On a separate avenue, the National Renewable Energy Laboratory (NREL) has estimated that, if we add solar panels to every square feet of usable roof area in the U.S., we could meet 40% of our total electricity need. Is their statement realistic? Perhaps only time can tell, but by adding more and more virtual solar power systems to the Virtual Solar Grid, we might be able to tell sooner.

Monday, January 29, 2018

Virtual Solar Grid comes online

Fig. 1: Modeled output of the Virtual Solar Grid
Fig. 2: A residential rooftop PV system.
If you care about finding renewable energy solutions to environmental problems, you probably would like to join an international community of Energy3D users to model existing or design new solar power systems in the real world and contribute them to the Virtual Solar Grid — a hypothetical power grid that I am developing from scratch to model and simulate interconnected solar energy systems and storage. My ultimate goal is to crowdsource an unprecedented fine-grained, time-dependent, and multi-scale computational model for anyone, believer or skeptic of renewables, to study how much of humanity's energy need can be met by solar power generation on the global scale — independent of any authority and in the spirit of citizen science. I have blogged about this ambitious plan before and I am finally pleased to announce that an alpha version of the Virtual Solar Grid has come online, of course, with a very humble beginning.

Fig. 3: The Micky Mouse solar farm in Orlando, FL.
Fig. 4: NOOR-1 parabolic troughs in Morocco.
As of the end of January, 2018, the Virtual Solar Grid has included 3D models of only a bit more than 100 solar energy systems, ranging from small rooftop photovoltaic solar panel arrays (10 kW) to large utility-scale concentrated solar power plants (100 MW) in multiple continents. At present, the Virtual Solar Grid has a lot of small systems in Massachusetts because we are working with many schools in the state.

With this initial capacity, the Virtual Solar Grid is capable of generating roughly 4 TWh per year, approximately 0.02% of all the electricity consumed by the entire world population in 2016 (a little more than 2 PWh). Although 0.02% is too minuscule to count, it nonetheless marks the starting point of our journey towards an important goal of engaging and supporting anyone to explore the solar energy potential of our planet with serious engineering design. In a sense, you can think of this work as inventing a "Power Minecraft" that would entice people to participate in a virtual quest for switching humanity's power supply to 100% renewable energy.

Fig. 5: Khi Solar One solar power tower in South Africa.
Fig. 6: PS 10 and PS 20 in Spain.
The critical infrastructure underlying the Virtual Solar Grid is our free, versatile Energy3D software that allows anyone from a middle school student to a graduate school student to model or design any photovoltaic or concentrated solar power systems, down to the exact location and specs of individual solar panels or heliostats. Performance analysis of solar power systems in Energy3D is based on a growing database of solar panel brand models and weather data sets for nearly 700 regions in every habitable continent. To construct a grid, micro or global, an Energy3D model can be geotagged — the geolocation is automatically set when you import a Google Maps image into an Energy3D model. Such a virtual model, when uploaded to the Virtual Solar Grid, will be deployed to a Google Maps application that shows exactly where it is in the world and how much electricity it produces at a given hour on a given day under average weather conditions. This information will be used to investigate how solar power and other renewables, with thermal and electric storage, can be used to provide base loads and meet peak demands for a power grid of an arbitrary size, so to speak.

Finally, it is important to note that the Virtual Solar Grid project is generously funded by the U.S. National Science Foundation through grant number #1721054. Their continuous support of my work is deeply appreciated.