Solving Optimization Problems with MATLAB - ?· Symbolic Math Toolbox Functions for analytical computations…

Download Solving Optimization Problems with MATLAB - ?· Symbolic Math Toolbox Functions for analytical computations…

Post on 30-Aug-2018

212 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>1 2016 The MathWorks, Inc.</p><p>Solving Optimization Problems with MATLAB</p><p>Loren Shure</p></li><li><p>2</p><p> Introduction</p><p> Least-squares minimization</p><p> Nonlinear optimization</p><p> Mixed-integer programming</p><p> Global optimization</p><p>Topics</p></li><li><p>3</p><p>Optimization Problems</p><p>Minimize Risk</p><p>Maximize Profits</p><p>Maximize Fuel Efficiency</p></li><li><p>4</p><p>Design Process</p><p>Initial </p><p>Design </p><p>Variables</p><p>System</p><p>Modify </p><p>Design </p><p>Variables</p><p>Optimal </p><p>DesignObjectives</p><p>met?</p><p>No</p><p>Yes</p></li><li><p>5</p><p>Manually (trial-and-error or iteratively)</p><p>Why use Optimization?</p><p>Initial </p><p>Guess</p></li><li><p>6</p><p>Automatically (using optimization techniques)</p><p>Initial </p><p>Guess</p><p>Why use Optimization?</p></li><li><p>7</p><p>Why use Optimization?</p><p> Finding better (optimal) designs and decisions</p><p> Faster design and decision evaluations</p><p> Automate routine decisions</p><p> Useful for trade-off analysis</p><p> Non-intuitive designs may be found</p><p>Antenna Design Using Genetic Algorithmhttp://ic.arc.nasa.gov/projects/esg/research/antenna.htm</p><p>http://ic.arc.nasa.gov/projects/esg/research/antenna.htm</p></li><li><p>8</p><p> Introduction</p><p> Least-squares minimization</p><p> Nonlinear optimization</p><p> Mixed-integer programming</p><p> Global optimization</p><p>Topics</p></li><li><p>9</p><p>Curve Fitting Demo</p><p>Given some data:</p><p>Fit a curve of the form:</p><p>teccty 21</p><p>)(</p><p>t = [0 .3 .8 1.1 1.6 2.3];</p><p>y = [.82 .72 .63 .60 .55 .50];</p></li><li><p>10</p><p>How to solve?</p><p> Ecc</p><p>cey</p><p>eccty</p><p>t</p><p>t</p><p>2</p><p>1</p><p>21</p><p>1</p><p>)(</p><p>As a linear system of equations:</p><p>2</p><p>2min yEc</p><p>Ecy</p><p>c</p><p>Cant solve this exactly </p><p>(6 eqns, 2 unknowns)</p><p>An optimization problem!</p><p>2</p><p>1</p><p>3.2</p><p>6.1</p><p>1.1</p><p>8.0</p><p>3.0</p><p>0</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>50.0</p><p>55.0</p><p>60.0</p><p>63.0</p><p>72.0</p><p>82.0</p><p>c</p><p>c</p><p>e</p><p>e</p><p>e</p><p>e</p><p>e</p><p>e</p></li><li><p>11</p><p> Introduction</p><p> Least-squares minimization</p><p> Nonlinear optimization</p><p> Mixed-integer programming</p><p> Global optimization</p><p>Topics</p></li><li><p>12</p><p>Nonlinear Optimization</p><p>min</p><p>log 1 + 1 4</p><p>3</p><p>2</p><p>+ 3 1 + 2 13 2</p></li><li><p>13</p><p>Nonlinear Optimization - Modeling Gantry Crane</p><p> Determine acceleration profile that </p><p>minimizes payload swing</p><p>s25s4</p><p>s20s1</p><p>s20s1</p><p>:sConstraint</p><p>2</p><p>1</p><p>21</p><p>f</p><p>p</p><p>p</p><p>ppf</p><p>t</p><p>t</p><p>t</p><p>ttt</p></li><li><p>14</p><p>Symbolic Math ToolboxFunctions for analytical computations</p><p> Conveniently manage &amp; document symbolic </p><p>computations in Live Editor</p><p> Math notation, embedded text, graphics</p><p> Share work as pdf or html</p><p> Perform exact computations using familiar </p><p>MATLAB syntax in MATLAB</p><p>Integration</p><p>Differentiation</p><p>Solving equations</p><p>Transforms</p><p>Simplification</p><p> Integrate with numeric computing MATLAB,</p><p>Simulink and Simscape language</p><p> Perform Variable-precision arithmetic</p></li><li><p>15</p><p> Introduction</p><p> Least-squares minimization</p><p> Nonlinear optimization</p><p> Mixed-integer programming</p><p> Global optimization</p><p>Topics</p></li><li><p>16</p><p>Mixed-Integer Programming</p><p> Many things exist in discrete amounts:</p><p> Shares of stock</p><p> Number of cars a factory produces</p><p> Number of cows on a farm</p><p> Often have binary decisions:</p><p> On/off</p><p> Buy/dont buy</p><p> Mixed-integer linear programming:</p><p> Solve optimization problem while enforcing that certain variables need to be integer</p></li><li><p>17</p><p>Continuous and integer variables</p><p>1 0, 100 2 {1,2,3,4,5}</p><p>Linear objective and constraints</p><p>min</p><p>1 22</p><p> 1 + 42 201 + 2 = 10</p><p>such that</p><p>Mixed-Integer Linear Programming</p></li><li><p>18</p><p>Traveling Salesman Problem</p><p>Problem</p><p> How to find the shortest path through a series of points?</p><p>Solution</p><p> Calculate distances between all combinations of points</p><p> Solve an optimization problem where variables correspond to trips between two points</p><p>1</p><p>11</p><p>0</p><p>1</p><p>1</p><p>0</p><p>0</p><p>00</p></li><li><p>19</p><p> Introduction</p><p> Least-squares minimization</p><p> Nonlinear optimization</p><p> Mixed-integer programming</p><p> Global optimization</p><p>Topics</p></li><li><p>20</p><p>Example Global Optimization Problems</p><p>Why does fmincon have a hard time finding the </p><p>function minimum?</p><p>0 5 10</p><p>-10</p><p>-5</p><p>0</p><p>5</p><p>10</p><p>x</p><p>Starting at 10</p><p>0 5 10</p><p>-10</p><p>-5</p><p>0</p><p>5</p><p>10</p><p>x</p><p>Starting at 8</p><p>0 5 10</p><p>-10</p><p>-5</p><p>0</p><p>5</p><p>10</p><p>x</p><p>Starting at 6</p><p>x s</p><p>in(x</p><p>) +</p><p> x c</p><p>os(2</p><p> x)</p><p>0 5 10</p><p>-10</p><p>-5</p><p>0</p><p>5</p><p>10</p><p>x</p><p>Starting at 3</p><p>0 5 10</p><p>-10</p><p>-5</p><p>0</p><p>5</p><p>10</p><p>x</p><p>Starting at 1</p><p>0 5 10</p><p>-10</p><p>-5</p><p>0</p><p>5</p><p>10</p><p>x</p><p>Starting at 0</p><p>x s</p><p>in(x</p><p>) +</p><p> x c</p><p>os(2</p><p> x)</p></li><li><p>21</p><p>Initial </p><p>Guess</p><p>Example Global Optimization Problems</p><p>Why didnt fminunc find the maximum efficiency?</p></li><li><p>22</p><p>Example Global Optimization Problems</p><p>Why didnt nonlinear regression find a good fit?</p><p>0 20 40 60 80 100 1200</p><p>0.1</p><p>0.2</p><p>0.3</p><p>0.4</p><p>0.5</p><p>0.6</p><p>0.7</p><p>0.8</p><p>t</p><p>c</p><p>c=b1e-b4t+b</p><p>2e-b5t+b</p><p>3e-b6t</p></li><li><p>23</p><p>Global Optimization</p><p>Goal:</p><p>Want to find the lowest/largest value of </p><p>the nonlinear function that has many local </p><p>minima/maxima</p><p>Problem:</p><p>Traditional solvers often return one of the </p><p>local minima (not the global)</p><p>Solution:</p><p>A solver that locates globally optimal </p><p>solutions</p><p>Global Minimum at [0 0]</p><p>Rastrigins Function</p></li><li><p>24</p><p>Global Optimization Solvers Covered Today</p><p> Multi Start</p><p> Global Search</p><p> Simulated Annealing</p><p> Pattern Search</p><p> Particle Swarm </p><p> Genetic Algorithm</p></li><li><p>25</p><p>MultiStart Demo Nonlinear Regression</p><p>lsqcurvefit solution MultiStart solution</p></li><li><p>26</p><p>MULTISTART</p></li><li><p>27</p><p>What is MultiStart?</p><p> Run a local solver from each set </p><p>of start points</p><p> Option to filter starting points </p><p>based on feasibility</p><p> Supports parallel computing</p></li><li><p>28</p><p>MultiStart Demo Peaks Function</p></li><li><p>29</p><p>GLOBAL SEARCH</p></li><li><p>30</p><p>What is GlobalSearch?</p><p> Multistart heuristic algorithm</p><p> Calls fmincon from multiple </p><p>start points to try and find a </p><p>global minimum</p><p> Filters/removes non-promising </p><p>start points</p></li><li><p>31</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Schematic Problem</p><p>Peaks function </p><p>Three minima</p><p>Green, z = -0.065</p><p>Red, z= -3.05</p><p>Blue, z = -6.55</p><p>x</p><p>y</p></li><li><p>32</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 0Run from specified x0</p><p>x</p><p>y</p></li><li><p>33</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 1</p><p>3</p><p>6</p><p>0</p><p>00</p><p>4</p><p>0</p><p>-2</p><p>x</p><p>y</p></li><li><p>34</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 1</p><p>3</p><p>6</p><p>0</p><p>00</p><p>4</p><p>0</p><p>-2</p><p>x</p><p>y</p></li><li><p>35</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 1</p><p>x</p><p>y</p></li><li><p>36</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2</p><p>x</p><p>y</p></li><li><p>37</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2</p><p>x</p><p>y</p></li><li><p>38</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2</p><p>x</p><p>y</p></li><li><p>39</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2</p><p>x</p><p>y</p></li><li><p>40</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2</p><p>6</p><p>Current penalty </p><p>threshold value : 4</p><p>x</p><p>y</p></li><li><p>41</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2</p><p>x</p><p>y</p></li><li><p>42</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2</p><p>Current penalty </p><p>threshold value : 4</p><p>-3</p><p>x</p><p>y</p></li><li><p>43</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>GlobalSearch Overview Stage 2Expand basin of attraction if minimum already found</p><p>Current penalty threshold value : 2</p><p>-0.1</p><p>x</p><p>y Basins can overlap</p></li><li><p>44</p><p>GlobalSearch Demo Peaks Function</p></li><li><p>45</p><p>SIMULATED ANNEALING</p></li><li><p>46</p><p>What is Simulated Annealing?</p><p> A probabilistic metaheuristic</p><p>approach based upon the physical </p><p>process of annealing in </p><p>metallurgy. </p><p> Controlled cooling of a metal </p><p>allows atoms to realign from a </p><p>random higher energy state to an </p><p>ordered crystalline (globally) lower </p><p>energy state </p></li><li><p>47</p><p>Simulated Annealing Overview Iteration 1Run from specified x0</p><p>x</p><p>y</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>0.9</p></li><li><p>48</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration 1</p><p>3</p><p>x</p><p>y 0.9</p><p>Possible New Points: </p><p>Standard Normal N(0,1) * Temperature</p><p>Temperature = 1</p></li><li><p>49</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration 1</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 1</p><p>11.01</p><p>1/)9.03(</p><p> Taccept eP</p></li><li><p>50</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration 1</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 1</p><p>0.3</p></li><li><p>51</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration 1</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 1</p><p>0.3</p></li><li><p>52</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration 2</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 1</p><p>0.3</p></li><li><p>53</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration 2</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 0.75</p><p>0.3</p><p>-1.2</p></li><li><p>54</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration N-1</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 0.1</p><p>0.3</p><p>-1.2</p><p>-3</p></li><li><p>55</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration NReannealing</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 1</p><p>0.3</p><p>-1.2</p><p>-3</p><p>-2</p></li><li><p>56</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration NReannealing</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 1</p><p>0.3</p><p>-1.2</p><p>-3</p><p>-2</p><p>27.01</p><p>1/))3(2(</p><p> Taccept eP</p></li><li><p>57</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration NReannealing</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 1</p><p>0.3</p><p>-1.2</p><p>-3</p><p>-2</p></li><li><p>58</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration N+1</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 0.75</p><p>0.3</p><p>-1.2</p><p>-3</p><p>-2</p><p>-3</p></li><li><p>59</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration N+1</p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 0.75</p><p>0.3</p><p>-1.2</p><p>-3</p><p>-2</p><p>-3</p></li><li><p>60</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Simulated Annealing Overview Iteration </p><p>3</p><p>x</p><p>y 0.9</p><p>Temperature = 0.75</p><p>0.3</p><p>-1.2</p><p>-3</p><p>-2</p><p>-3</p><p>-6.5</p></li><li><p>61</p><p>Simulated Annealing Peaks Function</p></li><li><p>62</p><p>PATTERN SEARCH</p><p>(DIRECT SEARCH)</p></li><li><p>63</p><p>What is Pattern Search?</p><p> An approach that uses a pattern </p><p>of search directions around the </p><p>existing points</p><p> Expands/contracts around the </p><p>current point when a solution is </p><p>not found</p><p> Does not rely on gradients: works </p><p>on smooth and nonsmooth</p><p>problems</p></li><li><p>64</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Pattern Search Overview Iteration 1Run from specified x0</p><p>x</p><p>y</p><p>3</p></li><li><p>65</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Pattern Search Overview Iteration 1Apply pattern vector, poll new points for improvement</p><p>x</p><p>y</p><p>3</p><p>Mesh size = 1</p><p>Pattern vectors = [1,0], [0,1], [-1,0], [0,-1] </p><p>0_*_ xvectorpatternsizemeshPnew </p><p>0]0,1[*1 x1.6</p><p>0.4</p><p>4.6</p><p>2.8</p><p>First poll successful</p><p>Complete Poll (not default)</p></li><li><p>66</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Pattern Search Overview Iteration 2</p><p>x</p><p>y</p><p>3</p><p>Mesh size = 2</p><p>Pattern vectors = [1,0], [0,1], [-1,0], [0,-1] </p><p>1.6</p><p>0.4</p><p>4.6</p><p>2.8</p><p>-4</p><p>0.3-2.8</p><p>Complete Poll</p></li><li><p>67</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Pattern Search Overview Iteration 3</p><p>x</p><p>y</p><p>3</p><p>Mesh size = 4</p><p>Pattern vectors = [1,0], [0,1], [-1,0], [0,-1] </p><p>1.6</p><p>0.4</p><p>4.6</p><p>2.8</p><p>-4</p><p>0.3-2.8</p></li><li><p>68</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Pattern Search Overview Iteration 4</p><p>x</p><p>y</p><p>3</p><p>Mesh size = 4*0.5 = 2</p><p>Pattern vectors = [1,0], [0,1], [-1,0], [0,-1] </p><p>1.6</p><p>0.4</p><p>4.6</p><p>2.8</p><p>-4</p><p>0.3-2.8</p></li><li><p>69</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Pattern Search Overview Iteration NContinue expansion/contraction until convergence</p><p>x</p><p>y</p><p>31.6</p><p>0.4</p><p>4.6</p><p>2.8</p><p>-4</p><p>0.3-2.8</p><p>-6.5</p></li><li><p>70</p><p>Pattern Search Peaks Function</p></li><li><p>71</p><p>Pattern Search Climbs Mount Washington</p></li><li><p>72</p><p>PARTICLE SWARM</p></li><li><p>73</p><p>What is Particle Swarm Optimization?</p><p> A collection of particles move </p><p>throughout the region</p><p> Particles have velocity and are </p><p>affected by the other particles in </p><p>the swarm</p><p> Does not rely on gradients: works </p><p>on smooth and nonsmooth</p><p>problems</p></li><li><p>74</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Particle Swarm Overview Iteration 1Initialize particle locations and velocities, evaluate all </p><p>locations</p><p>x</p><p>y</p></li><li><p>75</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Particle Swarm Overview Iteration NUpdate velocities for each particle</p><p>x</p><p>yPrevious </p><p>Velocity</p><p>Best Location </p><p>for this Particle</p><p>Best Location for </p><p>Neighbor Particles</p></li><li><p>76</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Particle Swarm Overview Iteration NUpdate velocities for each particle</p><p>x</p><p>y</p><p>New </p><p>Velocity</p></li><li><p>77</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Particle Swarm Overview Iteration NMove particles based on new velocities</p><p>x</p><p>y</p></li><li><p>78</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Particle Swarm Overview Iteration NContinue swarming until convergence</p><p>x</p><p>y</p></li><li><p>79</p><p>Particle Swarm Peaks Function</p></li><li><p>80</p><p>GENETIC ALGORITHM</p></li><li><p>81</p><p>What is a Genetic Algorithm?</p><p> Uses concepts from evolutionary </p><p>biology</p><p> Start with an initial generation of </p><p>candidate solutions that are tested </p><p>against the objective function</p><p> Subsequent generations evolve </p><p>from the 1st through selection, </p><p>crossover and mutation</p></li><li><p>82</p><p>How Evolution Works Binary Case</p><p> Selection</p><p> Retain the best performing bit strings from one generation to the next. Favor these for </p><p>reproduction</p><p> parent1 = [ 1 0 1 0 0 1 1 0 0 0 ]</p><p> parent2 = [ 1 0 0 1 0 0 1 0 1 0 ]</p><p> Crossover</p><p> parent1 = [ 1 0 1 0 0 1 1 0 0 0 ]</p><p> parent2 = [ 1 0 0 1 0 0 1 0 1 0 ]</p><p> child = [ 1 0 0 0 0 1 1 0 1 0 ]</p><p> Mutation</p><p> parent = [ 1 0 1 0 0 1 1 0 0 0 ]</p><p> child = [ 0 1 0 1 0 1 0 0 0 1 ] </p></li><li><p>83</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Genetic Algorithm Iteration 1Evaluate initial population</p><p>x</p><p>y</p></li><li><p>84</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Genetic Algorithm Iteration 1Select a few good solutions for reproduction</p><p>x</p><p>y</p></li><li><p>85</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Genetic Algorithm Iteration 2Generate new population and evaluate</p><p>x</p><p>y</p></li><li><p>86</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Genetic Algorithm Iteration 2</p><p>x</p><p>y</p></li><li><p>87</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Genetic Algorithm Iteration 3</p><p>x</p><p>y</p></li><li><p>88</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Genetic Algorithm Iteration 3</p><p>x</p><p>y</p></li><li><p>89</p><p>-3 -2 -1 0 1 2 3-3</p><p>-2</p><p>-1</p><p>0</p><p>1</p><p>2</p><p>3</p><p>Genetic Algorithm Iteration NContinue process until stopping criteria are met</p><p>x</p><p>y</p><p>Solution found</p></li><li><p>90</p><p>Genetic Algorithm Peaks Function</p></li><li><p>91</p><p>Genetic Algorithm Integer Constraints</p><p>Mixed Integer Optimization</p><p>s.t. some x are integers</p><p>Examples</p><p> Only certain sizes of components </p><p>available</p><p> Can only purchase whole shares of stock</p><p>)(min xfx</p></li><li><p>92</p><p>Application: Circuit Component Selection</p><p> 6 components to size</p><p> Only certain sizes available</p><p> Objective: </p><p> Match Voltage vs. Temperature </p><p>curve</p><p>Thermistor Circuit</p><p>300 </p><p>330 </p><p>360 </p><p>180k </p><p>200k </p><p>220k </p><p>Thermistors: </p><p>Resistance varies </p><p>nonlinea

Recommended

View more >