系統(tǒng)建模與仿真習(xí)題1及答案_第1頁(yè)
系統(tǒng)建模與仿真習(xí)題1及答案_第2頁(yè)
系統(tǒng)建模與仿真習(xí)題1及答案_第3頁(yè)
系統(tǒng)建模與仿真習(xí)題1及答案_第4頁(yè)
系統(tǒng)建模與仿真習(xí)題1及答案_第5頁(yè)
已閱讀5頁(yè),還剩14頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、系統(tǒng)建模與仿真習(xí)題一及答案1. 有源網(wǎng)絡(luò)如圖所示(1) 列些輸出與輸入之間的微分方程。(2) 、,在零初始條件下,將(1)中的微分方程表示為傳遞函數(shù)、狀態(tài)空間形式、零極點(diǎn)增益形式。(3)求(2)中方程在輸入為單位階躍響應(yīng)下的輸出曲線。解:(1) 由運(yùn)算放大器的基本特點(diǎn)以及電壓定理(3)式代入(2)式得: (5)消去中間變量有兩邊求導(dǎo)整理后得(2)代入數(shù)據(jù)可以得到微分方程為:程序如下:clc;clear;num=-6.2 -0.7;den=10 1;gtf=tf(num,den)gss=ss(gtf)gzpk=zpk(gtf)結(jié)果:transfer function:-6.2 s - 0.7-

2、10 s + 1 狀態(tài)空間形式:a = x1 x1 -0.1 b = u1 x1 0.125 c = x1 y1 -0.064 d = u1 y1 -0.62 continuous-time model. zero/pole/gain:-0.62 (s+0.1129)- (s+0.1)(3)由(2)知系統(tǒng)的傳遞函數(shù)為-6.2 s - 0.7-10 s + 1系統(tǒng)的輸入信號(hào)為單位階躍函數(shù),則其laplace變換為1/s,這樣系統(tǒng)的輸出信號(hào)的laplace變換為y(s)=-6.2 s - 0.7-10 s2 + s編寫(xiě)程序,將其表示為(r,p,q)形式clc;clear;s=tf(s)gtf=(-

3、6.2*s-0.7)/(10*s2+s)num,den=tfdata(gtf,v)r,p,q=residue(num,den)r = 0.0800 -0.7000p = -0.1000 0q = 于是得到:繪制曲線程序:clc;clear;t=0:0.1:100;y=0.08*exp(-0.1*t)-0.7;plot(t,y)2.已知系統(tǒng)的框圖如下:_y(t)r(t)350其中:g1=1/(s+1),g2=s/(s2+2),g3=1/s2,g4=(4*s+2)/(s+1)2,g5=(s2+2)/(s3+14)。(1)根據(jù)梅森公式求總系統(tǒng)傳遞函數(shù)(2)根據(jù)節(jié)點(diǎn)、支點(diǎn)、相加點(diǎn)移動(dòng)方法求總系統(tǒng)傳遞函

