{"id":2615,"date":"2010-10-29T13:58:03","date_gmt":"2010-10-29T13:58:03","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2010\/10\/29\/optimize-quickly\/"},"modified":"2017-01-06T21:31:27","modified_gmt":"2017-01-07T02:31:27","slug":"optimize-quickly","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2010\/10\/29\/optimize-quickly\/","title":{"rendered":"Optimize, Quickly!"},"content":{"rendered":"<div class=\"content\">\r\n<h3>Contents<\/h3>\r\n<div>\r\n<ul>\r\n\t<li><a href=\"#3\">Getting Started with Optimization<\/a><\/li>\r\n\t<li><a href=\"#5\">Global Optimization<\/a><\/li>\r\n\t<li><a href=\"#7\">Parallelizing Optimization Solutions<\/a><\/li>\r\n<\/ul>\r\n<\/div>\r\nBrett's Pick this week has three components. All are by MathWorker Stuart Kozola, and all will help you become an expert user of our optimization tools.\r\n\r\nWe frequently present and record Webinars that are available for free download and viewing. Stuart is a technical marketing guru who focuses on our math and data analysis\r\ntools. Whenever a Webinar focuses on optimization, Stuart is sure to be behind the scenes, if not in front of the microphone!\r\n<h3>Getting Started with Optimization<a name=\"3\"><\/a><\/h3>\r\nFirst, I would like to share Stuart's link to the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/21239-tips---tricks--getting-started-using-optimization-with-matlab\">files used<\/a> in the August 21, 2008 Webinar entitled \"Tips and Tricks: Getting started using optimization with MATLAB\". In that session, Stuart provides an overview of <a href=\"https:\/\/www.mathworks.com\/products\/optimization\/\">Optimization Toolbox<\/a> and <a href=\"https:\/\/www.mathworks.com\/products\/global-optimization\/\">Global Optimization Toolbox<\/a> with several examples, ranging from constrained curve fitting to general maximization problems. Stuart steps through a totally-cool\r\nillustrative example of maxima detection by attempting to locate the highest peak in a range of mountains. (Here, we can think\r\nof the topography as a analogy for an objective function.)\r\n\r\n<h3>Global Optimization<a name=\"5\"><\/a><\/h3>\r\nNext, Stuart turns his attention to the problem of finding global optima from search domains that may include local maxima\r\nor minima:\r\n\r\n\r\nFor these problems, our Global Optimization Toolbox can be quite useful. In a Webinar entitled \" Global Optimization with MATLAB Products,\" Stuart shared a wealth of information about different types of optimization problems, including those for which a genetic\r\nalgorithms is appropriate. Here is the <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/27178-global-optimization-with-matlab\">File Exchange link<\/a> to the files used in that Webinar.\r\n<h3>Parallelizing Optimization Solutions<a name=\"7\"><\/a><\/h3>\r\nFinally, Stuart describes an approach to <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/28487-speeding-up-optimization-problems-with-parallel-computing\">speeding up optimization problems<\/a>, providing instruction for using the <a href=\"https:\/\/www.mathworks.com\/products\/parallel-computing\/\">Parallel Computing Toolbox<\/a> and <a href=\"https:\/\/www.mathworks.com\/products\/distriben\/\">MATLAB Distributed Computing Server<\/a> to parallelize the calculation of optima. In this Webinar, Stuart minimizes the potential energy of electrons on a conducting body. He solves the optimization problem without the\r\nParallel Computing Toolbox in about 84 seconds. Next, he opens a non-local 4-core cluster and re-solves the problem in parallel,\r\nsimply by checking an \"evaluate in parallel\" checkbox. This time the same problem is solved in 25 seconds--approximately a\r\n3.4x speedup. Not bad for checking a checkbox!\r\n\r\n\r\n<a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2615#respond\"> Comments?<\/a>\r\n\r\n<script>\/\/ <![CDATA[\r\nfunction grabCode_481797f11ac3475ca81b6fbb008aa867() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='481797f11ac3475ca81b6fbb008aa867 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 481797f11ac3475ca81b6fbb008aa867';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Brett Shoelson';\r\n        copyright = 'Copyright 2010 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('\r\n\r\n\r\n\r\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\r\n\r\n\r\n\r\n\r\n\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }\r\n\/\/ ]]><\/script>\r\n<p style=\"text-align: right; font-size: xx-small; font-weight: lighter; font-style: italic; color: gray;\"><a><span style=\"font-size: x-small; font-style: italic;\">Get\r\nthe MATLAB code\r\n<noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\r\nPublished with MATLAB\u00ae 7.11\r\n\r\n<\/div>\r\n<!--\r\n481797f11ac3475ca81b6fbb008aa867 ##### SOURCE BEGIN #####\r\n%% Optimize, Quickly!\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/911 Brett>'s\r\n% Pick this week has three components. All are by MathWorker\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/24834 Stuart Kozola>,\r\n% and all will help you become an expert user of our optimization tools.\r\n%\r\n\r\n%%\r\n% We frequently present and record <https:\/\/www.mathworks.com\/company\/events\/webinars\/?s_cid=HP_E_RW Webinars>\r\n% that are available for free download and viewing. Stuart is a technical\r\n% marketing guru who focuses on our math and data analysis tools.\r\n% Whenever a Webinar focuses on optimization, Stuart is sure to be behind\r\n% the scenes, if not in front of the microphone!\r\n\r\n%% Getting Started with Optimization\r\n% First, I would like to share Stuart's link to the <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/21239-tips---tricks--getting-started-using-optimization-with-matlab files used> in the August 21, 2008 Webinar entitled\r\n% <https:\/\/www.mathworks.com\/wbnr31356 \"Tips and Tricks: Getting started using optimization with MATLAB\">.\r\n% In that session, Stuart provides an overview of <https:\/\/www.mathworks.com\/products\/optimization\/ Optimization Toolbox> and\r\n% <https:\/\/www.mathworks.com\/products\/global-optimization\/ Global Optimization Toolbox>\r\n% with several examples, ranging from constrained curve fitting to general\r\n% maximization problems. Stuart steps through a totally-cool illustrative example\r\n% of maxima detection by attempting to locate the highest peak in a range of mountains. (Here, we\r\n% can think of the topography as a analogy for an objective function.)\r\n\r\n%%\r\n%\r\n% <<https:\/\/www.mathworks.com\/matlabcentral\/fx_files\/21239\/1\/optimTipsTricksWalkthrough_01.png>>\r\n%\r\n\r\n%% Global Optimization\r\n% Next, Stuart turns his attention to the problem of finding global optima from search domains that\r\n% may include local maxima or minima:\r\n%\r\n\r\n%%\r\n%\r\n% <<https:\/\/www.mathworks.com\/matlabcentral\/fx_files\/27178\/1\/gaRastriginsExample_01.png>>\r\n%\r\n% For these problems, our Global Optimization Toolbox can be quite useful. In a Webinar entitled\r\n% \" <https:\/\/www.mathworks.com\/wbnr43346 Global Optimization with MATLAB Products>,\"\r\n% Stuart shared a wealth of information about different types of\r\n% optimization problems, including those for which a genetic algorithms is\r\n% appropriate. Here is the <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/27178-global-optimization-with-matlab File Exchange link> to the files used in that\r\n% Webinar.\r\n\r\n%% Parallelizing Optimization Solutions\r\n% Finally, Stuart describes an approach to\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/28487-speeding-up-optimization-problems-with-parallel-computing speeding up optimization problems>,\r\n% providing instruction for using the\r\n% <https:\/\/www.mathworks.com\/products\/parallel-computing\/ Parallel Computing Toolbox> and\r\n% <https:\/\/www.mathworks.com\/products\/distriben\/ MATLAB Distributed Computing Server>\r\n% to parallelize the calculation of optima. In\r\n% <https:\/\/www.mathworks.com\/wbnr50746 this Webinar>,\r\n% Stuart minimizes the potential energy of electrons on a conducting body.\r\n% He solves the optimization problem without the Parallel Computing Toolbox\r\n% in about 84 seconds. Next, he opens a non-local 4-core cluster and re-solves the problem in parallel, simply by checking an \"evaluate in parallel\" checkbox.\r\n% This time the same problem is solved in 25 secondsREPLACE_WITH_DASH_DASHapproximately a 3.4x speedup. Not bad for checking a checkbox!\r\n\r\n%%\r\n%\r\n% <<https:\/\/www.mathworks.com\/matlabcentral\/fx_files\/28487\/1\/electronProblemOptimization_02.png>>\r\n%\r\n\r\n%%\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2615#respond Comments?>\r\n\r\n##### SOURCE END ##### 481797f11ac3475ca81b6fbb008aa867\r\n-->","protected":false},"excerpt":{"rendered":"<p>\r\nContents\r\n\r\n\r\n\tGetting Started with Optimization\r\n\tGlobal Optimization\r\n\tParallelizing Optimization Solutions\r\n\r\n\r\nBrett's Pick this week has three components. All are by MathWorker Stuart Kozola,... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2010\/10\/29\/optimize-quickly\/\">read more >><\/a><\/p>","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2615"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2615"}],"version-history":[{"count":3,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2615\/revisions"}],"predecessor-version":[{"id":8339,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2615\/revisions\/8339"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}