學(xué)校課程安排受到很大的影響,因此對(duì)授課的方式和內(nèi)容作_第1頁(yè)
學(xué)校課程安排受到很大的影響,因此對(duì)授課的方式和內(nèi)容作_第2頁(yè)
學(xué)校課程安排受到很大的影響,因此對(duì)授課的方式和內(nèi)容作_第3頁(yè)
學(xué)校課程安排受到很大的影響,因此對(duì)授課的方式和內(nèi)容作_第4頁(yè)
已閱讀5頁(yè),還剩78頁(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、在抗擊“非典”期間,學(xué)校課程安排受到很大的影響,因此對(duì)授課的方式和內(nèi)容作了相應(yīng)的修改: 1、取消第四章,將仿真實(shí)例的學(xué)習(xí)排入前三章,要求同學(xué)通過(guò)自己的上機(jī)實(shí)踐學(xué)習(xí)Matlab和Simulink的基本操作。 2、原上機(jī)實(shí)踐部分的內(nèi)容安排為幾個(gè)范例的學(xué)習(xí)。同學(xué)們應(yīng)充分利用范例對(duì)所涉及的關(guān)鍵內(nèi)容進(jìn)行實(shí)踐。計(jì) 算 機(jī) 仿 真 技 術(shù)童 亦 斌2003.4系統(tǒng)的分析方法 系統(tǒng):客觀世界中相互作用的實(shí)體所構(gòu)成的具有特定功能的整體。 為了定量分析系統(tǒng),可將其本身的特點(diǎn)和內(nèi)部的相互關(guān)系抽象出來(lái),構(gòu)造出系統(tǒng)的模型。對(duì)系統(tǒng)的分析變成對(duì)系統(tǒng)模型的分析。 系統(tǒng)模型:分物理模型和數(shù)學(xué)模型,由于計(jì)算機(jī)技術(shù)的發(fā)展,數(shù)學(xué)模型

2、的應(yīng)用越來(lái)越廣泛。 系統(tǒng)的數(shù)學(xué)模型:描述系統(tǒng)動(dòng)態(tài)特性的數(shù)學(xué)表達(dá)式。 根據(jù)系統(tǒng)的性質(zhì)和數(shù)學(xué)分析工具可分為:連續(xù)系統(tǒng)、離散時(shí)間系統(tǒng)、離散事件系統(tǒng)、混合系統(tǒng)等。系統(tǒng)的仿真分析方法 仿真技術(shù):用模擬的方法模擬實(shí)際系統(tǒng)的表現(xiàn)。 仿真技術(shù)的基本方法:數(shù)學(xué)模型仿真、物理模型仿真、硬件仿真、操作仿真、虛擬現(xiàn)實(shí)。 系統(tǒng)仿真:根據(jù)系統(tǒng)數(shù)學(xué)模型研究系統(tǒng)性能。 計(jì)算機(jī)仿真:利用計(jì)算機(jī)完成對(duì)系統(tǒng)的仿真。本課程特指利用計(jì)算機(jī)、根據(jù)系統(tǒng)的數(shù)學(xué)模型對(duì)電路系統(tǒng)進(jìn)行仿真。計(jì)算機(jī)仿真技術(shù)講授內(nèi)容 計(jì)算機(jī)仿真技術(shù)概述 Matlab和Simulink簡(jiǎn)介 計(jì)算機(jī)仿真的建模 計(jì)算機(jī)仿真實(shí)例 計(jì)算機(jī)仿真上機(jī)實(shí)踐本課程的學(xué)習(xí)方法、作業(yè)和考試

3、 學(xué)習(xí)方法:特別強(qiáng)調(diào)直接在計(jì)算機(jī)進(jìn)行實(shí)踐,強(qiáng)調(diào)學(xué)習(xí)利用Matlab各種資源解決問(wèn)題; 作業(yè):分別關(guān)于Matlab的基本使用、Simulink的建模、S函數(shù)和Simulink結(jié)果的調(diào)用; 考試:建立一個(gè)交流異步電機(jī)變頻啟動(dòng)的計(jì)算機(jī)仿真模型,對(duì)交流異步電機(jī)的變頻啟動(dòng)過(guò)程進(jìn)行觀察;123456ABCD654321DCBATitleNumberRevisionSizeBDate:14-Apr-2003Sheet of File:H:個(gè) 人 文 檔 學(xué) 校 計(jì) 算 機(jī) 控 制 技 術(shù) 圖 計(jì) 算 機(jī) 控 制 技 術(shù) .ddbDrawn By:Power SupplyIGBT InverterAsynch

4、ronousMotorPWM PulsesGeneratorOutput FrequencyControl交流電機(jī)變頻系統(tǒng)框圖考試的基本要求和條件 基本要求利用搭建的模型研究變頻啟動(dòng)過(guò)程中電機(jī)電流的變化情況; 條件:電源電壓直流600V、電機(jī)為Simulink默認(rèn)的交流異步電機(jī)、電機(jī)空載、采用理想IGBT逆變器橋、開(kāi)關(guān)頻率固定為2500Hz、輸出頻率從5Hz變化到50Hz、啟動(dòng)時(shí)間可調(diào);第一章 計(jì)算機(jī)仿真技術(shù)概述 為什么要進(jìn)行計(jì)算機(jī)仿真? 計(jì)算機(jī)仿真能完成什么任務(wù)? 計(jì)算機(jī)仿真技術(shù)的關(guān)鍵 仿真軟件的發(fā)展?fàn)顩r 電子設(shè)計(jì)自動(dòng)化的主要應(yīng)用領(lǐng)域 計(jì)算機(jī)仿真的基本步驟 計(jì)算機(jī)仿真設(shè)計(jì)的原則1.1 為什么

