Genetic Algorithms

A first draft without images and examples for an introduction to GAs on my PhD Thesis. 

GENERAL OVERVIEW

A genetic algorithm (GA) is (defined by Goldberg) a search algorithm that is inspired to the mechanics of natural evolution. (first part of Golberg definition) (an optimization technique, but Holland prefer to focus the attention on improvement)

In contrast with many others evolution-inspired algorithms that were studied starting from the 1950s for the optimization and machine learning, the theoretical and mathematical framework of Genetic Algorithms was developed by John Holland and his team in the 1960s, and finally formalized in 1975 (Holland), as the result of a more general study on the phenomenon of natural adaptation in order to simulate the biological evolution under computer systems. Originally defined by Holland as “genetic plans” they were soon renamed by his doctoral students, replacing the term “plan” with “algorithm”, in order to focus the attention on the role of computation. (introduction Holland)

Only in the 1980s genetic algorithms received an increasing recognition by scientists and studies ranging from biology, artificial intelligence, engineering and business to social sciences became to appear. (p.126 Goldberg) (see also Mitchell p.16)

WHY THEY ARE GOOD

When we deal with complex problems (nei quali è difficile trovare un metodo analitico di risoluzione), such as air-traffic programming, weather forecasts, share portfolios balance and electronic circuits design, at present genetic algorithms provide a tool to solve them and to find optimal or sub-optimal solutions.

Con riferimento al mondo delle costruzioni i problemi affrontati con queste tecniche riguardano l’ottimizzazione topologica di strutture di ponti e grandi luci in generale, la ricerca di forma di gusci e membrane, la risoluzione di problemi geometrici complessi come le strutture reciproche.

At present, genetic algorithms are used to deal with complex adaptive systems due to their robustness, efficiency and flexibility. (A good introduction to GAs is Golberg 1989, in which it is explained how they are robust and efficient.)

ELEMENTS OF A GENETIC ALGORITHM

Any clearly defined problem can be formulated in genetic terms (Koza, p.18) following the four major steps defined by Koza: (p.27)

-        Determining the representation scheme

-        Determining the fitness measure

-        Determining the parameters and variables for controlling the algorithm

-        Determining the way of designating the result and the criterion for terminating a run

TERMINOLOGY

The specific terminology for GAs derives from natural systems as well as from computer science technical vocabulary. For this reason, we find in technical literature the same thing with two different, but equivalent, terms. (p.21)

The followings are the main used terms:

- we can refer to specific genetic codes as “strings” basing on the computer science vocabulary. On the contrary as “chromosomes” with reference to the biological world;

- the general genetic constitution of an individual is called “structure” in computer science and “genotype” in biology;

- the actual observables characteristics of an individual are defined as “parameter set” or “solution alternative” or “point” in computer science. In natural systems we refer to them with the term “phenotype”;

- the basic unit of a genetic code is the “Gene” in natural systems and “(((X)))” in artificial;

- (((alleles (are the values) natural, features or detectors with different values)))

- the position of a gene in a genetic code is called “locus” in biology and “string position” in computer science.

- individual, population

It is important to avoid the mixed use of artificial and natural terminology at the same time. Indeed, in this thesis only the most common biological vocabulary will be used.

CLASSIFICATION (ref Tadei)

-evolutionary or not

- single solution multiple solution

- global search local search

After almost thirty year they have been described for the first time [Holland 1975], and after a large diffusion of theoretical studies and applications, the status of Genetic Algorithms (GA) in the scientific research still does not seem to be well defined. As many other mathematical models, starting from neural networks, going through fuzzy logic, simulated annealing techniques, and arriving to particle swarm optimization, ant colony optimization and the ’shuffled frog leaping’ algorithm, all these approaches to the solution of mathematical problems were born as a tentative to explain, or at least to imitate, some natural phenomena related to the world of life. The history of neural networks is quite interesting from this point of view: when they were described for the first time [Rumelhart and Mc Lelland, 1988] the contest was cognitive psychology and the interest to the parallel microstructure of thought was in opposition with a more synthetic “higher level” approach [Minsky, 1985]. Only a few years after the enthusiasm fade away, when scientists understood that having a local model of neuronal behavior is quite different from being able to simulate the parallel interactions between many billions of neurons.

In scientific literature we find papers on genetic algorithms under different branches: in Operation Research (OP) they are classified as a heuristic or semi-heuristic technique for combinatory optimization; in biology they are considered as a suitable model for living beings natural evolution. In architecture and structural engineering we are mainly concerned with their capability to explore a dominion of possible configurations looking for the best one, form a specific point of view defined in the so called fitness function.

DEVELOPMENT OF A GENETIC ALGORITHM

Il modo più semplice per comprendere il funzionamento di un algoritmo genetico è quello di provare a costruirne una semplice versione che risolva problemi molto semplici e facilmente definibili, come l’ordinamento di una serie di numeri. Il testo di riferimento consigliato per addentrarsi nell’argomento è sicuramente il “Manuale sulle reti neurali” di Floreano e Mattiussi, che spiega in maniera chiara appunto che cos’è un semplice algoritmo genetico. Un altro libro a vocazione didattica di facile lettura è “An introduction to Genetic Algorithms” di Mitchell. I libri ormai classici come Holland, Goldberg e Koza, presentano tutti un capitolo introduttivo che spiega, attraverso sempre la costruzione di un semplice algoritmo, la costruzione di un AG. La loro natura però più matematica e ingegneristica li porta inevitabilmente ad essere testi più difficili da approcciare, per lo meno all’inizio, provenendo da una formazione di architetto.

