pid-auto-control.zip

  • PUDN用户
    了解作者
  • matlab
    开发工具
  • 3KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 4
    下载次数
  • 2015-07-27 11:35
    上传日期
这是我自动控制课程作业上的MATLAB代码,pid控制参数改变得出不同的曲线。
pid-auto-control.zip
  • 自动控制
  • pid_1.m
    979B
  • auto.m
    58B
  • step.m
    4.6KB
内容介绍
function [yout,x,t] = step(a,b,c,d,iu,t) %STEP Step response of dynamic systems. % % [Y,T] = STEP(SYS) computes the step response Y of the dynamic system SYS. % The time vector T is expressed in the time units of SYS and the time % step and final time are chosen automatically. For multi-input systems, % independent step commands are applied to each input channel. If SYS has % NY outputs and NU inputs, Y is an array of size [LENGTH(T) NY NU] where % Y(:,:,j) contains the step response of the j-th input channel. % % For state-space models, % [Y,T,X] = STEP(SYS) % also returns the state trajectory X, an array of size [LENGTH(T) NX NU] % for a system with NX states and NU inputs. % % For identified models (see IDLTI and IDNLMODEL), % [Y,T,X,YSD] = STEP(SYS) % also computes the standard deviation YSD of the response Y (YSD is empty % if SYS does not contain parameter covariance information). % % [Y,...] = STEP(SYS,TFINAL) simulates the step response from t=0 to the % final time t=TFINAL (expressed in the time units of SYS). For discrete- % time models with unspecified sample time, TFINAL is interpreted as % the number of sampling periods. % % [Y,...] = STEP(SYS,T) specifies the time vector T for simulation (in % the time units of SYS). For discrete-time models, T should be of the % form 0:Ts:Tf where Ts is the sample time. For continuous-time models, % T should be of the form 0:dt:Tf where dt is the sampling period for the % discrete approximation of SYS. % % [Y,...] = STEP(SYS,...,OPTIONS) specifies additional options such as the % step amplitude or input offset. Use stepDataOptions to create the option % set OPTIONS. % % When called without output arguments, STEP(SYS,...) plots the step % response of SYS and is equivalent to STEPPLOT(SYS,...). See STEPPLOT % for additional graphical options for step response plots. % % See also STEPPLOT, stepDataOptions, IMPULSE, INITIAL, LSIM, LTIVIEW, % DYNAMICSYSTEM, IDLTI. % Extra notes on user-supplied T: For continuous-time systems, the system is % converted to discrete time with a sample time of dt=t(2)-t(1). The time % vector plotted is then t=t(1):dt:t(end). % Old help %warning(['This calling syntax for ' mfilename ' will not be supported in the future.']) %STEP Step response of continuous-time linear systems. % STEP(A,B,C,D,IU) plots the time response of the linear system: % . % x = Ax + Bu % y = Cx + Du % to a step applied to the input IU. The time vector is auto- % matically determined. STEP(A,B,C,D,IU,T) allows the specification % of a regularly spaced time vector T. % % [Y,X] = STEP(A,B,C,D,IU,T) or [Y,X,T] = STEP(A,B,C,D,IU) returns % the output and state time response in the matrices Y and X % respectively. No plot is drawn on the screen. The matrix Y has % as many columns as there are outputs, and LENGTH(T) rows. The % matrix X has as many columns as there are states. If the time % vector is not specified, then the automatically determined time % vector is returned in T. % % [Y,X] = STEP(NUM,DEN,T) or [Y,X,T] = STEP(NUM,DEN) calculates the % step response from the transfer function description % G(s) = NUM(s)/DEN(s) where NUM and DEN contain the polynomial % coefficients in descending powers of s. % % See also: INITIAL, IMPULSE, LSIM and DSTEP. % J.N. Little 4-21-85 % Revised A.C.W.Grace 9-7-89, 5-21-92 % Revised A. Potvin 12-1-95 % Copyright 1986-2011 The MathWorks, Inc. ni = nargin; no = nargout; if ni==0, eval('exresp(''step'')') return end narginchk(2,6) % Determine which syntax is being used switch ni case 2 if size(a,1)>1, % SIMO syntax a = num2cell(a,2); den = b; b = cell(size(a,1),1); b(:) = {den}; end sys = tf(a,b); t = []; case 3 % Transfer function form with time vector if size(a,1)>1, % SIMO syntax a = num2cell(a,2); den = b; b = cell(size(a,1),1); b(:) = {den}; end sys = tf(a,b); t = c; case 4 % State space system without iu or time vector sys = ss(a,b,c,d); t = []; otherwise % State space system with iu if min(size(iu))>1, error('IU must be a vector.'); elseif isempty(iu), iu = 1:size(d,2); end sys = ss(a,b(:,iu),c,d(:,iu)); if ni<6, t = []; end end if no==1, yout = step(sys,t); yout = yout(:,:); elseif no>1, [yout,t,x] = step(sys,t); yout = yout(:,:); x = x(:,:); t = t'; else step(sys,t); end % end step
评论
    相关推荐
    • jisuanjikongzhililundazuoye3.rar
      华北电力大学计算机控制理论课,的第3次大作业的编程,主要是显示PID自动校正
    • matlabcnhelp.rar
      matlab中文帮助很难找的,快速下载
    • MobilePolice.rar
      移动警察,车牌识别,车牌定位系统源代码,已经运用在移动车载稽查系统中。
    • SVM(matlab).rar
      支持向量机(SVM)实现的分类算法源码[matlab]
    • svm.zip
      用MATLAB编写的svm源程序,可以实现支持向量机,用于特征分类或提取
    • Classification-MatLab-Toolbox.rar
      模式识别matlab工具箱,包括SVM,ICA,PCA,NN等等模式识别算法,很有参考价值
    • VC++人脸定位实例.rar
      一个经典的人脸识别算法实例,提供人脸五官定位具体算法及两种实现流程.
    • QPSK_Simulink.rar
      QPSK的Matlab/Simulink的调制解调仿真系统,给出接收信号眼图及系统仿真误码率,包含载波恢复,匹配滤波,定时恢复等重要模块,帮助理解QPSK的系统
    • LPRBPDemo2009KV.rar
      车牌识别,神经网络算法,识别率高达95%,识别时间低于80ms。
    • MODULATION.RAR
      这个源程序代码包提供了通信系统中BPSK,QPSK,OQPSK,MSK,MSK2,GMSK,QAM,QAM16等调制解调方式 用matlab的实现,以及它们在AWGN和Rayleigh信道下的通信系统实现及误码率性能