5、要進(jìn)行計(jì)算機(jī)仿真? 實(shí)際系統(tǒng)的理論分析往往非常復(fù)雜,傳統(tǒng)的分析方法幾乎不可能完成; 很多時(shí)候幾乎不可能或很難進(jìn)行真實(shí)實(shí)驗(yàn)的分析和驗(yàn)證; 實(shí)驗(yàn)的成本高、效率低、周期長(zhǎng);通過(guò)計(jì)算機(jī)仿真我們能夠: 提高設(shè)計(jì)效率、縮短設(shè)計(jì)周期; 準(zhǔn)確、全面地模擬和分析系統(tǒng); 提高產(chǎn)品和技術(shù)的設(shè)計(jì)質(zhì)量; 降低設(shè)計(jì)成本; 充分發(fā)揮設(shè)計(jì)人員的創(chuàng)造性; 降低干擾因素的影響,集中注意于關(guān)鍵問(wèn)題; 優(yōu)化系統(tǒng)和參數(shù)的設(shè)計(jì)1.2 計(jì)算機(jī)仿真能完成什么任務(wù)? 動(dòng)態(tài)系統(tǒng)的仿真分析; 參數(shù)的優(yōu)化; 極限參數(shù)的設(shè)計(jì); 環(huán)境參數(shù)對(duì)系統(tǒng)性能的影響; 突發(fā)或偶發(fā)事件的模擬; 電子設(shè)計(jì)自動(dòng)化(Electronic Design Automation

6、)1.3 計(jì)算機(jī)仿真技術(shù)的關(guān)鍵 數(shù)值計(jì)算算法; 電路數(shù)學(xué)模型建立的模塊化; 不同應(yīng)用軟件間的數(shù)據(jù)共享; 仿真計(jì)算的效率和準(zhǔn)確性; 混合系統(tǒng)的建模和仿真; 仿真結(jié)果的可視化;1.4 仿真軟件的發(fā)展?fàn)顩r 現(xiàn)代仿真軟件的特點(diǎn):功能強(qiáng)大的數(shù)學(xué)軟件包作為計(jì)算引擎、交互式的編程方式、友好的圖形界面、豐富的模型資源和良好的程序接口等;早期仿真語(yǔ)言和程序早期數(shù)學(xué)軟件包現(xiàn)代的仿真軟件1.5 電子設(shè)計(jì)自動(dòng)化的主要應(yīng)用領(lǐng)域 EDA的主要應(yīng)用領(lǐng)域包括:集成電路設(shè)計(jì)模擬電路仿真動(dòng)態(tài)系統(tǒng)的仿真 EDA主要軟件及特點(diǎn):Protel、Pspice、Saber、Matlab1.6 計(jì)算機(jī)仿真的基本步驟 計(jì)算機(jī)仿真過(guò)程包括分析、