GA PROCEDURE

The pseudocode for a GA procedure is written in form of comments followed by the call of the relative function. In this way it is easier to modify each function on the basis of the specific problem leaving the same the general procedure.

 * The generate geometry and performance functions depending on the basis of the problems. All the other operators need only a tuning phase in order to be tailored for the specific problem.

** Only if is used a binary coding. In architectural cases we use a real coding strategy because it is more efficient for the crossover operator (it does not cut coordinates).

Sub GA_Procedure()
  For each <iteration> of the GA procedure
    //Defined only with a specific reference problem
    Read input parameters (input geometry)
    Define the solutions domain
    //
    For each <individual> in the <population>
      //Generate the geometry in the graphic interface
      Call GenerateGeometry(<individual>)*
      //Calculate the <fitness> value of the individual
      Call Performance(<individual>)*
    Next
    //Sort the population individuals on the basis of their fitness
    Call SortPopulation()
    //Select individuals for reproduction
    Call RouletteWheelSelection()
    //Codify the design variables**
    Call DecimalToBinary**
    //Create a new population by means of a crossover reproduction
    Call GenerateNewPopulation()
    //Mutate randomly some genes of new individuals
    Call Mutations()
    //Decodify the design variables**
    Call BinaryToDecimal**
  Next
End Sub

CODING STRATEGY
La scelta della strategia di codifica è molto importante perché da essa dipende in gran parte la corretta definizione del problema da risolvere e quindi l’efficienza generale dell’algoritmo.
La codifica binaria è sicuramente il modo più semplice per ottenere un codice genetico, ovvero un cromosoma, a partire da alcune variabili numeriche. Inoltre la sua somiglianza con il DNA del mondo naturale fa sì che sia il primo metodo di codifica introdotto nella letteratura di riferimento.
In architettura possiamo codificare distanze, coordinate e qualunque altra variabile numerica sotto forma binaria ma è da sottolineare quanto questo genere di codifica sia in realtà un passaggio superfluo e controproducente nella definizione di un problema in termini genetici. Infatti, la misura di una distanza oppure le coordinate di un punto nello spazio sono già di per sé delle codifiche di una più generale geometrica, non più in binario ma in reale.
Come vedremo parlando dell’operatore della riproduzione, il crossover, il sistema di codifica influisce sulle possibilità di ricombinazioni dei geni e la differenza tra la scelta di una codifica binaria o reale può cambiare di molto la situazione. Immaginando di dover quindi codificare le coordinate di una serie di punti di una geometria di riferimento, il loro valore reale si può considerare come minima entità inscindibile, modificabile e scambiabile, ma non divisibile.
Se infatti le prestazioni in termini ad esempio strutturali di una forma geometrica possono dipendere dalle coordinate di alcuni suoi punti che la definiscono, allora una codifica reale permette di ricombinare delle coordinate efficienti tra loro mentre al contrario una codifica binaria può frammentarle e crearne di nuove in modo assolutamente casuale. La codifica binaria di più coordinate consecutive infatti va a formare un codice genetico che può essere tagliato e ricombinato ad un livello inferiore del valore della coordinata, mentre una codifica reale no. (Da chiarire con figura).
Qui di seguito si riportano gli pseudocodici per costruire le funzioni di codifica e decodifica binaria. Per la codifica reale non è invece necessaria nessuna funzione ma basterà invece immagazzinare come variabile direttamente i valori numerici delle variabili.

Sub DecimalToBinary()
  //For one-dimensional chromosomes
  Make a <temp> temporary variable
  For each <individual> in the <population>
    For each <gene> of the <individual>
      Set <temp> equal to <gene>
      For each <bit> of the binary coding
        If <temp/2> is equal to the integer part of <temp/2> Then
          Set <temp> equal to <temp/2>
          Set <bit> equal to 0
        Else
          Set <temp> equal to the integer part of <temp/2>
          Set <bit> equal to 1
        End If
      Next
    Next
  Next
End Sub

BINARY DECODING SUBROUTINE
Sub BinaryToDecimal()
  //For one-dimensional chromosomes
  For each <individual> in the <population>
    For each <gene> of the <individual>
      Set <gene> equal to 0
      For each <bit> of the binary coding
        Set <gene> equal to <gene> + [2^(<bitLenght> - <bit>) * <bit>]
      Next
    Next
  Next
End Sub

GA PARAMETERS

Ampiezza della popolazione

Numero di cicli iterativi

Percentuale dell’operatore di crossover

Percentuale di mutazioni

Numero di elementi di elite

Definizione del dominio e della sua ampiezza

Definizione di un restringimento del dominio sulla base della ricerca della soluzione

GA OPERATORS

I principali operatori di un algoritmo genetico sono tre: la selezione dei migliori individui, la riproduzione degli individui selezionati, l’applicazione di mutazioni genetiche casuali sulla nuova popolazione. Oltre a questi operatori classici si possono aggiungere dei criteri secondari di generale miglioramento dell’efficienza dell’algoritmo. Ne verrà utilizzato soltanto uno, l’elitismo, che consiste nella conservazione da una generazione all’altra di una serie di migliori individui, senza che questi vengano intaccati dalle operazioni degli operatori. In questo modo si evita che il processo evolutivo possa prendere strade involutive o derivare. (Da ampliare)

SELECTION

