Archive for the ‘Optimization’ Category

GenerativeComponents <-> EnergyPlus, connection (updated)

Wednesday, October 28th, 2009

These days I have been updated my GC<->E+ connection. I fix some bugs to get more speed, and I get it. you will see in the video 10 different thermal analysis of the box in less than a minute. so I’m glad for that. Unfortunly Since E+ needs some seconds to generate the new files, the speed in the evaluation has a limit.

Results: The data that you are viewing.
Inside Air temperature Average : is the average of the inside Air temeperature in the hottest and coldest day in Barcelona, this number should be the same all the time. 21 C degrees/hr.

Cooling Average : This is the jules/hourly that you have to spend in this building to keep the temperature at 21 C degrees. during the hottest and coldest day in the year. (this number must be change)

Heatting Average : This is the jules/hourly that you have to spend in this building to keep the temperature at 21 C degrees. during the hottest and coldest day in the year. (this number must be change)

The settings of the buildings, like the type of glass in windows, the material of walls or even the weather are defined in the E+ file.

GenerativeComponents <-> EnergyPlus, Connection (wip)

Saturday, October 24th, 2009

My PhD. is about Evolutionary Estrategies. More Precisely in Genetic Algorithms (GAs). I understand the GAs like a complex machine of optimization that knows nothing about the problem which it is trying to (re)solve.
This Particularity (detail) is very interesting, due to the fact that you can apply the GAs to different fields. For example, on the web you will find a lot of resources about GAs, such as Libraries of algorithms, examples of code, images and a lot of explanations.

The complex thing in a GA is not the programming part, as you can think, Is the way of how you define the problem that you want to optimize. This is usually a function called Fitness Function (FF). The correct set of your FF will determine the increase of the population’s level in each iteration. Therfore the effort must be put here.

The FF allows to evaluate each solution (individual) and to set who is who in the population, or in a different way, which of these solutions are the best and which are not.

Sometimes you can work with a really simple FF, like evaluating the length of a path, that you want to reduce. Besides, it can consists os a series of different equations that each individual must test. Logically, this process involve computational resources, it take some seconds or even minutes to achieve a correct evaluation.

In the case of one of my experiments, the evaluation consisted of determine how much energy a building spends in a specific weather. To achieve that I had to write a series of classes in C# (some of classes are built embedded in GC). Well a whole programme (with out interface, Console application) to allow me to transform the complete geometry in a different type of file for its thermal analysis in EnergyPlus.
GC_EP_post
This Video shows one of my first experiments in which I connect automatically (send and retrieve the data) GC and E+.

What I did in SFO (SG’09)

Friday, April 10th, 2009

This was my first time in an SmartGeometry, and I was impressed the high level of the participants and tutors.

Truss Optimization Trough Excel

Mi proposal for the workshop (4 days) consisted in optimize a steel truss, reducing the total weight of the steel, changing thier geometry. but constrained some nodes of the truss move in determinated zones. My original idea for the optimizatión was use Genetic Algorithms.  but in the workshop they propose me use the SOLVE program of Excel to optimize the truss.

This Image Show the description of the problem

carlos-de-la-barrera1



This Image  show the relation between GC and Excel how excel Manage the Geometry into GC. Also explain where in excel is the goal (the number that we are trying to reduce). The loads in the truss is decomposed node by node using the trignometric function Sin and Cos. fortunly for me the most part of the excel spreadsheet was maded by Matthew Clark from Arup New York. and the Strategy to connect both programms was of Steven Downing also from Arup Australia.

I Adde the constraints zone into excel and connect them to the position of the points also in the spreadsheet. the code in GC is really short but very intelligent because gc is completely camptured by Excel.

carlos-de-la-barrera12




In this image there are an screenshot of the Solver in excel and the truss before and after the optimization. this Images were prepared for the conference day.

carlos-de-la-barrera13




This are the parameters of the solver into Excel. also there are more options that you can control like the number of the iterations, the type of the algorithm to optimize, the accurate, etc.

