某校基金会有一笔数额为M元的基金,打算将其存入银行或购买国库券。当前银行存款及各期国库券的利率见下表。假设国库券每年至少发行一次,发行时间不定。取款政策参考银行的现行政策。 校基金会计划在n年内每年用部分本息奖励优秀师生,要求每年的奖金额大致相同,且在n年末仍保留原基金数额。校基金会希望获得最佳的基金使用计划,以提高每年的奖金额。请你帮助校基金会在只存款不购国库券的情况下设计基金使用方案,并对M=5000万元,n=10年给出具体结果。 银行存款税后年利率(%) 活期 0.792 半年期 1.664 一年期 1.800 二年期 1.944 三年期 2.160 五年期 2.304,用线性规划模型写出matlab程序代码
时间: 2023-12-03 21:47:13 浏览: 119
假设每年奖励的金额为x元,则每年基金的收益为M * r_i,其中r_i为银行存款或者国库券的利率。假设银行存款为y元,则基金每年的支出为x+y,且每年末基金总额要保持不变,即M = (M - y) * r_i + x + y,整理得到y = (M - x * n) / (n + \sum_{i=1}^{6} (1 + r_i)^{-t}),其中t为银行存款期限,即0.5, 1, 2, 3, 5年。
因为每年奖金额大致相同,所以可以将每年的基金存款分配满足以下条件:
1. 每年的奖金额大致相同,即x1 = x2 = ... = xn = x;
2. 每年的存款满足y1 + y2 + ... + yn = y;
3. 每年的存款不能超过基金的余额,即y1 <= M, y2 <= M - y1, ..., yn <= M - (y1 + y2 + ... + yn-1)。
综上所述,可以通过线性规划来求解该问题,即:
minimize x
subject to:
y1 <= M
y2 <= M - y1
...
yn <= M - (y1 + y2 + ... + yn-1)
y1 + y2 + ... + yn = y
y1 = (M - x * n) / (n + (1 + r_2)^{-0.5} + (1 + r_3)^{-1} + (1 + r_4)^{-2} + (1 + r_5)^{-3} + (1 + r_6)^{-5})
y2 = (M - x * n - y1 * (1 + r_2)^{0.5}) / (n + (1 + r_3)^{-1} + (1 + r_4)^{-2} + (1 + r_5)^{-3} + (1 + r_6)^{-5})
...
yn = (M - x * n - (y1 + y2 + ... + yn-1) * (1 + r_2)^{n-1.5}) / (n + (1 + r_3)^{-n+1} + (1 + r_4)^{-n+2} + (1 + r_5)^{-n+3} + (1 + r_6)^{-n+5})
x >= 0, y1 >= 0, y2 >= 0, ..., yn >= 0
其中,y1, y2, ..., yn为每年的存款,x为每年的奖金额。用matlab实现该线性规划模型的代码如下:
```matlab
% 定义常量
M = 5000; % 基金总额
n = 10; % 存款年限
r = [0.792, 1.664, 1.800, 1.944, 2.160, 2.304]; % 存款利率
t = [0.5, 1, 2, 3, 5]; % 存款期限
% 构建线性规划模型
f = [1, zeros(1, n)]; % 目标函数,最小化每年的奖金额
Aeq = [zeros(n, 1), repmat(-[1, zeros(1, n-1)], n, 1) + eye(n)]; % 约束条件,每年的存款之和等于总存款
beq = zeros(n, 1); % 等式约束值
A = [repmat([0, ones(1, n)], n, 1), kron(eye(n), -[1, zeros(1, n-1)])]; % 不等式约束条件,每年的存款不能超过基金余额
b = [M * ones(n, 1); zeros(n*(n-1), 1)]; % 不等式约束值
for i = 1:n
A(i+n, 1) = (M - x * n) / (n + (1 + r(2))^(-t(1)/2) + (1 + r(3))^(-t(2)) + (1 + r(4))^(-2*t(3)) + (1 + r(5))^(-3*t(4)) + (1 + r(6))^(-5*t(5)));
for j = 2:n
A(i+n, j) = (M - x * n - sum(A(i:i+j-2, j-1) .* (1 + r(2:j-1)).^(j-i-0.5))) / (n + (1 + r(j+1))^(-n+j));
end
end
lb = [0, zeros(1, n)]; % 变量下界,每年的奖金额和存款都不能为负数
ub = inf(1, n+1); % 变量上界,不限制奖金额和存款的大小
% 求解线性规划模型
[x, fval] = linprog(f, A, b, Aeq, beq, lb, ub);
% 输出结果
disp(['每年的奖金额为:', num2str(x(1))]);
disp('每年的存款为:');
for i = 1:n
disp(['第', num2str(i), '年:', num2str(x(i+1))]);
end
```
相关推荐
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)