Problembasiertes globales Optimierungs-Setup
solve
aufrufenGlobal Optimization Toolbox bietet zwei Ansätze zur Optimierung: problembasiert und löserbasiert. Siehe Decide Between Problem-Based and Solver-Based Approach. Bei der problembasierten Optimierung erstellen Sie Optimierungsvariablen im symbolischen Stil. Anschließend erstellen Sie in diesen Variablen Ausdrücke, die das Ziel und die Einschränkungen darstellen. Lösen Sie das Problem abschließend mit solve
. Einzelheiten finden Sie unter Problem-Based Optimization Workflow.
Hinweis: Wenn Sie eine nichtlineare Funktion haben, die nicht aus Polynomen, rationalen Ausdrücken und elementaren Funktionen wie exp
besteht, konvertieren Sie die Funktion mithilfe von fcn2optimexpr
in einen Optimierungsausdruck. Siehe Convert Nonlinear Function to Optimization Expression und Supported Operations for Optimization Variables and Expressions.
Ein einfaches Beispiel finden Sie unter Compare Several Global Solvers, Problem-Based.
Funktionen
Objekte
OptimizationConstraint | Optimization constraints |
OptimizationEquality | Equalities and equality constraints |
OptimizationExpression | Arithmetic or functional expression in terms of optimization variables |
OptimizationInequality | Inequality constraints |
OptimizationProblem | Optimization problem |
OptimizationValues | Values for optimization problems (Seit R2022a) |
OptimizationVariable | Variable for optimization |
Themen
Problembasierte Schritte
- Problem-Based Optimization Workflow
Learn the problem-based steps for solving optimization problems. - Optimization Expressions
Define expressions for both the objective and constraints. - Pass Extra Parameters in Problem-Based Approach
Pass extra parameters, data, or fixed variables in the problem-based approach. - Named Index for Optimization Variables
Create and work with named indices for variables. - Review or Modify Optimization Problems
Review or modify problem elements such as variables and constraints. - Examine Optimization Solution
Evaluate the solution and its quality.
Schritte für globale Solver
- Decide Between Problem-Based and Solver-Based Approach
Explore considerations for problem-based and solver-based optimization with Global Optimization Toolbox solvers. - Global Optimization Toolbox Default Solvers and Problem Types
Identify the types of problems you can solve in the problem-based approach and their associated default solvers. - Initial Points for Global Optimization Toolbox Solvers
Specify initial points for Global Optimization Toolbox solvers in the problem-based approach. - Integer Constraints in Nonlinear Problem-Based Optimization
Learn how the problem-based optimization functionsprob2struct
andsolve
handle integer constraints.
Festlegen globaler Optimierungsoptionen
- Set Problem-Based Optimization Options for Global Optimization Toolbox Solvers
How to set and change optimization options in the problem-based approach for Global Optimization Toolbox. - Set Options in Problem-Based Approach Using varindex
To set options in some contexts, map problem-based variables to solver-based usingvarindex
. - Pattern Search Options
Explore the options for pattern search. - Genetic Algorithm Options
Explore the options for the genetic algorithm. - Particle Swarm Options
Explore the options for particle swarm. - Surrogate Optimization Options
Explore the options for surrogate optimization, including algorithm control, stopping criteria, command-line display, and output and plot functions. - Simulated Annealing Options
Explore the options for simulated annealing.
Tipps zur problembasierten Optimierung
- Create Efficient Optimization Problems
Obtain a faster or more accurate solution when the problem has integer constraints, and avoid loops when creating a problem. - Separate Optimization Model from Data
Create reusable, scalable problems by separating the model from the data. - Variables with Duplicate Names Disallowed
Learn how to solve a problem that has two optimization variables with the same name. - Create Initial Point for Optimization with Named Index Variables
Create initial points forsolve
when the problem has named index variables by using thefindindex
function. - Expression Contains Inf or NaN
Optimization expressions containingInf
orNaN
cannot be displayed, and can cause unexpected results. - Objective and Constraints Having a Common Function in Serial or Parallel, Problem-Based
Save time when the objective and nonlinear constraint functions share common computations in the problem-based approach. - Obtain Generated Function Details
Find the values of extra parameters in nonlinear functions created byprob2struct
. - Output Function for Problem-Based Optimization
Use an output function in the problem-based approach to record iteration history and to make a custom plot.
Paralleles Rechnen
- How Solvers Compute in Parallel
Learn how solvers distribute work for parallel computing. - How to Use Parallel Processing in Global Optimization Toolbox
Direct a solver or hybrid function to use multiple processes. - Minimizing an Expensive Optimization Problem Using Parallel Computing Toolbox
Example showing the effectiveness of parallel computing in two solvers:fmincon
andga
. - Improving Performance with Parallel Computing
Investigate factors for speeding optimizations.
Problembasierte Algorithmen
- Problem-Based Optimization Algorithms
Learn how the optimization functions and objects solve optimization problems. - Supported Operations for Optimization Variables and Expressions
Explore the supported mathematical and indexing operations for optimization variables and expressions.