La traducción de esta página está obsoleta. Haga clic aquí para ver la última versión en inglés.
Configuración de optimización basada en problemas
En la optimización basada en problemas se crean variables de optimización, expresiones en estas variables que representan el objetivo y las restricciones o que representan ecuaciones, y se resuelve el problema utilizando solve
. Para saber qué pasos basados en problemas se deben tomar en los problemas de optimización, consulte Problem-Based Optimization Workflow. Para resolver ecuaciones, consulte Problem-Based Workflow for Solving Equations.
Antes de comenzar a resolver un problema de optimización, deberá elegir el enfoque adecuado: basado en problemas o basado en solvers. Para obtener más detalles, consulte En primer lugar, elija el enfoque basado en problemas o el enfoque basado en solvers.
Nota: Si tiene una función no lineal que no está compuesta por polinomios, expresiones racionales y funciones elementales como exp
, convierta la función en una expresión de optimización utilizando fcn2optimexpr
. Consulte Convert Nonlinear Function to Optimization Expression y Supported Operations for Optimization Variables and Expressions.
Para ver un ejemplo básico de optimización no lineal, consulte Solve a Constrained Nonlinear Problem, Problem-Based. Para ver un ejemplo básico de programación lineal de enteros mixtos, consulte Mixed-Integer Linear Programming Basics: Problem-Based. Para ver un ejemplo básico de resolución de ecuaciones, consulte Resolver un sistema de ecuaciones no lineal, basado en problemas.
Funciones
Objetos
EquationProblem | Sistema de ecuaciones no lineales |
OptimizationConstraint | Optimization constraints |
OptimizationEquality | Equalities and equality constraints |
OptimizationExpression | Arithmetic or functional expression in terms of optimization variables |
OptimizationInequality | Inequality constraints |
OptimizationProblem | Problema de optimización |
OptimizationVariable | Variable for optimization |
Temas
Pasos basados en problemas
- Problem-Based Optimization Workflow
Learn the problem-based steps for solving optimization problems. - Problem-Based Workflow for Solving Equations
Learn the problem-based steps for solving equations. - 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. - Write Objective Function for Problem-Based Least Squares
Syntax rules for problem-based least squares. - Write Constraints for Problem-Based Cone Programming
Requirements forsolve
to useconeprog
for problem solution. - 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.
Configurar opciones
- Configurar opciones
Configurar opciones de optimización - 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.
Consejos para optimización basada en problemas
- 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. - Effect of Automatic Differentiation in Problem-Based Optimization
Automatic differentiation lowers the number of function evaluations for solving a problem. - Supply Derivatives in Problem-Based Workflow
How to include derivative information in problem-based optimization when automatic derivatives do not apply. - Obtain Generated Function Details
Find the values of extra parameters in nonlinear functions created byprob2struct
. - Integer Constraints in Nonlinear Problem-Based Optimization
Learn how the problem-based optimization functionsprob2struct
andsolve
handle integer constraints. - 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.
Computación paralela
- What Is Parallel Computing in Optimization Toolbox?
Use multiple processors for optimization. - Using Parallel Computing in Optimization Toolbox
Perform gradient estimation in parallel. - 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.
Algoritmos basados en problemas
- Problem-Based Optimization Algorithms
Learn how the optimization functions and objects solve optimization problems. - Automatic Differentiation Background
Learn how automatic differentiation works. - Supported Operations for Optimization Variables and Expressions
Explore the supported mathematical and indexing operations for optimization variables and expressions.