您好!再一次打扰您!真是不好意思!当常数变量,a,b ,c的值是一组数据是,该怎么定义常数变量?
syms x1 x2 x3
T=1423; a=[0.1947 0.1782 0.1584 0.1221 0.0891 0.0726 0.0528 0.033 0.0165 0.0033]; b=[.801 0.8039 0.8084 0.8129 0.8158 0.8158 0.8175 0.8164 0.8164 0.8147]; c=1-a-b;
K = [14.9692 4.6245 2.2912 5.7717 2.1332 1.195 0.469 2.1501 0.385];
eq1 = x1+x2+x3+K(1)*x1^3*x2+K(2)*x1^2*x2+K(3)*x1*x2+K(4)*x1^3*x3+K(5)*x1^3*x3^2+K(6)*x1*x3+K(7)*x2^3*x3+K(8)*x2^3*x3^2+K(9)*x2*x3^4-1;
eq2 = a*x2-b*x1+(a-3*b)*K(1)*x1^3*x2+(a-2*b)*K(2)*x1^2*x2+(a-b)*K(3)*x1*x2-b*(3*K(4)*x1^3*x3+3*K(5)*x1^3*x3^2+K(6)*x1*x3)+a*(3*K(7)*x2^3*x3+3*K(8)*x2^3*x3^2+K(9)*x2*x3^4);
eq3 = a*x3-c*x1+c*(3*K(1)*x1^3*x2+2*K(2)*x1^2*x2+K(3)*x1*x2)+(a-3*c)*K(4)*x1^3*x3+(2*a-3*c)*K(5)*x1^3*x3^2+(a-c)*K(6)*x1*x3+a*(K(7)*x2^3*x3+2*K(8)*x2^3*x3^2+4*K(9)*x2*x3^4);
f1 = eval(['@(x1,x2,x3)',vectorize(eq1)]);
f2 = eval(['@(x1,x2,x3)',vectorize(eq2)]);
f3 = eval(['@(x1,x2,x3)',vectorize(eq3)]);
f = @(x) [f1(x(1),x(2),x(3)); f2(x(1),x(2),x(3)); f3(x(1),x(2),x(3))];
x0 = [0 0 0];
options=optimset('Display','iter','MaxFunEvals',1000,'TolFun',1e-10);
[x,fval,exitflag,output] = fsolve(f,x0,options)
运行后,报错下列信息:@(x1,x2,x3)matrix([[3./10.*x2-2./5.*x1-30879./25000.*x1.^3.*x2-9723./10000.*x1.^2.*x2-7167./50000.*x1.*x2-64233./25000.*x1.^3.*x3-5211./3125.*x1.^3.*x3.^2-2701./6250.*x1.*x3+2917562442999801./4503599627370496.*x2.^3.*x3+15687./12500.*x2.^3.*x3.^2+198189./1000000.*x2.*x3.^4,1./5.*x2-1./2.*x1-44603./25000.*x1.^3.*x2-9723./6250.*x1.^2.*x2-21501./50000.*x1.*x2-64233./20000.*x1.^3.*x3-5211./2500.*x1.^3.*x3.^2-2701./5000.*x1.*x3+972520814333267./2251799813685248.*x2.^3.*x3+5229./6250.*x2.^3.*x3.^2+66063./500000.*x2.*x3.^4]])
Error in ==> @(x)[f1(x(1),x(2),x(3));f2(x(1),x(2),x(3));f3(x(1),x(2),x(3))]
Error in ==> fsolve at 195
fuser = feval(funfcn{3},x,varargin{:});
Error in ==> z5 at 16
[x,fval,exitflag,output] = fsolve(f,x0,options)
复制代码