7、建模、計(jì)算和驗(yàn)證; 模型的調(diào)試和計(jì)算主要依靠仿真軟件的設(shè)計(jì)和使用; 驗(yàn)證過(guò)程非常重要; 人為的干預(yù)和控制對(duì)仿真的效果有很大的影響;123456ABCD654321DCBATitleNumberRevisionSizeBDate:15-Apr-2003Sheet of File:G:個(gè) 人 文 檔 學(xué) 校 教 案 _計(jì) 算 機(jī) 控 制 技 術(shù) 計(jì) 算 機(jī) 控 制 技 術(shù) .ddbDrawn By:系統(tǒng)和任務(wù)分析建立系統(tǒng)的仿真模型模型的調(diào)試與計(jì)算仿真結(jié)果的驗(yàn)證1.7 計(jì)算機(jī)仿真設(shè)計(jì)的原則 “分級(jí)仿真”原則:對(duì)系統(tǒng)的分析應(yīng)根據(jù)任務(wù)的不同采用不同的仿真模型或算法,合理簡(jiǎn)化系統(tǒng),突出問(wèn)題的關(guān)鍵; “準(zhǔn)確

8、度與速度合理兼顧”原則:在仿真的不同階段合理調(diào)整對(duì)準(zhǔn)確度和速度的要求,提高仿真效率; “可信驗(yàn)證”原則:所有仿真結(jié)果應(yīng)有可信的驗(yàn)證方法或依據(jù);第二章 Matlab和Simulink簡(jiǎn)介 Matlab和Simulink簡(jiǎn)介 MATLAB Installation MATLAB Desktop Array Scripts and Functions Simulink交互式仿真環(huán)境 Solver S-Function2.0 Matlab和Simulink簡(jiǎn)介 Matlab是集數(shù)值計(jì)算、符號(hào)運(yùn)算和圖形處理功能于一身的超級(jí)科學(xué)計(jì)算語(yǔ)言; 與其它計(jì)算語(yǔ)言相比,Matlab在功能、開(kāi)放性和易學(xué)性等方面獨(dú)占鰲

9、頭; Matlab的核心是數(shù)值計(jì)算,Simulink是建立系統(tǒng)框圖和仿真的環(huán)境;* Battery(s)V0 43 0 DC 15V; V1 39 0 DC 15V; *DISCHARGEV_0 41 0 PULSE(-15 15 196ms 10us 10us 20ms 200ms); *OFFSETV_1 5 0 PULSE(5 -5.7 150ms 10us 10us 50ms 200ms); *PIBIASV_2 1 0 PULSE(10 -10 190ms 2us 2us 10ms 200ms); * Misc.TRAN 10us 210ms 0s 10ms UIC語(yǔ)句方式框圖方式2

10、.1 MATLAB Installation The main Products of Matlab for modeling and simulating dynamical systems:MatlabSymbolic MathSimulinkControl System2.2 MATLAB Desktop Command Window(指令窗) Command History(歷史指令窗) Launch Pad(交互界面分類目錄窗) Help Browser(幫助瀏覽器) Current Directory Browser(當(dāng)前目錄瀏覽器) Workspace Browser(工作空間瀏

11、覽器) Array Editor(內(nèi)存數(shù)組瀏覽器) Editor/Debugger(M文件編輯/調(diào)試器)Launch PadCurrent Directory BrowserCommand Window名 稱標(biāo)點(diǎn)作 用空格作為變量之間的分隔符;數(shù)組元素分隔符;逗號(hào),用作要顯示結(jié)果的指令與下一指令間的分隔;作為變量之間的分隔符;數(shù)組元素分隔符;黑點(diǎn).小數(shù)點(diǎn)分號(hào);用于指令結(jié)尾表示不顯示結(jié)果;用作數(shù)組的行間分隔符冒號(hào):用于冒號(hào)生產(chǎn)法產(chǎn)生一維數(shù)組;(用于數(shù)組參見(jiàn)數(shù)值數(shù)組部分)注釋號(hào)%之后的部分被視為注釋單引號(hào) 字符串引述符圓括號(hào)( )在數(shù)組援引時(shí)使用;函數(shù)指令輸入宗量列表時(shí)使用方括號(hào) 輸入數(shù)組時(shí)使用;

