Ladybug + Galapagos Basic Tutorial

As part of my latest project (with team members Moises Robles and Stephen Gonzales) I wanted to jump into environmental analysis and form optimization.  Using Ladybug and Galapagos within Grasshopper we performed a radiation analysis of the floor plates within an example tower project that included a parametric shutter facade.  Although we used a random value for this optimization, ideal solar radiation could be found for any building and plugged in to optimize.

There are many tools out there to do this kind of work, but grasshopper is free (and the analysis suite is open source!) making it the perfect tool for my needs.  Beyond that, the parametric nature of analysis and optimization using this method will be an important part of my workflow for a thesis project next year (more details coming soon).  Included below is a tutorial that follows the steps I used in analysis and optimization, as well as displays of the final results.  Time permitting, I will include a video next week that gives a bit more detail and explanation of the process.  Below are example Grasshopper files that will allow you to view the script and follow along with the tutorial.

Grasshopper example file 1- https://drive.google.com/file/d/0B_2XBV7ImCpwbzZBSEtLNW9IU3c/view?usp=sharing

Grasshopper example file 2- https://drive.google.com/file/d/0B_2XBV7ImCpwelRrOTV0UndIb2s/view?usp=sharing

This tutorial will show how to implement the Ladybug Plugin and Galapagos component together using Rhino 5Grasshopper, and Ladybug.

Download and installation instructions can be found here.

This is an example of how the result will look after you run your Galapagos component:

Galapagos Editor - Test 2

INPUT
The input includes:

Epw data imported from the ‘import epw file’ component.

epwmaincomp

Geometry you wish to have analyzed. We used the floor plates and the facade system in our tower.

floorplates           facade

Galapagos Component – This component has two inputs: Genome, which are variables within your definition that affect your results you are trying to analyze, and a fitness number. The fitness number is a value that you tell Galapagos to try and solve towards.

galap

Variables for Galapagos to optimize. For the tower, we chose to optimize the amount of rows the facade will have, as well as the actual opening of the individual cells. The correct combination of these will give us the optimum efficiency of the facade.

gridsettingshutting param

Fitness number- More like a ‘limit’ that Galapagos attempts to optimize towards. We took a radiation study from the Ladybug ‘Radiation Analysis’ component, where the facade was halfway opened. This will be a starting point for Galapagos to minimize or maximize the radiation levels within the building.

radiationkwh

STEPS
In order to solve the problem, we will need the following steps:
1– Gather epw data and extract what we want to analyze, in this case, solar radiation data.
2– Find out when the radiation is at its highest and lowest, and how much there is at our specific location.
3– Optimize the information to what we want to accomplish. (Maximizing heat gain for winter, or maximizing shading for summer).
4– Generate a simulation and data set for all the possible variations via Galapagos.

SOLUTION
1) First, we will assume that your geometry is already available in the Rhino scene, or that you have a grasshopper definition to use for this analysis.

Lets start with a site location: Bakersfield, CA was our test site.

  • Drag and drop the component that looks like a ladybug onto your canvas in order for the rest of the components to work.

lb

  •  Next we need to download our epw file from the internet. Drag and drop the download epw file to the canvas and the open epw component. Create a boolean toggle and set it to true, then connect it to the download. This will take you to a site with almost any city’s weather data, find yours and save that file to your desired folder. After your file is saved, connect another boolean to the open epw and set it to true, navigate to your recently saved epw file and open it.

opendownload

  • Once you have your epw file loaded you can connect the epwFile output to the main ladybug component import epw. This component contains any data you will need for other ladybug components, so this a must have in order to run this script.

epwmaincomp

2) Find out when the radiation is at its highest and lowest, and how much there is at our specific location.

  • Next, drag and drop Ladybug_CDD_HDD component onto the canvas. This will give us the amount of hours per month that cooling, or heating needs to be applied in order for a person to be comfortable. As you can see the winter months have very low, if any, cooling hours. Whereas the summer months hours starting to rapidly increase. This gives us an idea of when we need our systems to be applied the most, and a direction for us to go in with our Galapagos analysis.

cddhdd           cooling hours

heating hours

