当前位置:网站首页>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')
边栏推荐
- IDEA2021.1 安装教程
- helm kubernetes包管理工具
- Geoserver: publishing PostGIS data sources
- 对接保时捷及3PL EDI案例
- LeetCode:1380. Lucky number in matrix -- simple
- 简单介绍BASE64Encoder的使用
- executescalar mysql_ExecuteScalar()
- Jiuxian's IPO was terminated: Sequoia and Dongfang Fuhai were shareholders who had planned to raise 1billion yuan
- QStyle实现自绘界面项目实战(二)
- SSB threshold_ SSB modulation "suggestions collection"
猜你喜欢
[shutter] dart data type (dynamic data type)
智能垃圾桶(五)——点亮OLED
Seven charts, learn to do valuable business analysis
Believe in yourself and finish the JVM interview this time
Interpretation of key parameters in MOSFET device manual
si446使用记录(一):基本资料获取
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
几行代码搞定RPC服务注册和发现
Goodbye, shucang. Alibaba's data Lake construction strategy is really awesome!
Sword finger offer 24 Reverse linked list
随机推荐
ThreadLocal
剑指 Offer 24. 反转链表
相信自己,这次一把搞定JVM面试
【Leetcode】13. Roman numeral to integer
Explanation of traceroute command
The impact of telecommuting on all aspects of our experience | community essay solicitation
牛客 JS3 分隔符
绿竹生物冲刺港股:年期内亏损超5亿 泰格医药与北京亦庄是股东
默认浏览器设置不了怎么办?
什么是敏捷开发流程
What if the default browser cannot be set?
Sword finger offer 25 Merge two sorted linked lists
Visibilitychange – refresh the page data when the specified tab is visible
将您的基于 Accelerator 的 SAP Commerce Cloud Storefront 迁移到 Spartacus
Introduction to Hisilicon hi3798mv100 set top box chip [easy to understand]
ROS知识点——ros::NodeHandle n 和 nh(“~“)的区别
选择 SAP Spartacus 作为 SAP Commerce Cloud Storefront 实现框架的五个理由
Un an à dix ans
chmod命令原理及用法详解[通俗易懂]
伟立控股港交所上市:市值5亿港元 为湖北贡献一个IPO