📄 e591.m
字号:
%------------------------------------------------------------------------
% Example 5.9.1: Propane Cylinder
%------------------------------------------------------------------------
clc
clear
v0 = 0.1; % lower bound (must be > 0)
v1 = 0.913; % upper bound, initial guess
M = 44.09; % kg/kmol for propane
h = 1.35; % height of cylinder (m)
d = 0.25; % diameter of cylinder (m)
m = 2.9; % mass of propane (kg)
tol = 1.e-4; % relative error tolerance
r = 100; % maximum iterations
% Compute and display molar specific volume v
fprintf ('Example 5.9.1: Propane Cylinder\n');
fprintf ('\n----------------------------------------------');
[v,i] = bisect (v0,v1,tol,r,'funf591');
fprintf ('\nBisection: v = %.5f m^3/kmol, %2g iterations',v,i);
[v,i] = secant (v0,v1,tol,r,'funf591');
fprintf ('\nSecant: v = %.5f m^3/kmol, %2g iterations',v,i);
[v,i] = newton (v0,tol,r,'funf591');
fprintf ('\nNewton: v = %.5f m^3/kmol, %2g iterations',v,i);
fprintf ('\n----------------------------------------------');
% Compute cylinder volume and wall thickness
V_0 = pi*d^2*h/4;
V_1 = m*v/M;
show ('Exterior volume (m^3)',V_0)
show ('Interior volume (m^3)',V_1)
A = pi*d*h + 2*(pi*d^2/4);
show ('Exterior surface area (m^2)',A)
t = 100*(V_0 - V_1)/A;
show ('Wall thickness (cm)',t);
%------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -