作业帮 > 数学 > 作业

fsolve求解非线性指数方程组的问题?

来源:学生作业帮 编辑:作业帮 分类:数学作业 时间:2024/08/29 09:32:49
fsolve求解非线性指数方程组的问题?
这是我的函数:
function f=myfun2(x)
T(1)=10e-6;
T(2)=700e-6;
a=x(1);
b=x(2);
c=x(3);
d=x(4);
k=x(5);
f(1)=k*(exp(-a*(0.3*T(1)+c))-exp(-b*(0.3*T(1)+c)))-0.3;
f(2)=k*(exp(-a*(0.9*T(1)+c))-exp(-b*(0.9*T(1)+c)))-0.9;
f(3)=k*(exp(-a*(T(2)+c))-exp(-b*(T(2)+c)))-0.5;
f(4)=k*(exp(-a*d)-exp(-b*d))-1;
f(5)=a*exp(-a*d)-b*exp(-b*d);
f=[f(1) f(2) f(3) f(4) f(5)];
end
然后在主程序中用fslove
x=fsolve('myfun2',[127 22 223 0 2])
fsolve stopped because it exceeded the function evaluation limit,
options.MaxFunEvals = 500 (the default value).
主要无法解决的问题:
1、首先以上的方程组利用solve无法得出确切值
2、然后利用fsolve我无法找到初始值,只能随机找,但结论不是fsolve stopped because it exceeded the function evaluation limit,就是fsolve stopped because the problem appears regular as measured by the gradient,
but the vector of function values is not near zero as measured by the
default value of the function tolerance.
希望高人能给我方法解出这个方程组!谢谢!
主程序改为:(主要应为语句不规范而改)
function f=myfun2(x)
T(1)=1e-5;
T(2)=7*1e-4;
a=x(1);
b=x(2);
c=x(3);
d=x(4);
k=x(5);
f(1)=k*(exp(-a*(0.3*T(1)+c))-exp(-b*(0.3*T(1)+c)))-0.3;
f(2)=k*(exp(-a*(0.9*T(1)+c))-exp(-b*(0.9*T(1)+c)))-0.9;
f(3)=k*(exp(-a*(T(2)+c))-exp(-b*(T(2)+c)))-0.5;
f(4)=k*(exp(-a*d)-exp(-b*d))-1;
f(5)=a*exp(-a*d)-b*exp(-b*d);
f=[f(1) f(2) f(3) f(4) f(5)];
调用程序为:
x=fsolve('myfun2',[127 22 223 0 2])
//[127 22 223 0 2]为你的初始值
调用结果为
x =
127.0000 22.0001 223.0000 0.0167 1.9988
但是你的程序的问题在于没有option的控制语句,只是运行了一点就停止了,中间是有问题,这个你没给要求,没有办法帮你! 请比较你给的初始值和调用结果!
再问: 谢谢楼上的兄弟,但是不太会设置option的控制语句,请问该如何设置啊?