Impostazione dell'ottimizzazione globale basata sui problemi
solve
Global Optimization Toolbox ha due approcci per l'ottimizzazione: basato sui problemi e basato sul risolutore. Vedi Decide Between Problem-Based and Solver-Based Approach . Nell'ottimizzazione basata sui problemi, si creano variabili di ottimizzazione in stile simbolico. Quindi si creano espressioni in queste variabili che rappresentano l'obiettivo e i vincoli. Infine, risolvi il problema usando solve
. Per i dettagli, vedere Problem-Based Optimization Workflow .
Nota: Se si ha una funzione non lineare che non è composta da polinomi, espressioni razionali e funzioni elementari come exp
, allora si può convertire la funzione in un'espressione di ottimizzazione utilizzando fcn2optimexpr
. Vedere Convert Nonlinear Function to Optimization Expression e Supported Operations for Optimization Variables and Expressions .
Per un esempio di base, vedere Confronta diversi risolutori globali, basati sui problemi .
Funzioni
Oggetti
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 (Da R2022a) |
OptimizationVariable | Variable for optimization |
Argomenti
Passaggi basati sui problemi
- 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.
Passaggi per i risolutori globali
- 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.
Imposta le opzioni di ottimizzazione globale
- 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.
Suggerimenti per l'ottimizzazione basata sui problemi
- 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.
Calcolo parallelo
- 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.
Algoritmi basati sui problemi
- 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.