matlab网上求助,matlab求助

实在不好意思,可能是在举例子时没怎么注意,举得不恰当,那请大神帮忙看看我的程序,如果说press是一个行向量,我能计算,但是是一个矩阵,我怎么算都不能运行,麻烦大神帮我看看。

clc

clear

for press=1

for temp=330

syms delta

PCRIT = 7.3773e6;

TCRIT = 304.1282;

rhoCRIT = 467.6;

tau = TCRIT/temp;

n = [0.38856823203161, 0.29385475942740e01, -0.55867188534934e01, -0.96753199592477, 0.31729005580416, 0.54803315897767, 0.12279411220335, 0.21658961543220e01, 0.15841735109724e01, -0.23132705405503, 0.68116916431436e-01, -0.55369137205382, 0.48946615909422, -0.24275739843501e-01, 0.62494790501678e-01, -0.12175860225246, -0.37055685270086, -0.16775879700426e-01, -0.11960736637987, -0.45619362508778e-01, 0.38612789270346e-01, -0.74427727132052e-02, -0.17395704902432e-02, -0.21810121289527e-01, 0.24332166559236e-01, -0.37440133423463e-01, 0.14338715756878, -0.13491969083286, -0.23151225053480e-01, 0.22363125492901e-01, 0.21058321972940e-02, -0.33958519026368e-03, 0.55993651771592e-02, -0.30335118055646e-03, -0.21365488688320e03, 0.26641569149272e05, -0.24027212204557e05, -0.28341603423999e03, 0.23247284400179e03, -0.66642276540751, 0.72608632349897, 0.55068668612842e-01];

d = [1, 1, 1, 1, 2, 2, 3, 1, 2, 4, 5, 5, 5, 6, 6, 6, 1, 1, 4, 4, 4, 7, 8, 2, 3, 3, 5, 5, 6, 7, 8, 10, 4, 8, 2, 2, 2, 3, 3];

t = [0, 0.75, 1, 2, 0.75, 2, 0.75, 2.5, 1.5, 2.5, 0, 2, 2, 0, 1, 2, 3, 6, 3, 6, 8, 6, 2, 7, 12, 16, 24, 24, 16, 24, 8, 2, 28, 14, 1, 0, 1, 3, 3];

c = [0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 6];

alpha = [0, 0, 0, 0, 0, 0, 0, 0, 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CC = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 12.5];

DD = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 275, 275, 275];

a0 = [8.37304456, -3.70454304, 2.5, 1.99427042, 0.62105248, 0.41195293, 1.04028922, 0.08327678];

theta0 = [0, 0, 0, 3.15163, 6.11190, 6.77708, 11.32384, 27.08792];

for i=40:42

theta(i)=(1-tau) + AA(i)*((delta-1)^2)^(1/(2*beta(i)));

DELTA(i) = theta(i)^2 + BB(i)*((delta-1)^2)^a(i);

DELTA_delta(i)=(delta-1)*(AA(i)*theta(i)*2/beta(i)*((delta-1)^2)^(1/(2*beta(i))-1) + 2*BB(i)*a(i)*((delta-1)^2)^(a(i)-1));

DELTAbi_delta(i) = b(i)*DELTA(i)^(b(i)-1)*DELTA_delta(i);

Psi(i)=exp(-CC(i)*(delta-1)^2-DD(i)*(tau-1)^2);

Psi_delta(i)=-2*CC(i)*(delta-1)*Psi(i);

end

phir = sum(n(1:7).*delta.^d(1:7).*tau) + sum(n(8:34).*delta.^d(8:34).*tau.^t(8:34).*exp(-delta.^c(8:34))) + sum(n(35:39).*delta.*d(35:39).*tau.^t(35:39).*exp(-alpha(35:39).*(delta-epsilon(35:39)).^2-beta(35:39).*(tau-gamma(35:39)).^2)) + sum(n(40:42).*DELTA(40:42).^b(40:42).*delta.*Psi(40:42));

delta=vpasolve((1+delta*phir)*(delta*temp*rhoCRIT/1000)==press,delta)

end

end

  • 0
    点赞
  • 0
    收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:1024 设计师:我叫白小胖 返回首页
评论
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值