12、函數(shù)指令輸出宗量列表時(shí)使用花括號(hào) 元胞數(shù)組引述符下連號(hào)_作為變量、函數(shù)或文件名中的連字符續(xù)行號(hào)所有符號(hào)必須在英文狀態(tài)下輸入Matlab常用標(biāo)點(diǎn)的功能2.3 Array Array(數(shù)組)的基本概念 數(shù)組在Matlab仿真計(jì)算中的應(yīng)用 Numeric Array(數(shù)值數(shù)組) 數(shù)值元素的標(biāo)識(shí) Character Array(字符串?dāng)?shù)組) Cell Array(元胞數(shù)組) Structure Array(架構(gòu)數(shù)組)2.3.1 Array(數(shù)組)的基本概念 MATLAB works with only a single objectthe array(數(shù)組)。 數(shù)組:一組數(shù)組成的長(zhǎng)方陣列。Its ty

13、peIts dimensionsIts contentThe data associated with this arrayIf numeric,whether the variable is real or complexIf a structure,the number of fields and field names數(shù)組與矩陣的區(qū)別 矩陣:作為一種變換或映射算子的體現(xiàn),矩陣有著明確而嚴(yán)格的數(shù)學(xué)規(guī)則; 數(shù)組:Matlab設(shè)置數(shù)組的目的主要是為了簡(jiǎn)化數(shù)據(jù)的管理和操作、使指令的形式更加自然、程序的運(yùn)行更加有效; Matlab中對(duì)數(shù)組的計(jì)算實(shí)際上是對(duì)數(shù)組中每個(gè)元素平等地施加同樣地操作;2.3.

14、2 數(shù)組在Matlab仿真計(jì)算中的應(yīng)用 Matlab中數(shù)據(jù)的存放和處理均采用數(shù)組; Matlab中的數(shù)組主要分為:Numeric Array,Character Array,Cell Array, Structure Array Character Array可用于仿真結(jié)果和過(guò)程的可視化; Structure Array可用于與Simulink交換信息,包括仿真參數(shù)的設(shè)定、結(jié)果的獲取和處理等;2.3.3 Numeric Array(數(shù)值數(shù)組) 數(shù)值數(shù)組是Matlab中最基本地?cái)?shù)組形式; 數(shù)值數(shù)組分實(shí)數(shù)數(shù)組和復(fù)數(shù)數(shù)組; A=1 2 3 4,5 6 7 8A = 1 2 3 4 5 6 7 8 A

15、=1 2 3 4;5 6 7 8A = 1 2 3 4 5 6 7 8 A*4ans = 4 8 12 16 20 24 28 32 2.3.4 數(shù)組元素的標(biāo)識(shí) “全下標(biāo)”標(biāo)識(shí) “單下標(biāo)”標(biāo)識(shí) A(4)ans = 6 A(1,4)ans = 4 A(2,3)=0; AA = 1 2 3 4 5 6 0 8A = 1 2 3 4 5 6 7 8單下標(biāo)全下標(biāo)冒號(hào)的使用 j:kis the same as j,j+1,.,k j:i:kis the same as j,j+i,j+2i, .,k A(:,j)is the j-th column of A A(i,:)is the i-th row

