分享兴趣,传播快乐,增长见闻,留下美好!
亲爱的您,这里是LearningYard新学苑。
今天小编给您带来
【周周记:数学建模学习(7)】
欢迎您的访问!
Share interest, spread happiness, increase knowledge, leave a beautiful!
Dear, this is LearningYard New Academy.
Today, the editor brings you
"Weekly Diary: Learning Mathematical Modeling (7)"
Welcome to your visit!
非线性规划基本原理与编程实践
Nonlinear Programming Fundamentals and Programming Practice
一.概念.
I. Concept
定义:目标函数或约束条件中包含非线性函数的规划问题
Definition: A planning problem where the objective function or constraint conditions contain nonlinear functions.
二.实例
II. Example
投资决策问题:
Investment Decision Problem:
最佳投资目的:投资额最小而总收益最大。
Objective: To minimize the investment amount while maximizing the total return.
bi为第i笔的收益;ai为第i笔的投资额;A为总资金。
bi represents the return of the i-th investment; ai represents the investment amount of the i-th investment; A represents the total capital.
目标函数:极大化总收益和总投资之比。
Objective function: Maximize the ratio of total return to total investment.
约束条件:
Constraint conditions:
- 每笔投资金额之和小于总资金。
A. The sum of investment amounts for each investment is less than the total capital.
- 限制条件用于限制Xi只能取0与1 。
B. A restrictive condition limits Xi to only take values of 0 and 1.
缺点:未考虑风险
Drawback: Risk is not considered.
三.非线性规划的数学模型
III. Mathematical Model of Nonlinear Programming
A*x≤b和Aeq*x=beq是线性规划的约束条件。
Ax ≤ b and Aeqx = beq are the constraint conditions of linear programming.
c(x)≤0是非线性规划的约束条件。
c(x) ≤ 0 is the constraint condition for nonlinear programming.
ceq(x)=0是整数规划的约束条件。
ceq(x) = 0 is the constraint condition for integer programming.
lb≤x≤ub是对x的限制条件。
lb ≤ x ≤ ub are the limitations on x.
其中需要注意的是:
Note:
fun在MATLAB中需要进行非线性函数的定义。
fun needs to be defined as a nonlinear function in MATLAB.
nonlcon是定义的非线性向量函数,同c(x)≤0,需要进行函数定义,借助function。
nonlcon is the defined nonlinear vector function, similar to c(x) ≤ 0, which requires function definition using the function keyword.
options一般不用写。
options are generally not necessary to write.
四.编程实例
IV. Programming Example
题目:
Problem Statement:
解题步骤:
Solution Steps:
fun1(x)是目标函数f(x)
fun1(x) represents the objective function f(x)
sum(x.^2)=x1*x1+x2*x2+x3*x3
x1*x1-x2+x3*x3≥0与x1+x2*x2+x3*x3≤20均需要换成c(x)≤0的形式,为非线性约束条件。
sum(x.^2) = x1x1 + x2x2 + x3x3
x1x1 - x2 + x3x3 ≥ 0 and x1 + x2x2 + x3*x3 ≤ 20 need to be converted into the form of c(x) ≤ 0, which are the nonlinear constraint conditions.
今天的分享就到这里了。
如果您对今天的文章有独特的看法,
欢迎给我们留言,
让我们相约明天,
祝您今天过得开心!
That's all for today's share.
If you have a unique view of today's article,
Please leave us a message,
Let's meet tomorrow,
Have a nice day!
本文由LearningYard新学苑原创,如有侵权,请联系删除。
参考资料:哔哩哔哩
翻译:文心一言