《购房贷款问题的matlab算法(共3页).docx》由会员分享,可在线阅读,更多相关《购房贷款问题的matlab算法(共3页).docx(3页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、精选优质文档-倾情为你奉上实验二:购房贷款问题1.问题重述 初始贷款额为30万,借款期限不超过30年,对于不同的贷款期限,贷款利率有所不同。商业贷款和公积金年利率见下表(一年期为到期一次还本付息)贷款年限15年610年1120年2030年商业贷款0.05060.05470.05690.0592公积金贷款0.03720.04120.04440.0477根据上述贷款信息,制定一个完整的个人购房贷款本息月均还款额表,表中应包括借款年限,根据两种不同贷款年利率计算出来的月利率、月还款额、总还款额和利息负担总额;并对比采用商业贷款和采用公积金贷款的利息差价。2.问题分析可以由年利息算出两种贷款的月利息,
2、再利用等额本息还款法计算每月的还款额3.算法设计本文采用等额本息还款法计算方法,计算每月的月还款额公式:H11 = p * sr * (1 + sr)n / (1 + sr) n - 1)其中:定义的一些变量名p:本金,sr(gr):商业贷款(公积金贷款),n:还款的月数从而得到总还款:All11=H11 * n,利息负担总额:LJ11 = H11 * n - p4.程序clcclearsr1=0.0506,0.0547,0.0569,0.0592/12%商业贷款月利息gr1=0.0372,0.0412,0.0444,0.0477/12%公积金贷款月利息12*(sr1-gr1) %商业贷款和采
3、用公积金贷款的利息差价ALL1=;ALL2=;HME1=;HME2 =;LJLX1 = ;LJLX2=;p = ; %贷款本金 for i=1:30 if i=1&i=6&i=11&i=21&i=30 sr=sr1(4);gr=gr1(4); end n=i*12; %还款期数%等额本息还款法 H11 = p * sr * (1 + sr)n / (1 + sr) n - 1); %商业贷款每月还钱数 H12 = p * gr * (1 + gr)n / (1 + gr) n - 1); %公积金贷款每月还钱数 LJ11 = H11 * n - p; %商业贷款利息负担总额 LJ12 = H1
4、2 * n - p ; %公积金贷款利息负担总额 All11=H11 * n; %商业贷款总还款额 All12=H12 * n; %公积金贷款总还款额 ALL1=ALL1,All11;ALL2=ALL2,All12; HME1=HME1,H11;HME2=HME2,H12; LJLX1 = LJLX1,LJ11;LJLX2 = LJLX2,LJ12; endB=HME1;ALL1;LJLX1;HME2;ALL2;LJLX25.结果商业贷款公积金贷款贷款年限月利率月还款额总还款额利息负担总额月利率月还款额总还款额利息负担总额10.004225690.49.98285.928140.0031255
5、06.61.36079.213169.48.516067.5107112990.12.911762.9173638999.353.723976.706538819.877.617515.5781946916.945.432013.353076736.192.223337.236755669.62.240177.223245487.13.829227.8263160.00464897.156.252595.204480.00344709.976.239118.2395774306.742.361766.34884117.234.645847.6463283865.464.671084.59097
6、3673.553.152661.0785393523.604.380549.277433329.244.359558.32368103251.331.790159.671673054.493.166539.14165110.00473062.905.4.4040.00372876.845.679743.57312122879.65.6.59652691.148.387525.28897132725.577.98842534.632.795402.65159142594.425.4.35442401.043.2.1953152481.602.4.38412285.791.4.42162383.6
7、65.7.68482185.436.8.7923172297.979.8.78472097.347.7.7457182222.496.1.13572019.475.7.6818192155.597.1.11671950.206.9707202095.988.03711888.246.9524210.00492082.579.9.91720.0041886.821.9.8672222035.065.1.13461837.094.8.7544231992.219.4.38921792.06.5.4972241953.449.4.44971751.129.1.0841251918.26.028417
8、13.805.5.4713261886.23.8.78551679.669.6.5843271857.001.3.33331648.362.3.3192281830.266.2.24111619.579.5.5443291805.759.03991593.055.1.1018301783.251.2.2261568.561.8.80896.结果分析商业贷款和采用公积金贷款的利息差价为:0.0134,0.0135,0.0125,0.0115;并且从上表可以看出,采用商业贷款比公积金贷款所要偿还的利息更多一点,这两种贷款的利息都会随着贷款的时间延长而增加7.结论从偿还方面考虑,采用公积金贷款比较实用,而且贷款的时间应该适量专心-专注-专业