optimization-window




This is an Screenshot during my work.

op_1copy




This is another screenshot and show the truss and the zones where the nodes can be moved. The width difference among all the tubes depends of the section area. also calculated from the spreadsheet in excel.

op_1




The truss with differents settings and extreamly constraints in the nodes. th truss now is calculated completely in compression, the reason becasuse all the tubes are in red color.

model-with-settings




now the truss is calculated and new loads are defined. blue colors represent that this tubes are working to the slenderness.

model-before-optimization-and-settings

And here after tthe optimization.

model-after-the-optimization

sketches in my notebook.

ideas_2

ideas

Here the constraints for each node.

conditional-study

And this is a video of the process.

Sensitive Analisys, Prato Italy

Wednesday, August 6th, 2008

I was invited to paticipate in a contest to the Comune di Prato in Italy. I have to say thank you to this cool group of architects from Lisboa: Duarte Cardoso Ferreira, Nuno Lobo Guerra, Ricardo Boaventura, Rita Frias Silva from ADOC architects and all the team of 4ARQ encharged of the 3D images.

I was encharge to develope by programming the plans and the general features of the school. We start working identify every tree in the ground and the area of the differents rooms for the school. Every tree was identify by a point and a minum area of influence (in the fisrt step of the algorithm) and each area of the room of the school was enter in to the algorithm to know the best performance of the build with out touch any tree.

Then the algorithm calculate a voronoi diagram (only with the trees) and inform the resultant areas and we could see where can “grow” our building. the next step was develope a second algorithm to generate pseudo-random points, between the trees and responding obviously to the influence area of them.

Then the process consist basicaly in create generations and test the results, if the dispositions of points allow build the school (first and more important test), if the result produce nice spaces, if we like it, if the algorithm respect entrance determined by us, etc. etc. after every generation, we pass again this second algorithm to produce in some points a random movement to explore new configurations and results.

I take this idea from Mutsuro Sasaki, he use an strategy based in the approach in successive steps to get the best result moving the points in pseudo random way.

Recursion

Tuesday, April 22nd, 2008

I was Working couple weeks ago in a simple script to produce a recursion, I try drawing 3 points and then subdivided every segment for the mid point to find the another triangle inside of the original, the script appear in several minutes, Ididn`t think too much, I just typed very fast.

I learned recursion using C++, but I never used In Rvb, so this is my first experiments in recursion in Rvb. and this time I add The source of the original code, add comments, modify it, share, make differents Calls and send me Images.

Best.

Option Explicit
‘Script written by Carlos de la Barrera’

Call Main()
Sub Main()
Dim pt1, pt2, pt3, trip

pt1 = Rhino.GetPoint(”sel fisrt point”)
If IsNull (pt1) Then Exit Sub

pt2 = Rhino.GetPoint(”sel second point”)
If IsNull (pt2) Then Exit Sub

pt3 = Rhino.GetPoint(”sel third point”)
If IsNull (pt3) Then Exit Sub

trip = Rhino.AddPolyline(Array(pt1, pt2, pt3, pt1))

Call myFractal(trip, pt1, pt2, pt3)
End Sub

Function myFractal(trip, Opt1, Opt2, Opt3)
Dim pt1, pt2, pt3

pt1 = myMidFunction(Opt1, Opt2)
pt2 = myMidFunction(Opt2, Opt3)
pt3 = myMidFunction(Opt3, Opt1)

trip = Rhino.AddPolyline(Array(pt1, pt2, pt3, pt1))

If Rhino.Distance(pt1, pt2) > 0.01 Then
Call myFractal(trip, pt1, pt2, pt3)

Else
Exit Function

End If
End Function

Function myMidFunction(P1, P2)

Dim MidP
MidP = Array((P1(0) + P2(0)) / 2, (P1(1) + P2(1)) / 2, (P1(2) + P2(2)) / 2)

myMidFunction = MidP

End Function