16、of A2.3.5 Character Array(字符串?dāng)?shù)組) 字符串?dāng)?shù)組基本元素是字符串。 字符串?dāng)?shù)組可用于計(jì)算過(guò)程和結(jié)果的可視化。 字符串?dāng)?shù)組的直接創(chuàng)建。 利用串操作函數(shù)創(chuàng)建串?dāng)?shù)組。A = The exmaple of the Character Arrays A=1234 ;12345A =1234 12345 A=char(1234,12345)A =1234 12345 轉(zhuǎn)換函數(shù)產(chǎn)生數(shù)碼字符串 Int2str(整數(shù)數(shù)組轉(zhuǎn)換為串?dāng)?shù)組); Num2str(非整數(shù)數(shù)組轉(zhuǎn)換為串?dāng)?shù)組);A=rand(2,4)A =0.9501 0.6068 0.8913 0.4565 0.2311 0.48

17、60 0.7621 0.0185B=num2str(A,2),C=int2str(A)B =0.95 0.61 0.89 0.46 0.23 0.49 0.76 0.019C =1 1 1 0 0 0 1 0class(B),class(C)ans =charans =charclear%清除內(nèi)存中地所有變a=2,w=3;%t=0:0.01:10;%取自變量采樣數(shù)組y=exp(-a*t).*sin(w*t);%計(jì)算函數(shù)值,產(chǎn)生函數(shù)數(shù)組y_max,i_max=max(y);%找最大值的位置t_text=t=,num2str(t(i_max);%生成最大值點(diǎn)的橫坐標(biāo)字符串y_text=y=,num

18、2str(y_max);%生成最大值點(diǎn)的眾坐標(biāo)字符串max_text=char(maximum,t_text,y_text);%生成最大值點(diǎn)的字符串tit=y=exp(-,num2str(a),t)*sin(,num2str(w),t);%plot(t,zeros(size(t),k);%畫縱坐標(biāo)為0的基準(zhǔn)線hold on%plot(t,y,b);%繪制函數(shù)曲線plot(t(i_max),y_max,r.,MarkerSize,20);%標(biāo)注最大值點(diǎn)text(t(i_max)+0.3,y_max+0.05,max_text);%標(biāo)注最大值點(diǎn)的字符串title(tit),xlabel(t),yl

19、abel(y),hold off%標(biāo)注圖名、橫坐標(biāo)名、縱坐標(biāo)名字符串?dāng)?shù)組用于計(jì)算結(jié)果的可視化實(shí)例字符串?dāng)?shù)組用于計(jì)算結(jié)果的可視化實(shí)例2.3.6 Cell Array(元胞數(shù)組) The elements of a cell array are cells, containers that can hold other MATLAB arrays. Creating Cell ArraysCell indexing(元胞外標(biāo)識(shí)):A(1,1) = 1 4 3; 0 5 8; 7 2 9;A(1,2) = Anne Smith;A(2,1) = 3+7i;A(2,2) = -pi:p

20、i/10:pi;A(1,1) = 1 4 3; 0 5 8; 7 2 9;A(1,2) = Anne Smith;A(2,1) = 3+7i;A(2,2) = -pi:pi/10:pi;A = 3x3 double Anne Smith 3.0000+ 7.0000i 1x21 doubleContent indexin(元胞內(nèi)標(biāo)識(shí)):A1,1 = 1 4 3; 0 5 8; 7 2 9;A1,2 = Anne Smith;A2,1 = 3+7i;A2,2 = -pi:pi/10:pi; Obtaining Data from Cell Arrays 調(diào)取元胞數(shù)據(jù)分:元胞的調(diào)取和

21、元胞內(nèi)容的調(diào)取; 元胞地標(biāo)識(shí)分:元胞外標(biāo)識(shí)和元胞內(nèi)標(biāo)識(shí);A1,1ans =1 4 3 0 5 8 7 2 9A1,1(1,2)ans = 4A(1,1)=1 2 3;4 5 6;A(1,1)=2x3 doubleA1,1=1 2 3 4 5 62.3.7 Structure Array(構(gòu)架數(shù)組) The elements of a Structure Array are Structures. Structures are MATLAB arrays with data containers called fields. The fields of a structure can conta