Il più tradizionale criterio di selezione degli individui di una popolazione è la ruota della fortuna truccata [Rif. Floreano, Goldberg, Koza]. E’ una tecnica che corrisponde figurativamente ad effettuare dei lanci di una roulette che riporta indicati tutti gli individui della popolazione, separati tra loro però non da intervalli regolari come accade nei classici tavoli da casinò ma piuttosto da spazi tanto ampi quanta è la loro probabilità di essere selezionati, calcolata in proporzione alla loro performance. In questo modo, seppur ogni lancio della ruota sia casuale, la probabilità di uscita dei migliori individui è maggiore rispetto ai peggiori, e quindi essi saranno più probabilmente genitori di nuovi individui, tendenzialmente ancora migliori.

Di seguito si riporta lo pseudocodice per costruirsi una ruota della fortuna truccata, che assegni la probabilità di selezione di un individuo sulla base della sua performance, in termini genetici sempre definita come fitness, e per questo calcolo utilizzata nella sua versione normalizzata. (Descrivere meglio con aiuto di immagini)

Sub RouletteWheelSelection()
  Make <rand> as a random variable
  Make <sumExpValue> as the sum of expected values
  Set <sumExpValue> equal to 0
  For each <individual> in the <population>
    Set the <individual expValue> equal to the <individual normalized fitness>
    Sum the <individual expValue> to <sumExpValue>
  Next
  For each <individual> in the <population> excluding <numElite> best
      individuals
    Set <rand> equal to a random value chosen from 0 to <sumExpValue>
    Make a <counter> variable equal to 0
    Make a <chosenExpValue> variable equal to 0
    While <chosenExpValue> is smaller than <rand>
      Set <counter> equal to <counter> + 1
      Sum <chosenExpValue> with the <individual expValue>
    Loop
    Copy the chosen individual <counter> in the current position of the
    population
  Next
End Sub

REPRODUCTION

SINGLE POINT OR TWO POINTS CROSSOVER

Sub GenerateNewPopulation()
  //It is possible to generate more than one cutting point
  Make a <ptCross1> variable that define a first cutting point of the
  <individual chromosome>
  For each <reproduction operation> in the <population>
    Select randomly a first parent <parent1> in the <population>
    Select randomly a second parent <parent2> in the <population>
    If <parent2> is equal to <parent1> Then
      Select randomly another <parent2>
    End If
    //Combine parents genes to create a new <individual>
    //This Function can be called more than one time
    Call Crossover(<parent1>, <parent2>, <position of child1> in the
         <population>, <position of child2> in the <population>, <ptcross1>)
  Next
End Sub

Sub Crossover(<parentA>, <parentB>, <childA>, <childB>, <ptCrossA>)
  For each <gene> in the <chromosome> of the <parentA>
    If <gene position> is smaller than <ptCrossA> Then
      Copy <parentA gene> in the same position into <childA gene>
      Copy <parentB gene> in the same position into <childB gene>
    Else
      Copy <parentA gene> in the same position into <childB gene>
      Copy <parentB gene> in the same position into <childA gene>
    End If
  Next
End Sub

TWO-DIMENSIONAL CROSSOVER OPERATOR, REAL CODING
Sub GenerateNewPopulation()
  //Cutting points for a two-dimensional chromosome
  Make a <ptCross1> variable that define a first cutting point of the
  <individual chromosome>
  Make a <ptCross2> variable that define a second cutting point of the
  <individual chromosome>
  For each <reproduction operation> in the <population>
    Select randomly a first parent <parent1> in the <population>
    Select randomly a second parent <parent2> in the <population>
    If <parent2> is equal to <parent1> Then
      Select randomly another <parent2>
    End If
    //Combine parents genes to create a new <individual>
    //This Function can be called more than one time
    Call Crossover(<parent1>, <parent2>, <position of child1> in the
         <population>, <position of child2> in the <population>, <ptcross1>,
         <ptcross2>)
  Next
End Sub

Sub Crossover(<parentA>, <parentB>, <childA>, <childB>, <ptCrossA>, <ptCrossB>)
  //Two-dimensional crossover operator
  For each <gene> in the matrix rows of the <parentA>
    For each <gene> in the matrix columns of the <parentA>
      If <gene row position> is smaller than <ptCrossA> Then
        If <gene column position> is smaller than <ptCrossB> Then
          Copy <parentA gene> in the same position into <childA gene>
          Copy <parentB gene> in the same position into <childB gene>
        Else
          Copy <parentA gene> in the same position into <childB gene>
          Copy <parentB gene> in the same position into <childA gene>
        End If
      Else
        If <gene column position> is smaller than <ptCrossB> Then
          Copy <parentA gene> in the same position into <childB gene>
          Copy <parentB gene> in the same position into <childA gene>
        Else
          Copy <parentA gene> in the same position into <childA gene>
          Copy <parentB gene> in the same position into <childB gene>
        End If
      End If
    Next
  Next
End Sub

MUTATION

L’operatore delle mutazioni genetiche casuali è molto importante in quanto è la seconda causa di miglioramento delle performance di una popolazione di individui dopo la ricombinazione genetica realizzata attraverso il crossover. In certi casi, una piccola mutazione relativa ad un singolo gene può essere più efficace rispetto alla ricombinazione dei geni di due buoni genitori e per questo è un operatore che va inserito all’interno della procedura in bassa percentuale in modo da non essere controproducente.

Nei capitoli dedicati ai casi studio, vedremo come implementare questo operatore in modo più efficiente in modo da effettuare contemporaneamente una ricerca della soluzione migliore sia nell’intero dominio delle soluzioni che nel più circoscritto insieme delle soluzioni migliori.

Sub Mutations()
  For each <mutation> in the <individuals> of the <population>
    Select randomly an <individual> in the <population> excluding <numElite>
    best individuals
    Select randomly a <gene> in the <individual chromosome>
    //It depends on the coding strategy
    Generate randomly a <new gene> value in the solutions domain
    Substitute the <new gene> value with the old <gene> value
  Next
