function [out]=Caculatian(u)
v_fuel=u(1)./167; %物质的量(燃料)----u(1)——燃料的质量
v_air=u(2)./(32+3.76.*28); %物质的量(空气)----u(2)---空气的质量
v_co2=12.*v_fuel; %物质的量(CO2)
v_h2o=11.5.*v_fuel; %物质的量(H20)
v_n2=3.76.*v_air; %物质的量(N2)
v_o2=(v_air-17.75.*v_fuel); %物质的量(O2)
%--------------- 11~14 求排气中各组分的摩尔分数-------------------------↓
vf1=v_co2./(v_co2+v_h2o+v_n2+v_o2); % 摩尔分数(CO2)
vf2=v_h2o./(v_co2+v_h2o+v_n2+v_o2); % 摩尔分数(H20)
vf3=v_n2./(v_co2+v_h2o+v_n2+v_o2); % 摩尔分数(N2)
vf4=v_o2./(v_co2+v_h2o+v_n2+v_o2); % 摩尔分数(O2)
%--------------- 16~19 求排气中各组分的质量分数-------------------------↓
mf1=44.*v_co2./(44.*v_co2+18.*v_h2o+28.*v_n2+32.*v_o2); % 质量分数(CO2)
mf2=18.*v_h2o./(44.*v_co2+18.*v_h2o+28.*v_n2+32.*v_o2); % 质量分数(H20)
mf3=28.*v_n2./(44.*v_co2+18.*v_h2o+28.*v_n2+32.*v_o2); % 质量分数(N2)
mf4=32.*v_o2./(44.*v_co2+18.*v_h2o+28.*v_n2+32.*v_o2); % 质量分数(O2)
%-------------- 21~31 求排气在入口与出口的比焓 定压比热容 密度----------↓
Texh_in=u(3); % 排气温度(蒸发器)
mf=u(1)+u(2);%可燃混合气的总质量(空气+燃料)
Texh_out=u(4); % 排气温度(蒸发器)
x=[mf1 mf2 mf3 mf4 Texh_out];
[Hexh_out Cp D]=exhprop(x);%排气在出口的比焓 kJ/kg
x=[mf1 mf2 mf3 mf4 Texh_in];
[Hexh_in Cp D]=exhprop(x);%排气在入口的比焓 kJ/kg
x=[mf1 mf2 mf3 mf4 298];
[Hexh_environment Cp D]=exhprop(x);%排气在环境的比焓 kJ/kg
W_total=mf*(Hexh_in-Hexh_environment);%尾气的总能量 kJ/kg
%%%%%%%%%%%假设蒸发器出口温度是0.5MPa%%%%%%%%%%%%%%%%
ml=0.1; %工质的质量流量 kg/s
P4=1000;
h4=refpropm('H','P',P4,'Q',0,'R245fa')./1e3; %4点焓值 kJ/kg
h5=refpropm('H','P',P4,'Q',1,'R245fa')./1e3; %5点焓值 kJ/kg
h2=ml/mf*(h5-h4)+Hexh_out; %尾气在蒸发器入口的焓值 kJ/kg
h6=0.8*mf/ml*(Hexh_in-h2)+h5; %工质在6点的焓值 kJ/kg
%S6=refpropm('S','P',500,'Q',1,'R245fa'); %工质在6点的熵值 kJ/(kg·K)
%S7=S6; %7点熵值,6到7假设低等熵过程,两点熵相等
P8=P4*0.2;;
%T4=refpropm('T','P',500,'Q',0,'R245fa'); %4点温度 K
h8=refpropm('H','P',P8,'Q',0,'R245fa')./1e3; %8点焓值 kJ/kg
%P8=refpropm('P','T',T8,'Q',0,'R245fa'); %8点压强 kPa
P7=P8; %7点压强 kPa 冷凝器中假设是工质等压冷却过程
h7=refpropm('H','P',P7,'Q',1,'R245fa')/1e3; %7点焓值 kJ/kg
W_pre=mf*(h2-Hexh_out); %蒸汽发生器(预热段)的换热量 kW
W_ove=mf*(Hexh_in-h2); %过热器(过热段)的换热量 kW
W_eva=W_pre+W_ove; %工质从尾气的吸收的总热量 kW
eta_exp=0.7; %膨胀机的效率
eta_pum=0.8; %液压泵的效率
W_exp=ml*(h6-h7)*eta_exp;%膨胀机的输出功 kW
W_con=ml*(h7-h8);%冷凝器的换热量
W_pum=ml*(h4-h8)/eta_pum;%冷却泵的消耗功
W_net=W_exp-W_pum;%输出净功
eta1=W_net/W_eva;%循环热效率
eta2=W_net/W_total;%能量回收利用率
out(1)=W_pre;
out(2)=W_ove;
out(3)=W_eva;
out(4)=W_exp;
out(5)=W_con;
out(6)=W_pum;
out(7)=W_net;
out(8)=eta1;
out(9)=eta2;
end