本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。
在基于问题的优化中,您需要创建优化变量,用这些变量来构建表示目标和约束或表示方程的表达式,并使用 solve
求解问题。有关以基于问题的方法求解优化问题的步骤,请参阅Problem-Based Optimization Workflow。有关方程求解,请参阅Problem-Based Workflow for Solving Equations。
在开始求解优化问题之前,您必须选择合适的方法:基于问题或基于求解器。有关详细信息,请参阅 首先选择基于问题或基于求解器的方法。
注意:如果您的非线性函数不是多项式或有理式,请使用 fcn2optimexpr
将其转换为优化表达式。请参阅 Convert Nonlinear Function to Optimization Expression。
有关基本非线性优化示例,请参阅基于问题求解有约束非线性问题:。有关基本混合整数线性规划示例,请参阅混合整数线性规划基础:基于问题。有关基本方程求解示例,请参阅Solve Nonlinear System of Equations, Problem-Based。
EquationProblem | System of nonlinear equations |
OptimizationConstraint | Optimization constraints |
OptimizationEquality | Equalities and equality constraints |
OptimizationExpression | Arithmetic or functional expression in terms of optimization variables |
OptimizationInequality | Inequality constraints |
OptimizationProblem | 优化问题 |
OptimizationVariable | Variable for optimization |
Problem-Based Optimization Workflow
Problem-based steps for solving optimization problems.
Problem-Based Workflow for Solving Equations
Problem-based steps for solving equations.
Expressions define both 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.
Named Index for Optimization Variables
How to create and work with named indices for variables.
Review or Modify Optimization Problems
Shows how to review or modify problem elements such as variables and constraints.
How to evaluate the solution and its quality.
设置优化选项
Output Function for Problem-Based Optimization
Shows how to use an output function in the problem-based approach to record iteration history and to make a custom plot.
Create Efficient Optimization Problems
Tips for obtaining a faster or more accurate solution when there are integer constraints, and for avoiding loops in problem creation.
Separate Optimization Model from Data
To create reusable, scalable problems, separate the model from the data.
Variables with Duplicate Names Disallowed
Solution to the problem of two optimization variables with the same name.
Create Initial Point for Optimization with Named Index Variables
This example shows how to create initial points for solve
when you have named index variables by using the findindex
function.
Expression Contains Inf or NaN
Optimization expressions containing Inf
or
NaN
cannot be displayed, and can cause unexpected
results.
Objective and Constraints Having a Common Function in Serial or Parallel, Problem-Based
Save time when your objective and nonlinear constraint functions share common computations in the problem-based approach.
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
and ga
.
Improving Performance with Parallel Computing
Investigate factors for speeding optimizations.
Problem-Based Optimization Algorithms
How the optimization functions and objects solve optimization problems.
Supported Operations on Optimization Variables and Expressions
Lists all available mathematical and indexing operations on optimization variables and expressions.