基于求解器的非线性优化
使用基于求解器的方法以串行或并行方式求解非线性最小化和半无限规划问题
在开始求解优化问题之前,您必须选择合适的方法:基于问题或基于求解器。有关详细信息,请参阅首先选择基于问题或基于求解器的方法。
有关问题设置,请参阅基于求解器的优化问题设置。
函数
fminbnd | 查找单变量函数在定区间上的最小值 |
fmincon | 寻找约束非线性多变量函数的最小值 |
fminsearch | 使用无导数法计算无约束多变量函数的最小值 |
fminunc | 求无约束多变量函数的最小值 |
fseminf | 求解半无限约束多变量非线性函数的最小值 |
optim.coder.infbound | Infinite bound support for code generation (自 R2022b 起) |
实时编辑器任务
优化 | 在实时编辑器中优化或求解方程 (自 R2020b 起) |
主题
基于无约束求解器的应用
- 香蕉函数的最小化
说明如何使用不同求解器在使用或不使用梯度的情况下求解 Rosenbrock 函数的最小值。 - Solve Nonlinear Problem with Many Variables
Choose appropriate options for large nonlinear problems. - 使用 fminunc 进行无约束最小化
无约束非线性规划的示例。 - 使用梯度和黑塞矩阵的最小化
包含导数的无约束非线性规划的示例。 - Minimization with Gradient and Hessian Sparsity Pattern
Example of nonlinear programming using some derivative information.
基于有约束求解器的应用
- Optimization Toolbox 教程
教程示例说明如何求解非线性问题和传递额外参数。 - 使用 fmincon 求解器优化实时编辑器任务
使用优化实时编辑器任务的约束非线性规划示例。 - 非线性不等式约束
具有非线性不等式约束的非线性规划示例。 - Nonlinear Constraints with Gradients
Example of nonlinear programming with derivative information. - 使用解析 Hessian 函数的 fmincon 内点算法
使用所有导数信息的非线性规划示例。 - 具有二次约束的线性或二次目标
此示例说明如何求解具有线性或二次目标和二次不等式约束的优化问题。 - 非线性等式和不等式约束
同时具有两类非线性约束的非线性规划。 - How to Use All Types of Constraints
Example showing all constraints. - Obtain Best Feasible Point
Find the best feasible point in theoutput
structure. - Solve Nonlinear Problem with Many Variables
Choose appropriate options for large nonlinear problems. - Minimization with Bound Constraints and Banded Preconditioner
Example showing efficiency gains possible with structured nonlinear problems. - Minimization with Linear Equality Constraints, Trust-Region Reflective Algorithm
Example showing nonlinear programming with only linear equality constraints. - Minimization with Dense Structured Hessian, Linear Equalities
Example showing how to save memory in nonlinear programming with a structured Hessian and only linear equality constraints or only bounds. - Calculate Gradients and Hessians Using Symbolic Math Toolbox
Example showing how to calculate derivatives symbolically for optimization solvers. - Using Symbolic Mathematics with Optimization Toolbox Solvers
Use Symbolic Math Toolbox™ to generate gradients and Hessians.
代码生成
- fmincon 背景中的代码生成
为非线性优化生成 C 代码的前提条件。 - Code Generation for Optimization Basics
Learn the basics of code generation for thefmincon
optimization solver. - Static Memory Allocation for fmincon Code Generation
Use static memory allocation in code generation when the problem changes. - Optimization Code Generation for Real-Time Applications
Explore techniques for handling real-time requirements in generated code.
半无限约束
- One-Dimensional Semi-Infinite Constraints
Example showing how to use one-dimensional semi-infinite constraints in nonlinear programming. - Two-Dimensional Semi-Infinite Constraint
Example showing how to use two-dimensional semi-infinite constraints in nonlinear programming. - Analyzing the Effect of Uncertainty Using Semi-Infinite Programming
This example shows how to use semi-infinite programming to investigate the effect of uncertainty in the model parameters of an optimization problem.
并行计算
- What Is Parallel Computing in Optimization Toolbox?
Use multiple processors for optimization. - Using Parallel Computing in Optimization Toolbox
Perform gradient estimation in parallel. - Improving Performance with Parallel Computing
Investigate factors for speeding optimizations. - Minimizing an Expensive Optimization Problem Using Parallel Computing Toolbox
Example showing how to use parallel computing in both Global Optimization Toolbox and Optimization Toolbox™ solvers.
仿真或 ODE
- 优化仿真或常微分方程
优化仿真、黑盒目标函数或 ODE 时的特殊注意事项。
算法和其他理论
- 无约束非线性优化算法
在无约束的情况下,在 n 个维度中最小化单目标函数。 - 约束非线性优化算法
在有各种约束的情况下,在 n 个维度中最小化单目标函数。 - fminsearch 算法
fminsearch
最小化函数所采取的步骤。 - 优化选项参考
了解优化选项。 - 局部最优与全局最优
解释为什么求解器可能找不到最小的最小值。 - Smooth Formulations of Nonsmooth Functions
Reformulate some nonsmooth functions as smooth functions by using auxiliary variables. - 优化参考书目
列出涉及优化求解器算法中所实现概念的已发布资料。