Erste Schritte mit der problembasierten Optimierung und Gleichungslösung
Um ein Problem mithilfe des problembasierten Ansatzes zu lösen, gehen Sie wie folgt vor:
Erstellen Sie ein Optimierungsproblem mithilfe von
optimproblembzw. ein Gleichungslösungsproblem mithilfe voneqnproblem.Erstellen Sie Optimierungsvariablen mithilfe von
optimvar.Erstellen Sie Ausdrücke unter Verwendung der Optimierungsvariablen, die die Zielfunktion, die Nebenbedingungen bzw. die Gleichungen darstellen. Fügen Sie die Ausdrücke unter Verwendung der Punktnotation in das Problem ein, beispielsweise
prob.Objective = expression1; probl.Constraints.ineq = ineq1;
Erstellen Sie bei nichtlinearen Problemen einen Startpunkt
x0als Struktur, wobei die Namen der Optimierungsvariablen als Felder dienen.Lösen Sie das Problem durch Aufrufen von
solve.
Um Ihre Konfiguration zu optimieren, die Leistung zu steigern oder mehr über die problembasierte Konfiguration zu erfahren, lesen Sie Verbessern der Organisation und Leistungsfähigkeit bei einer problembasierten Konfiguration.
Mehr zu Parallelrechnen in der Optimization Toolbox™ finden Sie im vorigen Abschnitt. Mehr zu Parallelrechnen in der Global Optimization Toolbox finden Sie unter How to Use Parallel Processing in Global Optimization Toolbox (Global Optimization Toolbox).
Funktionen
Objekte
EquationProblem | Nichtlineares Gleichungssystem |
OptimizationConstraint | Optimierungsnebenbedingungen |
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 |
Live Editor Tasks
| Optimize | Optimieren oder Lösen von Gleichungen im Live-Editor |
Apps
| Optimization Explorer | Explore multiple solver configurations and their solutions for an optimization problem (Seit R2026a) |
Themen
Problembasierte Vorgehensweisen
- 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 forsolveto useconeprogfor problem solution. - Review or Modify Optimization Problems
Review or modify problem elements such as variables and constraints. - Examine Optimization Solution
Evaluate the solution and its quality.
Einschränkungen
- Variables with Duplicate Names Disallowed
Learn how to solve a problem that has two optimization variables with the same name. - Expression Contains Inf or NaN
Optimization expressions containingInforNaNcannot be displayed, and can cause unexpected results.
Optimieren und Überwachen des Lösungsprozesses
- Use Optimization Explorer App
Basic example showing the use of the Optimization Explorer App. - Set Optimization Options, Problem-Based
How to set and change optimization options in the problem-based approach. - 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.
Algorithmen
- Problem-Based Optimization Algorithms
Learn how the optimization functions and objects solve optimization problems. - fcn2optimexpr Algorithm Description
Howfcn2optimexprworks. - 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.
Parallelrechnen in der Optimization Toolbox
- 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:fminconandga. - Improving Performance with Parallel Computing
Investigate factors for speeding optimizations.