作业帮 > 数学 > 作业

Matlab 方程根 绘图

来源:学生作业帮 编辑:百度作业网作业帮 分类:数学作业 时间:2024/04/28 00:52:52
Matlab 方程根 绘图
st=pi/2;
a=27;
b=35;
c=250;
F=200;
bt=0.75*pi-st;
k=(a*sin(st))/((a^2*cos(st)^2-a^2+b^2)^0.5);
A=[-1,0,k;0,-1,1;a*cos(st),a*sin(st),0];
b=[-F*cos(bt),F*sin(bt),F*c]';
x=sym(A)\sym(b)
xx=A\b;
要求 st=pi/2:pi/90:pi/18;时候
分别得到st与xx(1),xx(2),xx(3),的图,st为横坐标,
单独的图标和三条曲线在一起的图标都要得到,
也就是求方程Ax=b的解,求xx(1),xx(2),xx(3)和st的关系图
Matlab 方程根 绘图
st=pi/18:pi/90:pi/2;
number=size(st,2);
xx=zeros(3,number);
for current=1:1:number
% st=pi/2;
st_c=st(current);
a=27;
b=35;
c=250;
F=200;
bt=0.75*pi-st_c;
k=(a*sin(st_c))/((a^2*cos(st_c)^2-a^2+b^2)^0.5);
A=[-1,0,k;0,-1,1;a*cos(st_c),a*sin(st_c),0];
b=[-F*cos(bt),F*sin(bt),F*c]';
% x =sym(A)\sym(b);
xx(:,current)=A\b;
end
plot(st,xx(1,:),'-b',st,xx(2,:),'-r',st,xx(3,:),'-g');
legend('xx(1)','xx(2)','xx(3)');
单独的图只要分别
plot(st,xx(1,:),'-b');
plot(st,xx(2,:),'-r');
plot(st,xx(3,:),'-g');
就行了