- 25
- 0
- 约1.04万字
- 约 30页
- 2018-02-23 发布于贵州
- 举报
西安电子科技大学自动控制上机报告
自动控制上机作业报告班级:程序clcft = 30;M=1;B=5;K=20; %系统参数tspan = [0,5];%设置仿真开始和结束时间x0= [0,0];options = odeset(AbsTol,[1e-6;1e-6]);[T,X]=ode45(xt4odefile,tspan,x0,options);figure(1)subplot(3,1,1),plot(T,X(:,1),r),title(位移随时间变化曲线),grid onsubplot(3,1,2),plot(T,X(:,2),b),title(速度随时间变化曲线),grid onsubplot(3,1,3),plot(X(:,2),X(:,1),m),title(位移随速度变化曲线),grid ona = 1/M*(ft-B*X(:,2)-K*X(:,1)); %计算加速度i = 1; while (abs(a(i))0.0001|(abs(X(i,2))0.0001))i = i+1; enddisp(系统到达稳态时的时间、速度和加速度及对应的位移分别为: );%显示计算结果result = sprintf(时间 t=%4.2f\n,T(i));disp(result);result = sprintf(速度 v=%9.6f\n,X(i,2)
原创力文档

文档评论(0)