求matlab大神帮忙看一下程序,程序的目的是求解多元非线性方程组function P=myfun( x,a )F=a(1);T=a(2);Vx1=a(3);Vx2=a(4);Vy1=a(5);Vy2=a(6);Vz1=a(7);Vz2=a(8);x1=a(9);x2=a(10);y1=a(11);y2=a(12);z1=a(13);z2=a(14);r1=[x-x1,y-y1,z-z1];r

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 19:02:56
求matlab大神帮忙看一下程序,程序的目的是求解多元非线性方程组functionP=myfun(x,a)F=a(1);T=a(2);Vx1=a(3);Vx2=a(4);Vy1=a(5);Vy2=a(

求matlab大神帮忙看一下程序,程序的目的是求解多元非线性方程组function P=myfun( x,a )F=a(1);T=a(2);Vx1=a(3);Vx2=a(4);Vy1=a(5);Vy2=a(6);Vz1=a(7);Vz2=a(8);x1=a(9);x2=a(10);y1=a(11);y2=a(12);z1=a(13);z2=a(14);r1=[x-x1,y-y1,z-z1];r
求matlab大神帮忙看一下程序,程序的目的是求解多元非线性方程组
function P=
myfun( x,a )
F=a(1);
T=a(2);
Vx1=a(3);
Vx2=a(4);
Vy1=a(5);
Vy2=a(6);
Vz1=a(7);
Vz2=a(8);
x1=a(9);
x2=a(10);
y1=a(11);
y2=a(12);
z1=a(13);
z2=a(14);
r1=[x-x1,y-y1,z-z1];r2=[x-x2,y-y2,z-z2];r3=[-2107069.481-x1,47977
62.928-y1,-1354900-z1];r4=[-2107069.481-x2,47977
62.928-y2,-1354900-z2];
V1=[Vx1,Vy1,Vz1];V2=[Vx2,Vy2,Vz2];
P=[21.24*(dot(V2,r2)/sqrt(dot(r2,r2))-dot(V1,r1)/sqrt(dot(r1,r1)))+14.72(dot(V2,r4)/sqrt(dot(r4,r4))-dot(V1,r3)/sqrt(dot(r3,r3)))-F;
dot(r2,r2)-dot(r1,r1)+dot(r4,r4)-dot(r3,r3)-T;
(x^2)/(6378137)^2+(y^2)/(6356752.3142)^2+(z^2)/(6399593.63)^2-1;];

end
a =
zeros(14);
display('#
Pls input the known parameters: #')
a(1) =
input(' F= ');
a(2) =
input('T= ');
a(3) =
input('Vx1 = ');
a(4) =
input('Vx2 = ');
a(5) =
input('Vy1= ');
a(6) =
input('Vy2= ');
a(7) =
input('Vz1= ');
a(8) =
input('Vz2 = ');
a(9) =
input('x1 = ');
a(10) =
input('x2 = ');
a(11) =
input('y1 = ');
a(12) =
input('y2 = ');
a(13) =
input('z1 = ');
a(14) =
input('z2 = ');
display('#
Pls input the initial point: #')
x0 =
zeros(3);
x0(1) =
input('x = ');
x0(2) =
input('y = ');
x0(3) =
input('z= ');
options =
optimset('Display','iter'); % Option to display output
[x,fval] =
fsolve(@(x) myfun(x,a),x0,options)
# Pls input
the known parameters: #
F= 496.7330165
T=
-0.004422825
Vx1 =
-0.017463
Vx2 =
-8.433214
Vy1=
-1.061177
Vy2= 4.465864
Vz1=
-0.147952
Vz2 =
96.778425
x1 =
-18129715.71
x2 =
-6317131.997
y1 =
38064542.4
y2 =
41568346.16
z1 =
20260.435
z2 =
-3071223.423
# Pls input
the initial point: #
x = -2000000
y = 4000000
z= -1000000
未定义与 'double' 类型的输入参数相对应的函数'myfun'.
出错 @(x)myfun(x,a)
出错 fsolve (line 217)
fuser =
feval(funfcn{3},x,varargin{:});
原因:
Failure in initial user-supplied objective
function evaluation. FSOLVE cannot continue.

求matlab大神帮忙看一下程序,程序的目的是求解多元非线性方程组function P=myfun( x,a )F=a(1);T=a(2);Vx1=a(3);Vx2=a(4);Vy1=a(5);Vy2=a(6);Vz1=a(7);Vz2=a(8);x1=a(9);x2=a(10);y1=a(11);y2=a(12);z1=a(13);z2=a(14);r1=[x-x1,y-y1,z-z1];r
fsolve(@myfun,x0,options)