End Sub

TUNING PROBLEMS

Ogni singolo problema approcciato con l’ausilio di un algoritmo genetico richiede una specifica fase di messa a punto della procedura di ottimizzazione. Non è possibile definire delle linee guida generali per migliorare l’efficienza dell’algoritmo ma volta per volta è necessario affinare da sé la definizione del problema da risolvere, scegliere accuratamente la strategia di codifica, il dominio delle soluzioni e l’utilizzo bilanciato degli operatori principali. Per chiarire meglio l’importanza di questa fase, nei successivi capitoli dedicati alla sperimentazione attraverso dei casi studio verrà dedicato ampio spazio alla descrizione di come si è svolta questa delicata fase.

OTHER FUNCTIONS

Un algoritmo genetico richiede generalmente la costruzione di una serie di funzioni accessorie, come ad esempio le funzioni di stampa, indispensabili per leggere e analizzare i risultati della procedura. Però tra queste si intende riportare una funzione necessaria, ovvero l’ordinamento degli individui di una popolazione sulla base delle prestazioni valutate.

Il metodo più semplice per ordinare gli individui consiste nel prendere a riferimento il vettore delle fitness e, partendo dal primo valore, confrontarlo con il suo immediato vicino. Se maggiore di esso li si scambia di posizione nel vettore altrimenti si procede al prossimo valore. Si procede al contrario invece qualora si preferisca ordinare in ordine decrescente i valori, come tra l’altro è consuetudine fare in questo tipo di algoritmi (l’individuo migliore ha sempre fitness più bassa). Di seguito si riporta lo pseudocodice.

Sub SortPopulation()
  //Numerical sorting in descending order
  For each <individual> in the <population>
    If the <fitness of individual> is smaller than the <fitness of next
       individual> Then
      Switch the <position of evaluated individuals> in the <population>
    Else
      Nothing
    End If
  Next
End Sub

Grace Hopper e Grasshopper, una strana coincidenza (La storia insegna)

Forse ci si ricorderà della Hopper principalmente per il suo contributo al bug del millennio, dovuto alla difficoltà dei programmi di accettare il passaggio dal 1999 al 2000, con la data di sole due cifre, piuttosto che il ritorno al 1900. Però in questo caso vorrei citare invece alcuni passaggi tratti da Paul. E. Ceruzzi, “Storia dell’informatica” che credo diano uno stimolo al dibattito sull’utilizzo di strumenti come GrassHopper al posto dei tradizionali linguaggi interpretati come Rhinoscript. Che sia una strana coincidenza o no l’assonanza tra il nome della Hopper e la nostra “cavalletta” di Rhino la storia insegna…

Un programmatore, Scott Kim, ha detto che “non c’è una differenza fondamentale fra programmare un computer e utilizzarlo”. Per lui si tratta di strati levigati e continui, dal microcodice incorporato nel firmware fino ai comandi di menu di un ATM, e il suo lavoro si colloca da qualche parte tra questi strati. (p.101)

Se queste sequenze venivano perforate su pacchi di schede, si poteva preparare un programma selezionando i pacchi opportuni, scrivendo e perforando su schede codici di collegamento e raggruppando i risultati in un nuovo pacco di schede. Questa attività venne chiamata “compilazione”. […] Grace Hopper svolse un ruolo cruciale nel trasferire quel concetto dal laboratorio di Howard Aiken ad Harvard al mondo commerciale. […] Per Hopper, un “compilatore” era “una routine generatrice di programmi, che produceva un programma specifico per un problema particolare” e chiamava “Programmazione Automatica” l’insieme delle attività legate all’utilizzo dei compilatori.

[…] I fautori della Programmazione Automatica si proponevano di sviluppare per il software quello che Henry Ford aveva concepito per la produzione delle automobili, un sistema basato su parti intercambiabili. Ma proprio perché il sistema di Ford funzionò al meglio quando venne impostato per produrre un solo modello di automobile, questi primi sistemi erano altrettanto rigidi, tentavano di standardizzare prematuramente e a un livello di astrazione sbagliato. Fa fu soltanto quando provarono a farlo che se ne resero conto.

Vedi Wilkes, Wheeler e Gill “The preparation of Programs fora n Electronic Digital Computer”, 26-37 e Martin Campbell-Kelly “Programming the EDSAC: Early Programming Activity at the University of Cambridge”, Annals of the History of Computing 2, 1980, 7-36.

Il successo iniziale di FORTRAN illustra con quale prontezza gli utenti accettarono un sistema che nascondeva I dettagli dei meccanismi interni della macchina, lasciandoli liberi di concentrarsi sulla risoluzione dei loro problemi e non di quelli della macchina. Nello stesso tempo, il fatto che si continui a usarlo ben addentro agli anni Novanta, in un’epoca nella quale sono disponibili linguaggi più nuovi, che nascondono molti altri strati di complessità, rivela i limiti di questa filosofia. Il linguaggio C, sviluppato presso i Bell Labs e uno dei più diffusi dopo il 1980, consente, come il FROTRAN, di accedere a funzionalità di basso libello quando si desidera farlo. I linguaggi per computer che hanno avuto successo e sono durati a lungo, ben pochi, sembrano avere in comune la caratteristica di nascondere ai programmatori alcuni dei meccanismi interni del computer, ma non tutti. (p.113)

Copertura leggera per una piccola corte interna

