当前位置:网站首页>Income and risk of linear programming example investment
Income and risk of linear programming example investment
2022-07-02 17:26:00 【__ Rain】
、







Get the inflection point a a a Value run to find the corresponding variable value
clear;clc;
a=0;% Investment risk
hold on
while a<0.05
c=[0.05 0.27 0.19 0.185 0.185];% Coefficient matrix of objective function
A=[zeros(4,1),diag([0.025 0.015 0.055 0.026])];% Coefficient matrix of inequality
% hold 1*4 Column vectors and 4*4 The matrix of , The diagonal to diag The elements in
b=a*ones(1,4);% Generate all 1 The column vector , Multiply all elements by a
%b Whether it is a row vector or a column vector does not affect the result
Aeq=[1 1.01 1.02 1.045 1.065];% The coefficient matrix in the left end of the equation
beq=1;% The value at the right end of the equation
lb=zeros(1,5);% Variable x Lower bound of
%lb Whether it is a row vector or a column vector does not affect the result
[x, Q]=linprog(-c,A,b,Aeq,beq,lb);% Remember to take -c
plot(a,-Q,'*r');% -Q Is the final value
a=a+0.001;
end
xlabel('a'),ylabel('Q')
边栏推荐
- Green bamboo biological sprint Hong Kong stocks: loss of more than 500million during the year, tiger medicine and Beijing Yizhuang are shareholders
- 如何给 SAP Spartacus Storefront 创建新的页面
- Introduce the scrollintoview() method attribute in detail
- Win10 system uses pip to install juypter notebook process record (installed on a disk other than the system disk)
- 绿竹生物冲刺港股:年期内亏损超5亿 泰格医药与北京亦庄是股东
- AP and F107 data sources and processing
- How to quickly distinguish controlled components from uncontrolled components?
- Timing / counter of 32 and 51 single chip microcomputer
- Interpretation of key parameters in MOSFET device manual
- executescalar mysql_ ExecuteScalar()
猜你喜欢

Fuyuan medicine is listed on the Shanghai Stock Exchange: the market value is 10.5 billion, and Hu Baifan is worth more than 4billion

相信自己,这次一把搞定JVM面试

Blog theme "text" summer fresh Special Edition

从收集到输出:盘点那些强大的知识管理工具——优秀笔记软件盘点(四)

【Leetcode】13. 罗马数字转整数

Soul, a social meta universe platform, rushed to Hong Kong stocks: Tencent is a shareholder with an annual revenue of 1.28 billion

Sword finger offer 25 Merge two sorted linked lists

What if the default browser cannot be set?

剑指 Offer 21. 调整数组顺序使奇数位于偶数前面

Linux Installation PostgreSQL + Patroni cluster problem
随机推荐
【Leetcode】13. Roman numeral to integer
体验居家办公完成项目有感 | 社区征文
IDEA2021.1 安装教程
Qstype implementation of self drawing interface project practice (II)
[essay solicitation activity] Dear developer, RT thread community calls you to contribute
Exploration of mobile application performance tools
871. 最低加油次数
class和getClass()的区别
TCP congestion control details | 2 background
如何给 SAP Spartacus Storefront 创建新的页面
What if the default browser cannot be set?
JS delete substring in string
Shutter: action feedback
ThreadLocal
Chmod command principle and usage details [easy to understand]
Fuyuan medicine is listed on the Shanghai Stock Exchange: the market value is 10.5 billion, and Hu Baifan is worth more than 4billion
一年頂十年
Sword finger offer 25 Merge two sorted linked lists
SAP Commerce Cloud 架构概述
The construction of scalable distributed database cluster and the partition design of oneproxy sub database