matlab 运行错误,clear all;clcglobal p x p=101325;x0=[0.3 0.3 0.4];[t,x]=ode45(@justice,[0:0.01:100],x0);plot(x(:,1),x(:,2))hold on%function dxdt=justice(t,x)global xtempx=x./sum(x);xtemp=x;T2=fzero(@sumy,300)psat=antione(T2);gamma=wilson(x,T2);k=
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 15:12:55
matlab 运行错误,clear all;clcglobal p x p=101325;x0=[0.3 0.3 0.4];[t,x]=ode45(@justice,[0:0.01:100],x0);plot(x(:,1),x(:,2))hold on%function dxdt=justice(t,x)global xtempx=x./sum(x);xtemp=x;T2=fzero(@sumy,300)psat=antione(T2);gamma=wilson(x,T2);k=
matlab 运行错误,
clear all;clcglobal p x
p=101325;
x0=[0.3 0.3 0.4];
[t,x]=ode45(@justice,[0:0.01:100],x0);
plot(x(:,1),x(:,2))
hold on
%function dxdt=justice(t,x)
global xtemp
x=x./sum(x);
xtemp=x;
T2=fzero(@sumy,300)
psat=antione(T2);
gamma=wilson(x,T2);
k=psat.*gamma./p
dxdt=-x+k'*x;
%function f=sumy(T)
global p xtemp
X=xtemp;
psat=antione(T);
gamma=wilson(X,T);
sumy=sum(X.*psat.*gamma./p);
f=1-abs(sumy);
%function psat=antione(T)
An=[13.31187 4068.457 139.572;10.14589 1936.010 5.291;9.81339 1669.898 -41.350];
for i=1:3
psat(i)=10^(An(i,1)-An(i,2)/(An(i,3)+T)); %压力的计算
end
%function gamma=wilson(x,T)
c=[0,0,0];
A=[0 478.6 1070.484;478.60 0 626.9;1070.484 626.90 0];
for k=1:3
for i=1:3
for j=1:3
c(k)=c(k)+(A(i,k)+A(j,k)-A(i,j))*x(i)*x(j);
end
end
gamma(k)=exp(c(k)/(2*T));
end
matlab 运行错误,clear all;clcglobal p x p=101325;x0=[0.3 0.3 0.4];[t,x]=ode45(@justice,[0:0.01:100],x0);plot(x(:,1),x(:,2))hold on%function dxdt=justice(t,x)global xtempx=x./sum(x);xtemp=x;T2=fzero(@sumy,300)psat=antione(T2);gamma=wilson(x,T2);k=
clear all;clcglobal p x
p=101325;
x0=[0.3 0.3 0.4];
[t,x]=ode45(@justice,[0:0.01:100],x0);
plot(x(:,1),x(:,2))
hold on
%function dxdt=justice(t,x)
global xtemp
x=x./sum(x);
xtemp=x;
T2=fzero(@sumy,300)
psat=antione(T2);
gamma=wilson(x,T2);
k=psat.*gamma./p
dxdt=-x+k'.*x; %此处已修改
%function f=sumy(T)
global p xtemp
X=xtemp;
psat=antione(T);
gamma=wilson(X,T);
sumy=sum(X‘.*psat.*gamma./p); %此处已修改
f=1-abs(sumy);
%function psat=antione(T)
An=[13.31187 4068.457 139.572;10.14589 1936.010 5.291;9.81339 1669.898 -41.350];
for i=1:3
psat(i)=10^(An(i,1)-An(i,2)/(An(i,3)+T)); %压力的计算
end
%function gamma=wilson(x,T)
c=[0,0,0];
A=[0 478.6 1070.484;478.60 0 626.9;1070.484 626.90 0];
for k=1:3
for i=1:3
for j=1:3
c(k)=c(k)+(A(i,k)+A(j,k)-A(i,j))*x(i)*x(j);
end
end
gamma(k)=exp(c(k)/(2*T));
end
测试通过.祝好