Di seguito riporto alcune immagini di un progetto proposto per la realizzazione di una copertura leggera. Si tratta di una corte interna nel ricetto di un villaggio di provincia piemontese, nel quale l’interesse principale stava nella costruzione di una copertura a rapida esecuzione, che richieda minimi interventi sull’esistente (si sfruttano i pilastri esistenti dei ballatoi e non si intaccano le coperture esistenti). La proposta prevede una serie di travi curve che sostengono dei cuscini di ETFE al fine di ottenere un effetto di cielo nuvoloso. Solitamente questo tipo di materiale viene impiegato nelle grandi luci (al fine di minimizzare la scarsa resa estetica sulle piccole dimensioni) o imitando le classiche bolle di sapone, come nel WaterCube di Pechino. Attraverso l’uso di questo materiale e questa configurazione spaziale, il progetto si presta ad essere mezzo per una ricerca sulla forma sviluppata delle membrane dei cuscini. Infatti ancora oggi è una lavorazione che viene effettuata senza procedure di ottimizzazione e, come per la realizzazione di vetri a doppia curvatura, diventa molto onerosa.

La proposta di coprire interamente la corte è stata abbandonata al fine di lasciare un’elevata visibilità del cielo ed è attualmente in studio una nuova proposta per una copertura parziale in corrispondenza del ballatoio di attraversamento. Si accettano consigli!

TimeOut1

Foto del plastico: la corte esistente con la nuova copertura leggera in acciaio ed ETFE.

TimeOut3

Viste del modello virtuale: la nuova copertura sfrutta le caratteristiche dell’ETFE per formare un ‘cielo nuvoloso’.

TimeOut4

Sezioni sulla corte esistente con la nuova copertura leggera.

TimeOut2

Schema della nuova struttura con evidenziati i punti d’appoggio.

The church of Longuelo designed by Pino Pizzigoni. An unknown example of outstanding structure

Carlo DEREGIBUS, Alberto PUGNALE

ABSTRACT

This paper presents a critical study of the church of Longuelo, Italy, designed in 1966 by Giuseppe (Pino) Pizzigoni (1901–1967), an Italian architect who lived and worked in the city of Bergamo. He began his studies on shell structures in the Fifties and many of his buildings show outstanding skills in conceiving and handling complex structures. The church is one of his most interesting works: it is divided in four identical free parts, each composed by four shells joined by a fifth one, supported by twenty one bars which realize an statically-determinate spatial frame resulting in an outstanding inner space.

All during the XX Century, several Italian architects devoted their efforts in finding a synergy between structure and formal character, economically reasonable while rich of new architectural opportunities. Among the most notable there are personalities like Pier Luigi Nervi, Luigi Moretti and Sergio Musmeci, but also a lot of almost unheard-of architects, whose works are of utter interest. Here a very singular building of one of these designers, namely Pino Pizzigoni, is presented: the church of Longuelo. The main information related to this building are to be found directly in his archive, located in the public library of Bergamo “Angelo Mai [9], from his own sketches and written records, which often are all but clear and marked by consistency.
The second section describes the multifaceted personality of Pizzigoni, with a special attention to the last years of his life. In the third one we present an overview of the church to understand its genesis and evolution. The fourth section elaborates on the structural behaviour of the church: as the description by the architect are often confused, different suggestions and considerations about built structure are pieced together. Finally, before the conclusion section, the fifth one looks at the real church, its actual state and its aging.

Pizzigoni chiesa1

Picture of the Church of Longuelo, front view.

Pizzigoni chiesa2

Picture of the Church of Longuelo, back view.

Pizzigoni2

Picture of the Church of Longuelo, lateral view 1.

Pizzigoni3

Picture of the Church of Longuelo, lateral view 2.

Pizzigoni6

Another experimentation with a spatial structure, Zandobbio.

Pizzigoni5

Other experimentations.

This contribute paper will be published on the “Proceedings of the International Association for Shell and Spatial Structures (IASS) Symposium 2009″, Valencia. Evolution and Trends in Design, Analysis and Construction of Shell and Spatial Structures, 28 September – 2 October 2009, Universidad Politecnica de Valencia, Spain.

A conversation with Salvatore D’Agostino

Published on Wilfing Architettura:

http://wilfingarchitettura.blogspot.com/2008/12/0019-mondoblog-prog-engineering.html

Salvatore, thanks for the interesting interview!

Rhinoceros and Ansys

With reference to this article published on IAACBlog: http://www.iaacblog.com/scripting/?p=572 I replied to this author request: “I was forced to use the workbench environment because i was unable to acheive the same contact results with ansys classical version, ultimately ending the potential to have a fully automated program. I am still working on this, If anyone can help me out to provide a source of documentation for ansys workbench that would be greatly appreciated” some months ago, but my comment is not published yet (why?). For this reason, today I reply directly on my blog.

First of all, we have to transform a NURBS surface  in a MESH object in this way:

‘The number of elements in U and V direction

elemsNumU = 10

elemsNumV = 10

nodesNumU = elemsNumU + 1

nodesNumV = elemsNumV + 1

ReDim Nodes(nodesNumU * nodesNumV – 1)

 

Dim domU, domV, stepSizeU, stepSizeV

 

Rhino.AddLayer “Mesh”,  RGB(255, 0, 0), 0

Rhino.CurrentLayer(“Mesh”)

 

‘Get the domain of the surface

domU = Rhino.SurfaceDomain(surface(i), 0)

domV = Rhino.SurfaceDomain(surface(i), 1)

 

‘If Not IsArray(domU) Or Not IsArray(domV) Then Exit Sub

