求助用fsolve求解方程组的问题
我用fsolve求解方程组,此时得到的解不应该为零,虽然exitflag 和 fval显示得到是真解,我通过调整TolFun和TolX 也不行,是什么原因呢,该如何处理呢?求解方程组除了fsolve 还有什么优化函数可以处理这个问题。此外调整TolFun和TolX不能随便修改(我是随便改的),修改其的理论根据什么,具体怎么调整?clear all;clc;close all;
global T
n0=100*ones(1,5);
T_par=0.981;
options=optimset('display','on');
options=optimset('TolFun',1e-30,'TolX',1e-30);
T=T_par(1);
=fsolve(@myfun,n0,options)
function y=myfun(n)
global T
q=1;
k=1;
ja1=0.5253;
ja2=1;
ja3=1;
je1=0.4202;
je2=1;
je3=1;
p1=n(1);
p2=n(2);
p3=n(3);
p4=n(4);
p5=n(5);
t1=0;
t2=0;
t3=0;
t4=0;
t5=0;
dt1=-4*ja1*p1-je1*p2;
dt2=-4*ja2*p2-je1*p1-je2*p3;
dt3=-4*ja3*p3-je3*p4-je2*p2;
dt4=-4*p4-je3*p3-1.0*p5;
dt5=-4*p5-1.0*p4-1.0*p5;
w1=q;
w2=q;
w3=q;
w4=q;
w5=q;
th1=tanh(w1*log(2)/(2*k*T));
th2=tanh(w2*log(2)/(2*k*T));
th3=tanh(w3*log(2)/(2*k*T));
th4=tanh(w4*log(2)/(2*k*T));
th5=tanh(w5*log(2)/(2*k*T));
y(1)=dt1*q^2/(2*w1^3)*th1+(t1^2*dt1*T/log(2)-w1^2*t1)*(1-th1^2)*log(2)*log(2)/(4*k*T*T*w1^2)+p1;
y(2)=dt2*q^2/(2*w2^3)*th2+(t2^2*dt2*T/log(2)-w2^2*t2)*(1-th2^2)*log(2)*log(2)/(4*k*T*T*w2^2)+p2;
y(3)=dt3*q^2/(2*w3^3)*th3+(t3^2*dt3*T/log(2)-w3^2*t3)*(1-th3^2)*log(2)*log(2)/(4*k*T*T*w3^2)+p3;
y(4)=dt4*q^2/(2*w4^3)*th4+(t4^2*dt4*T/log(2)-w4^2*t4)*(1-th4^2)*log(2)*log(2)/(4*k*T*T*w4^2)+p4;
y(5)=dt5*q^2/(2*w5^3)*th5+(t5^2*dt5*T/log(2)-w5^2*t5)*(1-th5^2)*log(2)*log(2)/(4*k*T*T*w5^2)+p5;
页:
[1]