MATLAB solution to Optimization Problems

Source: Internet
Author: User

1. Linear Optimization:
The usage of the linprog function. For more information, see help.
2. Nonlinear Optimization:
Fmincon Function
[X, fval, exitflag, output, lambda, grad, Hessian] = fmincon (fun, x0, A, B, aeq, beq, LB, UB, nonlcon, options)
Fun usage
(1) write an equation directly in quotes, for example, '-x (1)-X (2) + 0.5 * x (1)^ 2 + 0.5 * X (2) ^ 2 ';
(2) 'fun ', and then use the function;
(3) @ fun, and then use the function;

(4) @ (x) + equation: for example, @ (x)-x (1)-X (2) + 0.5 * x (1)^ 2 + 0.5 * X (2) ^ 2;


The following noncloon parameters are similar to those of fun.

3. Unrestricted Nonlinear Optimization

Differences between fminbnd, fminunc, and fminsearch

Fminbnd only applies to single variables;
Fminunc can be a single variable or a multi-variable, but can only be a continuous target letter.Number solving;
Fminsearch only supports multiple variables;
Only X is within the real number range.

4. Least Squares Optimization
(1) lsqlin: a straight line from the origin
(2) lsqcurvefut: Evaluate the fitting function containing the variable (X)

(3) lsqnonlin: similar to finding X to minimize the expression


The preceding functions use different optimized mathematical models. For more information, see the mathematical models in the Help file.

In additionAlgorithmThe final result is influential. You can reduce the step size to reduce the error, but it may not be completely error-free.

At the same time, it also avoids some functions that may cause local optimum. The method to avoid this problem can be to draw a picture to see a rough result, and then elaborate on it;

Use multiple functions to solve the problem.Different initial points, genetic algorithms, and lingo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.