⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 solvestartpressureofsinglepipeline.m

📁 天然气输气管道单管计算起点压力,MATLAB编的,参看的李长俊的教材
💻 M
字号:
clc;
%clf; %清除图形,会跳出绘图窗口
clear;
syms x y
tishi=msgbox('程序开始运行,按任意键继续');
pause;
Z=input('Please input 压缩因子Z=');
T=input('please input 平均温度(K)T=');
delt=input('please input 相对密度Δ=');
D=input('please input 管径(m)D=');
K=Z.*delt.*T/(0.393.^2.*D^5.2);%前苏联近期公式
Q=input('please input 起点输气量(m3/d)Q=')./3600./24;
Pz=input('please input 末点压力(MPa)Pz=').*10.^6;

n=0;%input('请输入共有分气点个数,n>=0,如果n=0则认为是一根无分支的管段)n=').*1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%无分支管线
if n<1
  L=input('请输入管段长度(km),L=').*1000;
   y=x.^2-Pz.^2-K.*Q.*L;
b=solve(y,x);
PQ=subs(b);
%%%%%%%%%%%%%%%%%%%只取正根
     for j=1:2
	if PQ(j)>0
           c=PQ(j);
        end
     end
d=c./10.^6;
a=num2str(d);
         str=['起点压力为' a 'MPa'];
 		PQ=msgbox(str); 
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -