急求MATLAB代码,自动控制原理习题,最好有word格式的
MATLAB\u81ea\u52a8\u63a7\u5236\u539f\u7406\u4e60\u9898\u7cbe\u89e3\u600e\u4e48\u6837\u521a\u5f00\u59cb\u5b66\u4e60\u81ea\u63a7\u539f\u7406\u7684\u65f6\u5019\uff0c\u6709\u70b9\u542c\u5929\u4e66\u7684\u611f\u89c9\u3002\u5f88\u5bb9\u6613\u9677\u5165\u6570\u5b66\u7684\u7ec6\u8282\u4e2d\u53bb\u4e86\u3002\u770b\u4e86\u8fd9\u672c\u4e66\u4ee5\u540e\uff0c\u53d1\u73b0\u5f88\u591a\u6240\u6709\u7684\u6570\u5b66\u7ec6\u8282\u90fd\u53ef\u4ee5\u4ea4\u7ed9\u8ba1\u7b97\u673a\u5b8c\u6210\u7684\u65f6\u5019\uff0c\u518d\u770b\u81ea\u52a8\u63a7\u5236\u539f\u7406\uff0c\u4e00\u5207\u8c41\u7136\u5f00\u6717\u4e86\u3002
\u800c\u5e7f\u544a\u8d39\u4e0e\u9500\u552e\u91cf\u6210\u4e8c\u6b21\u591a\u9879\u5f0f\uff08\u629b\u7269\u7ebf\u5173\u7cfb\uff09\u5173\u7cfb
Linear model Poly2:
f(x) = p1*x^2 + p2*x + p3
Coefficients (with 95% confidence bounds):
p1 = -0.0004256 (-0.0004701, -0.0003811)
p2 = 0.04092 (0.03768, 0.04416)
p3 = 1.019 (0.9702, 1.067)
Goodness of fit:
SSE: 0.002515
R-square: 0.997
Adjusted R-square: 0.9957
RMSE: 0.02243
\u4ef7\u683c\u4e0e\u552e\u51fa\u91cf\u6210\u7ebf\u6027\u5173\u7cfb\uff0c
Linear model Poly1:
f(x) = p1*x + p2
Coefficients (with 95% confidence bounds):
p1 = -5.133 (-5.573, -4.694)
p2 = 50.42 (48.58, 52.27)
Goodness of fit:
SSE: 3.622
R-square: 0.9909
Adjusted R-square: 0.9896
RMSE: 0.7193
\u4f7f\u7528\u975e\u7ebf\u6027\u89c4\u5212\u6c42\u89e3\uff0c\u5efa\u7acb\u51fd\u6570\u6587\u4ef6\u5b58\u4e3aXno.m
function [f,g]=Xno(x)
x1=[0 10 20 30 40 50 60 70];
y1=[1.0 1.40 1.70 1.85 1.95 2.00 1.95 1.80];
x2=[2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0];
y2=[41,38,34,32,29,28,25,22,20];
a=polyfit(x1,y1,2);
b=polyfit(x2,y2,1);
f=-(x(2)-2)*polyval(b,x(2))*polyval(a,x(1))+x(1)
g(1)=x(1)-70;
g(2)=x(2)-6;
g(3)=-x(1);
g(4)=-x(2)+2;
\u5728\u547d\u4ee4\u7a97\u53e3\u8f93\u5165
x0=[30 3];opt\uff081\uff09=1\uff1b
>> x=constr('Xno',x0,opt)
\u53ef\u5f97\u5e7f\u544a\u8d39\u548c\u4ef7\u683c\u3002
x =
33.1166 5.9113
这些东西很基础,网上书上一般都有,你随便搜一下就有了。代码如下~~
num=[1 -2 2];
den=[1 3 2 0];
rlocus(num,den)
grid on
xlabel('Real Axis'),ylabel('Imaginary Axis');
title('Root Locus')
运行m程序后,可得根轨迹曲线。随后在代码之后再添加一行:
k=rlocfind(num,den);
重新运行后,matlab窗口会提示“Select a point in the graphics window“,在跳出来的根轨迹图中选中与虚轴的交点,对比右上方workplace中的数据可验证Kmax=0.79(人工取点会有点误差),红色“+”处为取的点。至于为什么要取与虚轴的交点,那是因为在整定参数的过程中,K值越大,系统调节时间越短,更容易出现超调,但是当K值大到一定程度后,系统将由稳定状态过渡到不稳定状态,稳定到不稳定的临界线即虚轴~~
绛旓細浼犻掑嚱鏁颁腑鍏充簬s鐨勬寚鏁伴」瀵瑰簲鐨勬槸寤惰繜鐜妭锛屼娇鐢╰f鐨刬oDelay灞炴ц繘琛岃缃備緥濡傦細>> tf(5.3,[1 5.3 4 2],'ioDelay',0.5) Transfer function: 5.3exp(-0.5*s) * --- s^3 + 5.3 s^2 + 4 s + 2
绛旓細鍙傝浠g爜锛歴=zpk('s');G=1/((s+1)*(s^2+6*s+10))rlocus(G)
绛旓細鐩存帴浣跨敤margin鍑芥暟灏卞彲浠ヤ簡銆傚弬鑰浠g爜 s=tf('s');G=35/(s*(0.2*s+1)*(0.01*s+1)*(0.005*s+1));margin(G)缁撴灉 鐢卞浘鍙锛岀浉瑙掕搴︿负10.6搴︼紙鍓垏棰戠巼wc=12.7锛夛紝骞呭艰搴︿负5.95dB銆備篃鍙互璁﹎argin鍑芥暟杩斿洖鍙傛暟锛>> [Gm,Pm,Wcg,Wcp] = margin(G)Gm = 1.98333676230356Pm...
绛旓細num=[1 -2 2];den=[1 3 2 0]; rlocus(num,den)grid onxlabel('Real Axis'),ylabel('Imaginary Axis'); title('Root Locus')杩愯m绋嬪簭鍚庯紝鍙緱鏍硅建杩规洸绾裤傞殢鍚庡湪浠g爜涔嬪悗鍐嶆坊鍔犱竴琛岋細k=rlocfind(num,den);閲嶆柊杩愯鍚锛宮atlab绐楀彛浼氭彁绀衡淪elect a point in the graphics window鈥滐紝鍦ㄨ烦鍑...
绛旓細G2=tf(2,[1 1 0]);G3=tf([ 1 2],[1 3]);G4=feedback(G2,G3,1);%杩欐潯寰楀埌鍓嶅悜閫氶亾閲岄潰閭d釜姝e弽棣堢殑寮忓瓙锛宖eedback鐢ㄦ硶鏈夌偣蹇 浜嗭紝鍙互鍘绘煡鏌ワ紝鏄湁姝e弽棣堢殑鐢ㄦ硶鐨勩侴5=tf([5 0],[1 6 8]);G=feedback(G1*G4,G5) %鏈缁堢粨鏋 鏄繖涔堜釜鎬濊矾锛屽彲鑳芥湁鐐瑰皬閿欒锛屾垜杩...
绛旓細1銆佸紑鐜紶鍑斤紝姹傚紑鐜瀬鐐癸紝鐩存帴姹傚垎姣嶅椤瑰紡鐨勬牴鍗冲彲 p = roots([1 2 3 1])2銆佺敾鏍硅建杩瑰緢瀹规槗锛屾妯″瀷閫傚悎鐢ㄩ浂鏋佺偣褰㈠紡琛ㄨ揪 figure(101)GH = zpk([], [0 -2 -4], 1);rlocus(GH)姹傞棴鐜郴缁熺ǔ瀹氱ǔ瀹氱殑涓寸晫澧炵泭鍙互鐢ㄩ紶鏍囩偣鍑绘牴杞ㄨ抗鏇茬嚎锛岀劧鍚庢嫋鍔ㄥ埌鍜岃櫄 杞寸浉浜ょ殑浣嶇疆锛屽浘涓細鏄剧ず璇ョ偣澶...
绛旓細1銆佹棦鐒舵槸鍗曚綅鍙嶉锛屽弽棣堥氶亾灏辨病蹇呰鏀句竴涓狧(s)鏂规浜嗭紱2銆佺1棰樺彧璇村埌kp锛屽簲璇ユ槸鍗曠嫭鐨凱鎺у埗锛浣嗚〃杈句笉娓呮銆3銆佺2銆3棰樻墍璋撯滅Н鍒嗘椂闂粹濄佲滃井鍒嗘椂闂粹濋兘鏄惧緱寰堜笉涓撲笟锛屽鏄撳紩璧锋涔夛紝搴斿姞涓娾滃父鏁扳濅簩瀛椾负瀹溿傜1棰 锛1锛夋眰闃惰穬鍝嶅簲 G=zpk([],[-1 -1 -1],1);for kp=1:0.5:...
绛旓細[0.04 0.6 2]鏄檷骞曟帓鍒楃殑鍒嗗瓙绯绘暟锛孾2 0]鏄垎姣嶇郴鏁般傝繕鏈夊緢澶氬啓娉曪紝濡備袱涓井鍒嗙殑涓茶仈绛夈傚箙鍊兼槸鍏堜笅闄嶅啀涓婂崌锛屽垎鏋愭渶灏忓箙鍊肩殑棰戠巼锛涚浉瑙掓槸-90搴︼紝鐒跺悗涓婂崌180搴﹀埌90搴︺備綔涓鸿ˉ鍋跨幆鑺傦紝鑳藉琛ュ伩鐨勮秴鍓嶇浉瑙掑ぇ绾80搴︼紝绯荤粺绌胯秺棰戠巼浣嶄簬鐩歌涓婂崌骞呭害涓嶅ぇ鐨勪綅缃傚叿浣撳彲鍦ㄤ集寰峰浘涓婃煡鍑嗙‘鏁版嵁銆
绛旓細杩欎釜棰樼洿鎺ユ妸浼犻掑嚱鏁拌〃绀哄嚭鏉ョ劧鍚庤皟鐢ㄧ浉搴旂殑鍑芥暟鍗冲彲銆傚弬鑰浠g爜锛欸1=tf([1 2],[1 31 229 198]);s=tf('s');G=feedback(G1,1)/s;bode(1000*G)figure,margin(1000*G)figure,rlocus(G)锛1锛変粠margin鐨勭粯鍥剧粨鏋滃彲鐭ュ箙鍊艰搴︿负14.1dB锛岀浉瑙掕搴︿负40.6搴︺傦紙2锛変粠鏍硅建杩瑰浘鍙锛岄棴鐜郴缁...
绛旓細杈撳叆help feedback 灏卞彲浠ョ煡閬揻eedback(sys1,sys2,sign),鍏朵腑sys1锛宻ys2蹇呴』鏄紶閫掑嚱鏁帮紝浣犱笂闈㈢殑绋嬪簭鏍规湰灏辨病鏈変紶閫掑嚱鏁般傚彟澶-1琛ㄧず姝e弽棣堬紝1鎴栬呴粯璁わ紙涓嶅啓锛変负璐熷弽棣堛傝屼笖feedback杩斿洖鐨勬槸浼犻掑嚱鏁帮紝鑰屼笉鏄竴涓垎姣嶏紝鍒嗗瓙鐨勭煩闃碉紝浼犻掑嚱鏁扮敤tf锛堬級鏉ョ粰鍑恒傛墍浠ユ纭▼搴忓簲璇ヤ负锛歝lear numg=[2]...