22、in any kind of data. Structure Array的基本組分是架構(gòu)( Structure) ,在Structure以下劃分了域(Field),域可用于存放任何形式的數(shù)據(jù)。 Structure Array的基本結(jié)構(gòu) = John Doe;patient.billing = 127.00;patient.test = 79 75 73; 180 178 177.5; 220 210 205;A Structure ArrayA Structure Building Structure Arrays方法一:直接聲明patien

23、t(2).name = Ann Lane;patient(2).billing = 28.50;patient(2).test = 68 70 68; 118 118 119; 172 170 169;方法二:利用struct指令patient(2)=struct(name,Ann Lane,billing,28.50,test,68 70 68; 118 118 119; 172 170 169)patient = 1x2 struct array with fields:namebillingtest Accessing Data in Structure Arrays 架構(gòu)

24、數(shù)組的存?。杭軜?gòu)域內(nèi)容mypatients = patient(1:2)1x2 struct array with fields: name billing testmypatients(1)ans = name: John Doe billing: 127 test: 3x3 doublestr = patient(2).namestr =Ann Lanepatient(2).testans = 68 70 68 118 118 119 172 170 1692.4 Scripts and Functions Scripts(腳本文件), which do not accept input

25、arguments or return output arguments. They operate on data in the workspace. Functions(函數(shù)文件), which can accept input arguments and return output arguments. Internal variables are local to the function.2.4.1 Scripts When you invoke a script, Matlab simply executes the commands found in the file. Scri

26、pts can operate on existing data in the workspace, or they can create new data on which to operate. Although scripts do not return output arguments, any variables that they create remain in the workspace, to be used in subsequent computations. Scripts在使用Simulink時(shí)的主要作用:作為調(diào)用Simulink模型的外部環(huán)境。2.4.2 Flow