stepSizeU = (domU(1) – domU(0)) / elemsNumU

stepSizeV = (domV(1) – domV(0)) / elemsNumV

  

For j = 0 To elemsNumV

‘Set the y coordinate

coord(1) = domV(0) + stepSizeV * j

For k = 0 To elemsNumU

‘Set the x coordinate

coord(0) = domU(0) + stepSizeU * k     

‘Generates the z coordinate and stores the points in the A array

nodes(nodesNumU*j+k) = Rhino.EvaluateSurface(surface(i), coord)

Next

Next

   

ReDim topology(elemsNumU * elemsNumV – 1)

 

For j=0 To elemsNumV-1

For k=0 To elemsNumU-1

topology(elemsNumU*j+k) = Array((elemsNumU+1)*(j+0)+(k+0), (elemsNumU+1)*(j+0)+(k+1), (elemsNumU+1)*(j+1)+(k+1), (elemsNumU+1)*(j+1)+(k+0))

Next

Next

 

Rhino.AddMesh nodes, topology

 

Secondly, we have to translate our Rhino-MESH into a valid input file for Ansys:

‘The input file for the FEM analysis

Dim fsObject, fp, node

   

outPath = “c:\RhinoTemp\InputAnsys.txt”

Set fsObject = CreateObject(“Scripting.FileSystemObject”)

Set fp = fsObject.CreateTextFile(outPath, True) 

fp.Writeline “/PREP7″

fp.Writeline “!* …Static analysis”

fp.Writeline “ANTYPE,STATIC”

fp.Writeline “ET,1,SHELL63,,1″

fp.Writeline “R,1,0.3 !* …Shell thickness”      

fp.Writeline “MP,EX,1,3E+7″ ‘Units: m and KN

fp.Writeline “MP,NUXY,1,0.15″

fp.Writeline “!* …”

fp.Writeline “TYPE,1″

fp.Writeline “MAT,1″

fp.Writeline “REAL,1″

 

‘Mesh nodes

fp.Writeline “!*”

fp.Writeline “!* …Nodes”

  

For j = 0 To nodesNumV – 1

For k = 0 To nodesNumU – 1

node = nodes(nodesNumU*j+k)

fp.Writeline “N,” & nodesNumU*j+k+1 & “,” & node(0) & “,” & node(1) & “,” & node(2)

Next

Next

  

‘Shell elements (only geometry)

fp.Writeline “!*”

fp.Writeline “!* …Shell elements”

 

For j=0 To elemsNumV-1

For k=1 To elemsNumU

‘Ansys Shell 63 elements

nodes(nodesNumU*j+k) = Array((nodesNumU)*(j+0)+(k+0), (nodesNumU)*(j+0)+(k+1), (nodesNumU)*(j+1)+(k+1), (nodesNumU)*(j+1)+(k+0))

fp.Writeline “E,” & nodes(nodesNumU*j+k)(0) & “,” & nodes(nodesNumU*j+k)(1) & “,” & nodes(nodesNumU*j+k)(2) & “,” & nodes(nodesNumU*j+k)(3)

Next

Next

 

fp.Writeline “!* …”

fp.Writeline “FINISH”

fp.Writeline “/SOLU”

fp.Writeline “!* …Constrains”

   

‘Single Node constrain

fp.Writeline “D,” & CStr(1) & “,UX” ‘— 1 is the number of the node to constrain

fp.Writeline “D,” & CStr(1) & “,UY”

fp.Writeline “D,” & CStr(1) & “,UZ”

        

‘External constrains

For m = 0 To elemsNumU

fp.Writeline “D,” & CStr(m+1) & “,UX”

fp.Writeline “D,” & CStr(m+1) & “,UY”

fp.Writeline “D,” & CStr(m+1) & “,UZ”

Next

   

For m = 0 To nodesNumV-2

fp.Writeline “D,” & CStr(m*nodesNumU)+1 & “,UX”

fp.Writeline “D,” & CStr(m*nodesNumU)+1 & “,UY”

fp.Writeline “D,” & CStr(m*nodesNumU)+1 & “,UZ”

Next

 

fp.Writeline “!* …Forces”

‘Nodal forces

For k=0 To (nodesNumU * nodesNumV -1)

fp.Writeline “F, ” & (k+1) & “, FZ, 1″

Next

 

‘Gravity ACEL and MPDATA, DENS

fp.Writeline “MPTEMP,,,,,,,,” 

fp.Writeline “MPTEMP,1,0 

fp.Writeline “MPDATA,DENS,1,,25″

fp.Writeline “ACEL,0,0,-1,” 

                  

fp.Writeline “SOLVE”

fp.Writeline “!* …Postprocessor”

fp.Writeline “/POST1″

‘fp.Writeline “PRNSOL, U, X”

‘fp.Writeline “PRNSOL, U, Y”

fp.Writeline “PRNSOL, U, Z” ‘Z direction displacements

fp.Writeline “FINISH”

 

fp.close

 

Finally, we have to launch the analysis and to read the results (e.g. the maximum displacement). It is better to separate this operation in a private function to recall:

Dim applicPath, applic, maxDisplacement

Dim fileExe, fileInput, fileOutput

 

fileExe = “C:\Programmi\Ansys Inc\v100\ANSYS\bin\intel\ansys100.exe” ‘Programs for ENG WIN versions

fileInput = “c:\RhinoTemp\InputAnsys.txt”

fileOutput = “c:\RhinoTemp\OutputAnsys.txt”

applicPath = fileExe & ” -b -i ” & fileInput & ” -o ” & fileOutput

 

