将你的两个方程组化简
clear all
clc
syms R fai
m=2;
r0=26;
z1=2;
fai0=pi/6;
Rf=r0-1.2*m;
re=60;
Au=Rf+re;
p=m*z1/2;
Ra=r0+m;
Rg=Rf+0.2*m;
gama=atan(z1*m/(2*r0));
M1=(Au+p*tan(gama))*tan(fai0)
M2=((re-R)*tan(fai0)*tan(fai0)-R)*tan(gama)
M3=p-Au*tan(gama)
N1=Au-R*cos(fai)
N2=R*sin(fai)*cos(gama)-(re-R)*tan(fai0)*sin(gama)
解得
M1 = 48.3553
M2 =20/13-4/39*R
M3 = -4.4308
N1 =418/5-R*cos(fai)
N2 =13/170*R*sin(fai)*170^(1/2)-1/510*(60-R)*3^(1/2)*170^(1/2)
将解得M!M1M2M3N1N2带入索求方程组为:
% N1^2+N2^2=Rg^2
(418/5-R*cos(fai))^2+(13/170*R*sin(fai)*170^(1/2)-1/510*(60-R)*3^(1/2)*170^(1/2))^2= 576
%M1*sin(fai)-M2*cos(fai)+M3=0
6805404261977527/140737488355328*sin(fai)-(20/13-4/39*R)*cos(fai)-288/65=0
编写自己的函数:
function F=myfun(x)
% x(1)=R,x(2)=fai;
F=[(418/5-R*cos(fai))^2+(13/170*R*sin(fai)*170^(1/2)-1/510*(60-R)*3^(1/2)*170^(1/2))^2-576;...
6805404261977527/140737488355328*sin(fai)-(20/13-4/39*R)*cos(fai)-288/65]
用fsolve求解
x0=[0.5 ; 1];
options=optimset( 'MaxIter',30000, 'MaxFunEvals',10000)
[x,fval]=fsolve(@myfun,x0,options)
结果:
x =
59.6010
-0.0030
fval =
1.0e-008 *
0.8355
-0.0000 |