27、Control Scripts中可以使用各種流程控制,用于控制Simulink的調(diào)用或參數(shù)的設(shè)置。 主要的流程控制包括:if statementsswitch statementsfor loopswhile loops if statements 判斷結(jié)構(gòu)if rem(n,2) = 0 M = odd_magic(n)elseif rem(n,4) = 0 M = single_even_magic(n)else M = double_even_magic(n)end switch statements 選擇結(jié)構(gòu) switch (rem(n,4)=0) + (re

28、m(n,2)=0) case 0 M = odd_magic(n) case 1 M = single_even_magic(n) case 2 M = double_even_magic(n) otherwise error(This is impossible) end for loops For循環(huán)for n = 3:32 r(n) = rank(magic(n);end while loops While(條件)循環(huán)while b-a eps*b x = (a+b)/2; fx = x3-2*x-5; if sign(fx) = sign(fa) a = x

29、; fa = fx; else b = x; fb = fx; endend2.4.3 Functions(函數(shù)) Create a Function Call a Functionfunction area=circle(r,s)%CIRCUIT this is keyword of the function% next is comment linesclf; %clear current figure windowsita=0:pi/100:2*pi;y=r*exp(i*sita);plot(y,s);area=pi*r2;circle(2,r)ans = 12.5664 x=circl

30、e(2,b)x= 12.5664Function最典型的應(yīng)用S-Function2.5 Simulink交互式仿真環(huán)境 Simulink,the most widely used software package in academia and industry for modeling and simulating dynamical systems. Interactive,you can change parameters and see what happens immediately. Simulink provides a graphical user interface (GUI

31、). Simulink is practical,it is being used by thousands of engineers around the world. Simulink的基本操作 Modeling Dynamic Systems Simulating Dynamic Systems Modeling and Simulating Discrete Systems2.5.1 Modeling Dynamic Systems Blocks(模塊) States(狀態(tài)) System Functions(仿真運(yùn)行功能) Continuous and Discrete Blocks

32、(連續(xù)和離散系統(tǒng)) Sample Time(采樣時(shí)間) Blocks(模塊) BlocksEach block represents an elementary dynamic system that produces an output. Simulink本身具有比較豐富的Block資源,應(yīng)首先予以考慮。為方便設(shè)計(jì),最好遵照下述命名規(guī)則:u:輸入x:(內(nèi)部)狀態(tài)y:輸出 States(內(nèi)部狀態(tài)) A block that has a state must store previous values of the state to compute its curre

33、nt state. Examples of the blocks that have STATES:Integrator,Unit Delay The Simulink Gain block is an example of a stateless block. System Functions(仿真運(yùn)行功能) 所謂System Functions是指仿真計(jì)算的三個(gè)循環(huán)步驟:1、An output function(輸出):Relates the systems outputs to its inputs, states, and time,y=f(t,x,u)2、An upda

34、te function(離散狀態(tài)刷新): Relates the future values of the systems discrete states to the current time,inputs, and states,xdk+1= f(t,x,u)3、A derivative function(連續(xù)狀態(tài)刷新):Relates the derivatives of the continuous states to time and the present values of the states and inputs,xc= f(t,x,u) Continuous

35、and Discrete Blocks Continuous blocks respond continuously to continuously changing input. Discrete blocks respond to changes in input only at the blocks sample time. Discrete blocks hold their output constant between successive sample time hits. Some blocks can be either continuous or discrete,depe

36、nding on whether they are driven by continuous or discrete blocks.2.5.2 Simulating Dynamic Systems Model Initialization Phase Model Execution Phase Processing at Each Time Step Model Initialization PhaseDuring the initialization phase, Simulink:1、Evaluates the models block parameter expressio

37、ns to determine their values.2、Flattens the model hierarchy by replacing virtual subsystems with the blocks that they contain.3、Sorts the blocks into the order in which they need to be executed during the execution phase.4、Determines signal attributes.5、Determines the sample times.6、Allocates and in

38、itializes memory used to store the current values of each blocks states and outputs. Model Execution Phase Simulink successively computes the states and outputs of the system at intervals from the simulation start time to the finish time, using information provided by the model. The successiv

39、e time points at which the states and outputs are computed are called time steps. The length of time between steps is called the step size. Simulink決定計(jì)算步長(zhǎng)依據(jù):用戶的設(shè)定、離散模塊或系統(tǒng)的采樣時(shí)間、數(shù)值計(jì)算的誤差。 Processing at Each Time Step At each time step, Simulink1、Updates the outputs of the models blocks in sorted

40、 order.2、Updates the states of the models blocks in sorted order.3、Optionally checks for discontinuities in the continuous states of blocks.4、Computes the time for the next time step.2.5.3 Modeling and Simulating Discrete Systems Discrete Blocks Sample Time Purely Discrete Systems Multirate Systems

41、Determining Step Size for Discrete Systems Sample Time Propagation Invariant Constants Mixed Continuous and Discrete Systems Discrete Blocks Each of the discrete blocks hasA built-in sampler at its inputA zero-order hold at its output Sample Time The Sample time parameter sets the samp

42、le time at which a discrete blocks states are updated. Specify an offset time (or skew) by specifying a two-element vector in this field. Cannot change the sample time of a block while a simulation is running. Purely Discrete Systems & Multirate Systems Purely Discrete Systems:系統(tǒng)中所有模塊都按單一

43、的采樣率進(jìn)行工作. Multirate Systems:系統(tǒng)中的模塊采用不同的采樣率進(jìn)行工作. Determining Step Size for Discrete Systems The fundamental sample time of a discrete system is the greatest integral divisor of the systems actual sample times. You can direct Simulink to use either a fixed-step or a variable-step discrete solve

44、r to solve a discrete system. Mixed Continuous and Discrete Systems Mixed continuous and discrete systems are composed of both sampled and continuous blocks. For most mixed continuous and discrete systems, the Runge-Kutta variable step methods, ode23 and ode45, are superior to the other metho

45、ds in terms of efficiency and accuracy. Due to discontinuities associated with the sample and hold of the discrete blocks, the ode15s and ode113 methods are not recommended for mixed continuous and discrete systems.2.6 Solver(解算控制) The Solver pane allows you to:Set the simulation start and stop time

46、sChoose the solver and specify its parametersSelect output options2.7 Data Exchange Within Simulink and Workspace Workspace I/O Pane-You can direct simulation output to workspace variables and get input and initial states from the workspace.From Workspace Block & To Workspace Block2.8 S-Function What Is an

溫馨提示

  • 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)論