4、數(shù)(3)根據(jù)feedback( )函數(shù)求總系統(tǒng)傳遞函數(shù)解:(1)前向通道傳遞函數(shù)為三個(gè)回路:,兩個(gè)不接觸回路:clc;clear;s=tf(s);g1=1/(s+1);g2=s/(s2+2);g3=1/s2;g4=(4*s+2)/(s+1)2;g5=(s2+2)/(s3+14);g=minreal(3*g3*g2*g1/(1+g4*g2*g1+50*g3+g5*g3*g2*g1+50*g3*g4*g2*g1)結(jié)果:transfer function: 3 s6 + 6 s5 + 3 s4 + 42 s3 + 84 s2 + 42 s-s10 + 3 s9 + 55 s8 + 175 s7 +

5、300 s6 + 923 s5 + 2456 s4 + 3715 s3 + 2132 s2 + 2802 s + 1400 (2),構(gòu)成反饋回路50,構(gòu)成反饋回路clc;clear;s=tf(s);g1=1/(s+1);g2=s/(s2+2);g3=1/s2;g4=(4*s+2)/(s+1)2;g5=(s2+2)/(s3+14);g124=g2*g1/(1+g2*g1*g4);g350=g3/(1+g3*50);g=minreal(3*g350*g124/(1+g350*g124*g5)結(jié)果:transfer function: 3 s6 + 6 s5 + 3 s4 + 42 s3 + 84

6、s2 + 42 s-s10 + 3 s9 + 55 s8 + 175 s7 + 300 s6 + 923 s5 + 2456 s4 + 3715 s3 + 2132 s2 + 2802 s + 1400(3)clc;clear;s=tf(s);g1=1/(s+1);g2=s/(s2+2);g3=1/s2;g4=(4*s+2)/(s+1)2;g5=(s2+2)/(s3+14);g124=feedback(g2*g1,g4);g350=feedback(g3,50);g=minreal(3*feedback(g350*g124,g5)結(jié)果:transfer function: 3 s6 + 6 s

7、5 + 3 s4 + 42 s3 + 84 s2 + 42 s-s10 + 3 s9 + 55 s8 + 175 s7 + 300 s6 + 923 s5 + 2456 s4 + 3715 s3 + 2132 s2 + 2802 s + 1400 3. 已知系統(tǒng)的傳遞函數(shù)模型為:(1) 采用tf( )函數(shù)將該傳遞函數(shù)模型輸入到matlab環(huán)境。(2) 采用zpk( )、tf2zp( )函數(shù)將上述傳遞函數(shù)模型轉(zhuǎn)化為零極點(diǎn)增益模型。(3) 采用ss( )、tf2ss( )函數(shù)將上述傳遞函數(shù)模型轉(zhuǎn)化為狀態(tài)空間模型。(4) 采用tf( )、 ss2tf( )將(3)中變換后的狀態(tài)空間模型回變?yōu)閭鬟f函數(shù)

8、模型,并與(1)的結(jié)果進(jìn)行比較。(5) 采用residue( ) 函數(shù)將上述傳遞函數(shù)模型轉(zhuǎn)化為部分分式模型。(6) 繪制系統(tǒng)的零極點(diǎn)圖。解:(1)clc; clear;num=1 0 4 2;den1=conv(1 0 1,conv(1 0 1,1 0 1)+0 0 0 0 0 2 5;den=conv(1,0,conv(1,0,conv(1,0,conv(1,0 2,den1);g=tf(num,den)結(jié)果: s3 + 4 s + 2-s11 + 5 s9 + 9 s7 + 2 s6 + 12 s5 + 4 s4 + 12 s3(2) clc; clear;num=1 0 4 2;den1

9、=conv(1 0 1,conv(1 0 1,1 0 1)+0 0 0 0 0 2 5;den=conv(1,0,conv(1,0,conv(1,0,conv(1,0 2,den1);g=tf(num,den);sys=zpk(g)z,p,k=tf2zp(num,den)結(jié)果: (s+0.4735) (s2 - 0.4735s + 4.224)-s3 (s2 + 1.544s + 1.227) (s2 - 1.762s + 1.755) (s2 + 2) (s2 + 0.2176s + 2.786) z = 0.2367 + 2.0416i 0.2367 - 2.0416i -0.4735 p

10、 = 0 0 0 0.8810 + 0.9896i 0.8810 - 0.9896i -0.7722 + 0.7940i -0.7722 - 0.7940i -0.1088 + 1.6657i -0.1088 - 1.6657i -0.0000 + 1.4142i -0.0000 - 1.4142ik = 1(3)clc; clear;num=1 0 4 2;den1=conv(1 0 1,conv(1 0 1,1 0 1)+0 0 0 0 0 2 5;den=conv(1,0,conv(1,0,conv(1,0,conv(1,0 2,den1);g=tf(num,den);sys=ss(g)

11、a,b,c,d=tf2ss(num,den)結(jié)果:a = x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x1 0 -1.25 0 -1.125 -0.25 -0.75 -0.25 -0.75 0 0 x2 4 0 0 0 0 0 0 0 0 0 x3 0 2 0 0 0 0 0 0 0 0 x4 0 0 1 0 0 0 0 0 0 0 x5 0 0 0 1 0 0 0 0 0 0 x6 0 0 0 0 2 0 0 0 0 0 x7 0 0 0 0 0 1 0 0 0 0 x8 0 0 0 0 0 0 1 0 0 0 x9 0 0 0 0 0 0 0 1 0 0 x10 0 0

12、0 0 0 0 0 0 2 0 x11 0 0 0 0 0 0 0 0 0 0.5 x11 x1 0 x2 0 x3 0 x4 0 x5 0 x6 0 x7 0 x8 0 x9 0 x10 0 x11 0 b = u1 x1 0.5 x2 0 x3 0 x4 0 x5 0 x6 0 x7 0 x8 0 x9 0 x10 0 x11 0 c = x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 y1 0 0 0 0 0 0 0 0.125 0 0.25 0.25 d = u1 y1 0 continuous-time model.a = 0 -5 0 -9 -2 -12 -4

13、 -12 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0b = 1 0 0 0 0 0 0 0 0 0 0c = 0 0 0 0 0 0 0 1 0 4 2d = 0(4)clc; clear;n

14、um=1 0 4 2;den1=conv(1 0 1,conv(1 0 1,1 0 1)+0 0 0 0 0 2 5;den=conv(1,0,conv(1,0,conv(1,0,conv(1,0 2,den1);g=tf(num,den);sys=ss(g);a,b,c,d=tf2ss(num,den);sys=tf(sys)num,den=ss2tf(a,b,c,d)結(jié)果:transfer function: s3 - 1.11e-016 s2 + 4 s + 2-s11 + 4.816e-015 s10 + 5 s9 + 2.386e-014 s8 + 9 s7 + 2 s6 + 12

15、s5 + 4 s4 + 12 s3 num = columns 1 through 9 0 0.0000 0 0.0000 -0.0000 0.0000 0.0000 -0.0000 1.0000 columns 10 through 12 0.0000 4.0000 2.0000den = columns 1 through 9 1.0000 -0.0000 5.0000 0.0000 9.0000 2.0000 12.0000 4.0000 12.0000 columns 10 through 12 0 0 0(5)clc; clear;num=1 0 4 2;den1=conv(1 0

16、1,conv(1 0 1,1 0 1)+0 0 0 0 0 2 5;den=conv(1,0,conv(1,0,conv(1,0,conv(1,0 2,den1);r,p,q=residue(num,den) 結(jié)果:r = -0.0246 + 0.0089i -0.0246 - 0.0089i 0.0833 + 0.0295i 0.0833 - 0.0295i 0.0274 + 0.0298i 0.0274 - 0.0298i 0.0435 + 0.0581i 0.0435 - 0.0581i -0.2593 0.2778 0.1667 p = -0.1088 + 1.6657i -0.108

17、8 - 1.6657i -0.0000 + 1.4142i -0.0000 - 1.4142i 0.8810 + 0.9896i 0.8810 - 0.9896i -0.7722 + 0.7940i -0.7722 - 0.7940i 0 0 0 q = (6)clc; clear;num=1 0 4 2;den1=conv(1 0 1,conv(1 0 1,1 0 1)+0 0 0 0 0 2 5;den=conv(1,0,conv(1,0,conv(1,0,conv(1,0 2,den1);g=tf(num,den);pzmap(g) 結(jié)果:4. 考慮二階系統(tǒng):系統(tǒng)的輸入為。(1) 利用部

18、分分式模型方法求輸出的解析解,并繪制其曲線。(2) 利用lsim(g,u,t)函數(shù)直接繪制系統(tǒng)的輸出曲線,并與(1)的結(jié)果比較。解:(1)先求的laplace變換clc;clear;syms tf=sin(2*t);f=laplace(f)結(jié)果:f =2/(s2+4)于是: 以下求的部分分式模型:clc;clear;s=tf(s);g=2/(s2+2*s+1)*(s2+4);num,den=tfdata(g,v);r,p,q=residue(num,den)r = -0.0800 + 0.0600i -0.0800 - 0.0600i 0.1600 0.4000 p = 0.0000 + 2.

19、0000i 0.0000 - 2.0000i -1.0000 -1.0000 q = 可以得到解析解為:繪制曲線:clc;clear;t=0:0.1:50;y=(-0.0800+0.0600*i)*exp(2*i*t)+(-0.0800-0.0600*i)*exp(-2*i*t)+0.16*exp(-t)+0.4*t.*exp(-t);plot(t,y)(2) clc;clear;t=0:0.1:50;s=tf(s);g=1/(s2+2*s+1);u=sin(2*t)lsim(g,u,t)討論:在(1)中得到解析解為:這個(gè)結(jié)果前半部分物理意義不能直接表達(dá)出來(lái)。如果采用以下變換:式中:,則可以得

20、出解析解的更簡(jiǎn)明的形式。編寫(xiě)以下通用程序:文件名為bianhuan.mfunction r,p,q=bianhuan(num,den)r,p,q=residue(num,den);for k=1:length(r) if imag(p(k)eps a=real(r(k);b=imag(r(k); r(k)=-2*sqrt(a2+b2); r(k+1)=-atan2(a,b); elseif abs(imag(p(k)eps r(k)=real(r(k); endend如果p(k)為實(shí)數(shù),則(r(k),p(k)對(duì)和標(biāo)準(zhǔn)的residue()函數(shù)中定義是完全一致的。如果p(k)為復(fù)數(shù),則(r(k),r(k+1)對(duì)返回和參數(shù),而p(k)的定義仍與residue()中的一致。以下編寫(xiě)程序,調(diào)用程序調(diào)用bianhuan.m,將解析解:用正弦以及指數(shù)的形式表示。clc;clear;s=tf(s);g=2/(s2+2*s+1)*(s2+4);num,den=tfdata(g,v);r,p,q=bianhuan(num,den)結(jié)果:r = -0.2000 0.9273 0.1600 0.4000p = 0.0000 + 2.0000i 0.0000 - 2.0000i -1.0000 -1.0000 q = 于是解析式

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論