Set applic = CreateObject(“WScript.Shell”)

applic.exec(applicPath)

   

Dim datiOut, out, rigaDati, risultDati, fileOutput, fileCompleto, counter

 

out = False

counter = 1

Set datiOut = CreateObject(“Scripting.FileSystemObject”)

   

‘— File exists?

Do Until out = True

out = datiOut.FileExists(fileOutput)

Rhino.sleep 1000

Counter = counter + 1

Loop

 

Rhino.Print “Now the output file exists”

Rhino.sleep 1000

 

Set out = datiOut.OpenTextFile(fileOutput, 1)

risultDati = 0

   

‘— Max displ value exists?

contatore = 1

fileCompleto = 0

 

Do Until fileCompleto = 1

While Not Out.AtEndOfStream

rigaDati = Out.readLine

If rigaDati = ” |                            ANSYS RUN COMPLETED                            |” Then

Rhino.Print “Analysis complete!”

fileCompleto = 1

End If

Wend

 

Rhino.sleep 1000

counter = counter + 1

If contatore = 600 Then

risultDati = 100

Rhino.Print “Error”

Exit Do

End If

Loop

   

‘— Read Max displacement       

Set out = datiOut.OpenTextFile(fileOutput, 1)

Do While Not out.AtEndOfStream

rigaDati = out.readLine  

If Left(RigaDati, 12)     = ” *** ERROR *” Then

risultDati = 100

Exit Do

ElseIf Left(RigaDati, 12) = ” MAXIMUM ABS” Then

out.SkipLine ‘1

rigaDati = out.readLine

risultDati = Mid(rigaDati, 9, 12)

Exit Do

End If

Loop

     

‘RESULT

maxDisplacement = risultDati

   

   

Out.Close

   

‘Delete the output file

‘Out = DatiOut.DeleteFile(fileOutput, True)

 

That’s an automatic procedure to evaluate the structural performance of a Rhino MESH object with the ANSYS FEM solver.

Reference: Pugnale A., Sassone M., Morphogenesis and Structural Optimization of Shell Structures with the Aid of a Genetic Algorithm, in “Journal of the International Association for Shell and Spatial Structures”, Vol. 48, n. 155, Dicembre 2007.

Proceedings of the IASS-IACM 2008, Ithaca NY

Published at http://hdl.handle.net/1813/11527 the Proceedings of the 6th IASS IACM Symposium.

Optimal design of glass grid shells with quadrilateral elements by means of a genetic algorithm

Presented at the IASS-IACM 2008, Ithaca NY, USA

Mario SASSONE, Alberto PUGNALE

Abstract
In this paper a constructional problem related to grid-shells design is approached as an optimisation problem and an evolutionary solution technique is proposed. The construction of glass grid-shells, when only four sides cladding elements are used, requires to check the planarity of each element, it means that the four corner points have to belong to the same plane. This requirement can be satisfied by generating the grid surface in specific ways (Schlaich and Bergermann), but when the design involves truly free form shapes, a procedure of optimisation able to reduce the non planarity of each element can be applied. The proposed one is based on the use of a genetic algorithm and has been applied to a benchmark and to a real case, in order to evaluate the efficiency of the procedure and the goodness of the solution.

On the interaction between architecture and engineering: the acoustic optimization of a reinforced concrete shell

Presented at the IASS-IACM 2008, Ithaca NY, USA

Mario SASSONE, Tomàs MENDEZ, Alberto PUGNALE

Abstract
In this paper a computational morphogenesis process is applied to the design and the optimization of the shell roof of a large music hall. The architectural concept is based on the folded plate technique: a set of reinforced concrete plates, connected to each other on the edges, forms the global shape of the roof. The dimensions of each plate are different, so that the structure is not regular; moreover each plate is not plane but slightly curved to form hypars. Starting from the geometric concept of the roof, a process of optimization and form finding has been applied, in order to obtain the best acoustic performance, in terms of distribution of the acoustic pressure level in the hall. The folded plate surface has been described mathematically by using a NURBS representation and the control point positions has been assumed as the design variables. The acoustic performance has been evaluated by means of an algorithm able to calculate the acoustic pressure level in all the points of the hall, considering the reflection of the roof. The uniformity of acoustic pressure level in all the points of the hall has been assumed as the target of the optimization process. A genetic algorithm, i.e. an evolutionary iterative population-based scheme, has been adopted in the optimization procedure. The evolution of the shape towards the optimal solution is controlled interactively by the designer, in order to avoid the convergence to unexpected configurations.

EARLY CUSTOMIZERS, New tools (2)

Personalizzatori precoci

Graham promoted the creation of a computerized program called Building Optimization Program (BOP), aimed to cut down the construction costs. This program was designed as a diagnostic tool by which architects and engineers could identify the points where constructive costs could be cut down, but, of course, it was accused on its the main priority, that was the economy rather than the project.
[…] Also the introduction of Computer-Aided Design and of its possibilities was the result of a collaboration between Graham and Khan. The use of computers by SOM dates back to the early fifties and to the construction of the Academy of Aeronautics. In the following years, with the development of research, computers entered in SOM, as happened in many companies, initially through the administrative sector. In 1963 SOM installed an IBM-1620 that was used for the study of complex structural systems, energy requirements and for financial planning. Khan, Graham and a third partner, Richard Keating, were convinced that computers would have also other applications, thus decided to invest in updating the equipment of SOM. When, in the mid-seventies, were first CAD programs was developed, SOM began to engage programmers and computer experts. In 1980 Douglas Stoker made a presentation to the partners including a spectacular fly-thought, on three screens, of the city of Chicago, that led to the preparation for the partners of a booklet based on the potential of informatics. Stoker became a partner in 1984 and SOM formed a joint venture with IBM for the development and sale of software and services. Later, there was a transformation of the market in which this initiative was moving. From a recollection of John Zils, associate partner and currently in charge for the group of structural engineers SOM Chicago: “many people began to realize that computer software would have produced a lot of money and they threw themselves into this market [investing in research] with a force that for us became impossible to compete with them.” As a result, SOM sold its system to IBM. However, says Zils: “this sale still remains something difficult to stand. We were used to create our own software customized for what we wanted to do… And now we are dependent of others who do things for us and that, of course, are not in the way in which we want them. We are always having to evaluate different software to find the one that better fits to our needs.”

