Traditional Culture Encyclopedia - Traditional culture - Global optimization and local optimization of matlab
Global optimization and local optimization of matlab
The traditional optimization tools provided in matlab can realize local optimization, but to realize global optimization, we must use global optimization tools, which mainly include:
GlobalSearch global search and MultiStart multi-starting method generate some starting points, and then they use local solvers to find the best point at the starting point attraction basin.
Ga genetic algorithm uses a set of starting points (called population) to generate better points from the population through iteration. As long as the initial population covers several pots, GA can check several pots.
Simulated annealing completes random search. Usually simulated annealing algorithm accepts a point, as long as it is better than the previous one, and occasionally accepts a worse point in order to turn to a different watershed.
Patternsearch pattern search algorithm should look at a set of nearby points before accepting a point. If some nearby points belong to different basins, the pattern search algorithm is essentially to search several basins at the same time.
Below I will use some concrete examples to illustrate various optimization methods:
It can be seen that the initial value x0 is different, and the results are completely different, which shows that this solver can find the local optimum, but not necessarily the global optimum, and get the global optimum when the starting point is 8.
Let's change the solver: fminbound, which doesn't need to give an initial value.
Therefore, the global optimization method can obtain the global optimum.
Results: The error of least square fitting result was large.
It can be seen that the global optimization result is good and the error is small.
Running time of this algorithm: the elapsed time is 6. 139324 seconds.
Using Parallel Computing to Solve Problems
Results: The conversion of 14 in the operation of 100 local solver has a positive exit sign of local solver.
The elapsed time is 4.358762 seconds. Send a stop signal to all laboratories ... stop. It can be seen that the running time is reduced and the efficiency is improved.
This method can only find the local optimum.
Now use the global optimization algorithm:
- Previous article:Japanese traditional tattoo exhibition
- Next article:Difference between Delta Motion Controller and Ordinary PLC
- Related articles
- What's the difference between new Chinese men's wear and traditional men's wear?
- Analysis of RFM model
- Cover of China traditional desk calendar
- How to write 800 words essay on the flavor of New Year's Day
- Why is the third-level distribution of WeChat the future trend of mobile e-commerce?
- What kinds of garden trees are there (Catalogue of Common Trees for Landscaping)
- What is the economy of China in the Internet age?
- What is the meaning of Convention and Exhibition
- What are the novel topics for the Winter Olympics?
- Which country did the ice and snow movement originate from?