3.1.1 matlab

发布于 2020-03-16  235 次阅读


Automation 1803 201807030320

3.1.1

codes

%1. mix up different gas


function [T,del_S] = gasmix(p1,p2,T1,T2,q1,q2,M1,M2,R1,R2,C1,C2,P_default)
% model

T = (q1*C1*T1 + q2*C2*T2)/(q1*C1 + q2*C2);
P = P_default

P11 = P * (q1/M1)/(q1/M1 + q2/M2)
P21 = P - P11

del_S = q1 * (C1*log(T/T1) - R1*log(P11/p1)) + q2 * (C2 * log(T/T2) - R2 * log(P21/p2))

Screenshot

3.1.1

3.1.2

codes

function loss = pressloss(r , ri , v, muse)

Re = r * v * ri / muse;
m = 0.0032 + 0.221* (Re^(-0.237));
loss = m * ri * v * v / (200 * r);
end

Screenshot

3.1.2

3.1.3

codes

function Pm = houseloan(P, r1, ry, d)

C = P * (1 - r1);
n = d * 12;
r = ry / 12;
Pm = (C * r *(1+ r)^n)/((1+ r)^n -1);
end

Screenshot

3.1.3
3.1.3


你知道雪为什么是白色的吗?因为她忘记了原来的颜色