From ADAMS N., Skidmore, Owings & Merrill: SOM since 1936, Phaidon Press, 2007.
(Extracted from the Italian publication, from which derives my English translation)

Adapting software to the specific needs of the designer is clearly a necessity that dates back to the birth of computers. Perhaps, even more than today, these technologies were considered as something that is not a constrain for design but rather something that allows to expand design tools, even leaving the designer totally free to create them by himself.
A correct approach in the use of computer is the first step to take towards a constructive critical debate on the use of new technologies within the architectural design. I note that several of the most recent publications (For instance Architettura e cultura digitale, DeLanda, etc…) forget the arguments of Frazer, Graham and Khan. They are only the first of many designers, including the Italian Luigi Moretti, who almost half a century ago have reflected about using new tools. In conclusion, why we do not start from this theoretical bases rather than digress completely from the main topic, as often happens today?
 
PERSONALIZZATORI PRECOCI, Nuovi strumenti (2)

Graham fu promotore della creazione di un programma computerizzato denominato Building Optimization Program (BOP), finalizzato all’abbattimento dei costi di costruzione. Questo programma era studiato come uno strumento diagnostico mediante il quale architetti e ingegneri potevano individuare i punti nei quali i costi esecutivi potevano essere tagliati, ma, naturalmente, attirava l’accusa che la priorità principale fosse l’economia più che il progetto.
[…] Anche l’introduzione delle possibilità insite nella progettazione computerizzata fu il risultato della collaborazione tra Graham e Khan. L’uso dei computer da parte di SOM risale ai primi anni cinquanta e alla costruzione dell’Accademia dell’Aeronautica. Negli anni successivi, con lo sviluppo della ricerca, i computer entrarono da SOM, come accadde in molte aziende, inizialmente attraverso il settore amministrativo. Nel 1963 SOM installò un IBM-1620 che veniva utilizzato per lo studio di sistemi strutturali complessi, dei fabbisogni energetici e per la gestione progettuale e finanziaria. Khan, Graham e un terzo partner, Richard Keating, erano convinti che i computer avrebbero avuto anche altre applicazioni, quindi decisero di investire nell’aggiornamento della dotazione informatica di SOM. Quando, a metà degli anni settanta, furono elaborati i primi programmi CAD, SOM cominciò ad assumere programmatori ed esperti di computer. Nel 1980 Douglas Stoker fece una presentazione ai partner comprendente uno spettacolare fly-throught, su tre schermi, della città di Chicago, che portò alla preparazione ai partner di una brochure sulle virtù della tecnologia informatica. Stoker divenne partner nel 1984 e SOM formò una joint venture con IBM per lo sviluppo e la vendita di servizi e software informatici. Successivamente, intervenne però una trasformazione del mercato nel quale questa iniziativa si muoveva. Come ricorda John Zils, associate partner e attualmente responsabile del gruppo strutturisti di SOM Chicago, “molta gente cominciava a rendersi conto che i software per computer avrebbero fatto moltissimi soldi e ci si buttarono [investendo denaro e ricerca] con una forza tale che per noi diventò impossibile competere”. Di conseguenza, SOM vendette il proprio sistema a IBM. Tuttavia, dice Zils: “ancora oggi la vendita rimane una cosa difficile da digerire. Eravamo abituati a crearci da soli il software su misura per quello che volevamo fare… E adesso ci troviamo a dipendere da altri che fanno le cose per noi e che, naturalmente, non le fanno nel modo, in cui noi vogliamo farle. Ci troviamo sempre a dover valutare i diversi software per trovare quello che si avvicina di più alle nostre esigenze.”

Tratto da: ADAMS N., Skidmore, Owings & Merrill: SOM dal 1936, Electa, Milano 2006, pp. 34-36.

L’adattamento del software alle specifiche esigenze del progettista è una necessità che evidentemente risale alla nascita dei computer. Forse ancora più che oggi, queste tecnologie erano viste come un qualcosa che non vincolava la progettazione ma piuttosto permetteva di ampliare gli strumenti progettuali, addirittura lasciando la totale libertà di crearseli su misura.
Un corretto approccio nell’uso dei computer è il primo passo da compiere verso un dibattito critico costruttivo sull’uso delle nuove tecnologie all’interno del progetto architettonico. Noto invece che parecchie tra le più recenti pubblicazioni (vedi Architettura e cultura digitale, vedi DeLanda, ecc…) dimenticano i ragionamenti di Frazer, di Graham e Khan. Questi ultimi addirittura progettisti che non si occupavano nello specifico di ricerca informatica. Sono solo i primi di tanti nomi, tra cui anche l’italiano Luigi Moretti, che quasi mezzo secolo addietro hanno ragionato sull’uso di nuovi strumenti informatici. A questo punto, perché non partire da queste basi invece di uscire totalmente fuori tema, come spesso accade oggi?