【正文】
algorithm, in practice, often find that some algorithm with ordinary SIMULINK blocks is not easy to build, which you can use the SIMULINK Sfunction format support, Sfunction as an extension tool for SIMULINK has procedures format, can be used MATLAB, C / C + +, Fortran and other languages. However, in realtime simulation of the process need to SIMULINK models into C code and generates separate files, only the C / C + + language39。 and C + + code tool. For signal processing, control system design and other applications, MATLAB toolbox providing a range of advanced technology. Toolbox far beyond the scope of provision of some basic algorithms: they provide a learning, research, innovation and cuttingedge theory and technology arena. Algorithm toolbox to provide a neural work toolbox, optimization toolbox, system identification toolbox, robust control toolbox, model predictive control toolbox, the control system toolbox, fuzzy logic toolbox. (3) Data analysis and visualization, through the MATLAB software, users can analyze all types of data, including signal, image, polynomials, time course, data and multivariable linear systems. From the analysis results can be summed up as a model for the further development of the algorithm and the base. In addition, users can quickly convert the code fragment and knowledge can be reused in automated analysis routines, no variable declarations and the definition of dimension, can write programs quickly. Based on MATLAB provides a convenient data access tools. For example, the data acquisition toolbox allows users to send realtime measurement data directly into MATLAB for analysis, database toolkit to allow users to access consistent with the ODBC and JDBC in the database, while M c and the Fortran language documents and procedures in handling text and binary file I / O function, then allow the user to handle any format. 17 And related MATLAB toolbox contains a scientific puting need of professional graphics. The raw data from the twodimensional curve to the contour map with markers and interactive graphical user interface, these tools provide a model visualized capabilities to help users understand plex systems. In particular, provides a MATLABbased threedimensional scalar and vector visualization capabilities, including display equivalence face and flow diagram. This capability enables scientists and engineers to a large number of plex and multidimensional data visualization. MATLAB realtime simulation environment, RTW is to provide a realtime based on MATLAB other ponents of the software for seamless connection, not only to meet the designers in the system concept and program design needs, the technology for the system or perform different functions in realtime operating system provides the convenience of experiments, and for implementation of concurrent engineering to create a good environment. It directly from the SIMULINK simulation model produces optimized, portable and personalized code, and automatically generate a variety of configurations depending on the target under the program environment, the hardware running dynamic system model also supports modelbased debug. Realtime using the RTW of the design of test hardware, users can shorten the development cycle and reduce costs. When the user model in SIMULINK environment and get satisfactory simulation results, can be a RTW with the goal of rapid prototyping (such as RTWT target) joint use. The goal of rapid prototyping of physical systems and users connected. Users can use the SIMULINK model as the interface to connect the physical target to plete system testing. RTW implementation mechanism is a plex process, where only from the RTW process automated building applications that were analyzed. RTW generated application process diagram (model for the establishment 18 of the SIMULINK name). RTW construction application process by an Mfile in order to control for most of the target, the default mand is . The process is as follows: 1. model, first analyzes the SIMULINK model to analyze the process includes the following main tasks (1) Numerical simulation parameters and molding parameters。循環(huán)仿真階段 mdlUpdate 模塊計算更新系統(tǒng)當(dāng)前狀態(tài)變量的值。 Simulink 通過循環(huán)調(diào)用模型中的各模塊的特定方法來完成諸如計算輸出值、更新離散狀態(tài)值、計算連 續(xù)狀態(tài)微分等任務(wù)。應(yīng)用 Simulink 模型作為控制器的可視化界面,不僅能讓用戶知道控制器具體環(huán)節(jié)的動態(tài)細(xì)節(jié),而且能讓用戶清晰地了解控制器中各器件、各子系統(tǒng)的信息交換,掌握各部分間的交互影響,為進(jìn)一步分析改善控制器提供了便利條件。 過程控制算法的實現(xiàn)方法, 一個通用的仿真平臺,必須能夠方便的讓用戶加入自己的控制算法或控制系統(tǒng)設(shè)計方案,此過程控制混合仿真平臺提供 了以下三種控制算法的嵌入方法: 應(yīng)用 Simulink 提供的模塊搭建控制器模型, Simulink 提供了各種各樣的模塊集合,在 Simulink 提供的圖形用戶界面上,只要進(jìn)行簡單拖拉操作,就可利用這些模塊集合構(gòu)造出復(fù)雜的控制器模型。 Simulink 通過發(fā)送一個含有參數(shù)信息的訊息初始化下載操作。 當(dāng)框