3) – Optimize the information to what we want to accomplish. (Maximizing heat gain for winter, or maximizing shading for summer).

  • We need to narrow the focus on what actually affects the heating on a space, and that’s the radiation from the sun. We can use the component GenCumulativeSkyMatrix which will calculate sky radiation for every hour of the year.
skymtx
GenCumulativeSkyMtx

Attach the cumulativeskymtx to the SelectSkyMtx component, this will select the sky matrix you just created and allow you to add an analysis period. This will add accuracy for your analysis, especially if you are only looking for data from specific months.

anaysis periodselectskymtx

  • Once our Skymatrix is selected we can now start to analyze the solar radiation on that given location. To do this we need to drop the Ladybug_RadiationAnalysis component onto the canvas, drag the selectedskymtx output and attach it to the Radiation Analysis component. We also need the geometry from your model to be plugged in, as well as the context geometry. For our example, the floor plates were the geometry we wanted to analyze and the context geometry was the facade. This allowed for Galapagos to find the least amount of radiation inside, using the shutter opening and closing parameters.
  • Grid size and distance from base are the scale at which the model is evaluated. 5 mean that every square of 5 rhino units will be analyzed. The smaller this number the longer it will take to run, but smoother your mesh will be.

radiationcomp

This component will also give us mesh data in our Rhino view port once it has been run. It is a memory intensive component so make sure to save your files before you run this. If everything is ready to go, add a Boolean toggle and set it to True and wait for your results.

result
Result from the Radiation Analysis Component

We can attach a panel to the total radiation output and it will give us a value for the total radiation that the floors receive during the analysis period we set. This number can be used later as our fitness for Galapagos.

radiationkwh

4)– Generate a simulation and data set for all the possible variations via Galapagos.

  • Once our fitness number has been descided and generated we are now ready to start using Galapagos to analyze and hopefully give us a best possible outcome for the orientation of our facade panels.
  • Galapagos has two inputs, both must be dragged FROM Galapagos TO the desired data. For example:

galapooooo

We chose to optimize the amount of rows the facade will have, as well as the actual opening size of the individual cells. The perfect combination of these will give us the optimum efficiency of the facade and either reduce, or increase the amount of radiation our building receives. Try keeping the amount of Genomes you attach to 3-4 depending on your computers performance capabilities. Once you are ready to start your evolutionary analysis, double click the Galapagos component and a new window will pop up:

solver

From here we can alter lots of parameters for the component to analyze, but for now we are just wanting to either maximize or minimize our result, in this case, solar radiation. Click the solver tab and when you are ready to watch your simulation run, click ‘Start Solver’ and wait for your data to start showing up! This solver can run for minutes or hours, and max time limits can be set in the settings before you start.

startsolver

Here are some of the results we got after our solver finished running using the floor plates and facade as variables:

Galapagos Editor - Test 1       Galapagos Form Generation - Test 1

As you can see the solver took 23 different generations to find the most suitable option for our desired results. The image on the right shows the output that Galapagos found for us. Notice that the solver seemed to find a result within the 7th generation but some parameters are altered in such minuscule amounts that Galapagos will continue to run even though the outputs are only fractions of a decimal apart. This is where the “Reinstate” option at the middle-right of the window comes into play. The list below that button allows you to scroll through each result of each generation to allow for a “designers’ choice” (which one looks better) of the outputs that are so similar.

This is an example of a result that is undesirable for our analysis, as opposed to the above image which is fully optimized:

Galapagos Bad Editor - Test 1         Galapagos Bad Form Generation - Test 1

Once we were able to achieve a decent result with the floor plate and facade analysis, we decided to try and alter the form in conjunction with the shutters to give us an optimized radiation value for a given range of months. Our tower consisted of ellipses that were rotated and lofted, so finding the right rotation and radii for the ellipses is what we told Galapagos optimize. The fitness number was kept the same as that was the base value for a comfortable radiation level.

Galapagos Genome Sliders -Test 2
Test 2 parameters used in the Galapagos solver

And the results from this evaluation:

Galapagos Editor - Test 2              Galapagos Form Generation - Test 2

The solver found a result reasonably fast, in under 5 generations. Galapagos produced the above form with the openings being affected by the form, and the form being affected by each opening. You can get some very interesting results when you input the right variables into Galapagos. That is why it is important to know what you are searching for and what exactly you are trying to analyze.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s