当前位置:网站首页>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')
边栏推荐
- Does digicert SSL certificate support Chinese domain name application?
- 智能垃圾桶(五)——点亮OLED
- 深度之眼(二)——矩阵及其基本运算
- LSF basic command
- 深度之眼(三)——矩阵的行列式
- ThreadLocal
- executescalar mysql_ExecuteScalar()
- The poor family once again gave birth to a noble son: Jiangxi poor county got the provincial number one, what did you do right?
- 体验居家办公完成项目有感 | 社区征文
- Explanation of traceroute command
猜你喜欢
Exploration of mobile application performance tools
Microservice architecture practice: using Jenkins to realize automatic construction
对接保时捷及3PL EDI案例
Chapter 3 of hands on deep learning - (1) linear regression is realized from scratch_ Learning thinking and exercise answers
ThreadLocal
Microservice architecture practice: Construction of highly available distributed file system fastdfs architecture
Green bamboo biological sprint Hong Kong stocks: loss of more than 500million during the year, tiger medicine and Beijing Yizhuang are shareholders
关于我
[fluent] dart data type map type (create map set | initialize map set | traverse map set)
Tech talk activity preview | building intelligent visual products based on Amazon kVs
随机推荐
The difference of message mechanism between MFC and QT
Qwebengineview crash and alternatives
牛客JS2 文件扩展名
选择 SAP Spartacus 作为 SAP Commerce Cloud Storefront 实现框架的五个理由
社交元宇宙平台Soul冲刺港股:年营收12.8亿 腾讯是股东
Introduction to nexus and detailed tutorial of Xiaobai using idea to package and upload to nexus3 private server
关于我
How to quickly distinguish controlled components from uncontrolled components?
Sword finger offer 22 The penultimate node in the linked list
executescalar mysql_ ExecuteScalar()
visibilitychange – 指定标签页可见时,刷新页面数据
si446使用记录(一):基本资料获取
Nexus Introduction and Xiaobai use idea Packaging and Upload to Nexus 3 private service detailed tutoriel
2020 "Lenovo Cup" National College programming online Invitational Competition and the third Shanghai University of technology programming competition (a sign in, B sign in, C sign in, D thinking +mst
JS20 array flattening
A case study of college entrance examination prediction based on multivariate time series
Baobab's gem IPO was terminated: Tang Guangyu once planned to raise 1.8 billion to control 47% of the equity
对接保时捷及3PL EDI案例
TCP拥塞控制详解 | 2. 背景
The poor family once again gave birth to a noble son: Jiangxi poor county got the provincial number one, what did you do right?