关于MATLAB解非线性方程组的问题
关于MATLAB解非线性方程组的问题(x,y)=∑_(i=1)^4∑_(j=1)^[ai*sin(x+mi)+bj*sin(y+nj)]已知16个(x,y,z)的值(0,...
关于MATLAB解非线性方程组的问题(x,y)=∑_(i=1)^4∑_(j=1)^[ai*sin(x+mi)+bj*sin(y+nj)]已知16个(x,y,z)的值(0,0,0)(1,0,1)(4,0,2)(9,0,3)(1,1,0)(2,1,1)(5,1,2)(10,1,3)(4,2,0)(5,2,1)(8,2,2)(13,2,3)(9,3,0)(10,3,1)(13,3,2)(18,3,3),想解出ai(a1~a4),mi,bj,nj的值来(16个),于是列出了16个方程构成了一个非线性方程组
function f = myfun(k)
f(1)=k(1)*sin(0+k(2))+k(3)*sin(0+k(4))+k(5)*sin(0+k(6))+k(7)*sin(0+k(8))+k(9)*sin(0+k(10))+k(11)*sin(0+k(12))+k(13)*sin(0+k(14))+k(15)*sin(0+k(16))-0;
。
。
。
f(16)=k(1)*sin(3+k(2))+k(3)*sin(3+k(4))+k(5)*sin(3+k(6))+k(7)*sin(3+k(8))+k(9)*sin(3+k(10))+k(11)*sin(3+k(12))+k(13)*sin(3+k(14))+k(15)*sin(3+k(16))-18;(一共十六个方程,字数限制写不完)
解这个方程组
k0=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ];
k=fsolve(@myfun,k0)结果显示
No solution found.
fsolve stopped because the relative size of the current step is less than thedefault value of the step size tolerance squared, but the vector of function valuesis not near zero as measured by the default value of the function tolerance.
<stopping criteria details>
k =
1.3409 -0.8778 2.6691 -0.6395 2.1296 -0.5499 1.8948 -1.0122 2.2014 -0.1815 0.8450 -0.1199 1.3790 -1.4161 1.2242 -0.5157
为什么解不出来,是代码本身的原因还是说本身就无解呢?本人小白,求大神解答 展开
function f = myfun(k)
f(1)=k(1)*sin(0+k(2))+k(3)*sin(0+k(4))+k(5)*sin(0+k(6))+k(7)*sin(0+k(8))+k(9)*sin(0+k(10))+k(11)*sin(0+k(12))+k(13)*sin(0+k(14))+k(15)*sin(0+k(16))-0;
。
。
。
f(16)=k(1)*sin(3+k(2))+k(3)*sin(3+k(4))+k(5)*sin(3+k(6))+k(7)*sin(3+k(8))+k(9)*sin(3+k(10))+k(11)*sin(3+k(12))+k(13)*sin(3+k(14))+k(15)*sin(3+k(16))-18;(一共十六个方程,字数限制写不完)
解这个方程组
k0=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ];
k=fsolve(@myfun,k0)结果显示
No solution found.
fsolve stopped because the relative size of the current step is less than thedefault value of the step size tolerance squared, but the vector of function valuesis not near zero as measured by the default value of the function tolerance.
<stopping criteria details>
k =
1.3409 -0.8778 2.6691 -0.6395 2.1296 -0.5499 1.8948 -1.0122 2.2014 -0.1815 0.8450 -0.1199 1.3790 -1.4161 1.2242 -0.5157
为什么解不出来,是代码本身的原因还是说本身就无解呢?本人小白,求大神解答 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询