请各位为matlab高手们帮个忙啊,求解非线性方程组
来源:学生作业帮 编辑:大师作文网作业帮 分类:数学作业 时间:2024/11/11 07:12:49
请各位为matlab高手们帮个忙啊,求解非线性方程组
我用的solve函数,但是求解不出来,请各位高手帮个忙调试一下,把能解的程序发一下,要求解出来是数值解,我x,y是有很多组的,最后要用循环求出很多解求平均的,这里只列出一组,
v=1577/3.48;
x0=-50;
y0=-50;
r=12;
x=[183 206 161 151 149 152 162];
y=[282 284 295 310 325 340 355];
[a,b,d,e,f,m,n]=solve('(a*((v-f)*x(1)/(v^2*f)-m)+b*((v-f)*y(1)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(1)/(v^2*f)-m)+e*((v-f)*y(1)/(v^2*f)-n)-y0)^2=r^2', '(a*((v-f)*x(2)/(v^2*f)-m)+b*((v-f)*y(2)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(2)/(v^2*f)-m)+e*((v-f)*y(2)/(v^2*f)-n)-y0)^2=r^2', '(a*((v-f)*x(3)/(v^2*f)-m)+b*((v-f)*y(3)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(3)/(v^2*f)-m)+e*((v-f)*y(3)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(4)/(v^2*f)-m)+b*((v-f)*y(4)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(4)/(v^2*f)-m)+e*((v-f)*y(4)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(5)/(v^2*f)-m)+b*((v-f)*y(5)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(5)/(v^2*f)-m)+e*((v-f)*y(5)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(6)/(v^2*f)-m)+b*((v-f)*y(6)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(6)/(v^2*f)-m)+e*((v-f)*y(6)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(7)/(v^2*f)-m)+b*((v-f)*y(7)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(7)/(v^2*f)-m)+e*((v-f)*y(7)/(v^2*f)-n)-y0)^2=r^2','a','b','d','e','f','m','n')
我用的solve函数,但是求解不出来,请各位高手帮个忙调试一下,把能解的程序发一下,要求解出来是数值解,我x,y是有很多组的,最后要用循环求出很多解求平均的,这里只列出一组,
v=1577/3.48;
x0=-50;
y0=-50;
r=12;
x=[183 206 161 151 149 152 162];
y=[282 284 295 310 325 340 355];
[a,b,d,e,f,m,n]=solve('(a*((v-f)*x(1)/(v^2*f)-m)+b*((v-f)*y(1)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(1)/(v^2*f)-m)+e*((v-f)*y(1)/(v^2*f)-n)-y0)^2=r^2', '(a*((v-f)*x(2)/(v^2*f)-m)+b*((v-f)*y(2)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(2)/(v^2*f)-m)+e*((v-f)*y(2)/(v^2*f)-n)-y0)^2=r^2', '(a*((v-f)*x(3)/(v^2*f)-m)+b*((v-f)*y(3)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(3)/(v^2*f)-m)+e*((v-f)*y(3)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(4)/(v^2*f)-m)+b*((v-f)*y(4)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(4)/(v^2*f)-m)+e*((v-f)*y(4)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(5)/(v^2*f)-m)+b*((v-f)*y(5)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(5)/(v^2*f)-m)+e*((v-f)*y(5)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(6)/(v^2*f)-m)+b*((v-f)*y(6)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(6)/(v^2*f)-m)+e*((v-f)*y(6)/(v^2*f)-n)-y0)^2=r^2','(a*((v-f)*x(7)/(v^2*f)-m)+b*((v-f)*y(7)/(v^2*f)-n)-x0)^2+(d*((v-f)*x(7)/(v^2*f)-m)+e*((v-f)*y(7)/(v^2*f)-n)-y0)^2=r^2','a','b','d','e','f','m','n')
看了半天,简化如下:
x=ay^2+by+c
共七组数据,利用最小二乘法确定出系数a,b,c.
再用这三个系数反解出你的系数.
x=ay^2+by+c
共七组数据,利用最小二乘法确定出系数a,b,c.
再用这三个系数反解出你的系数.