Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas


Simulink Tutorial, Notas de estudo de Engenharia Elétrica

apostila de Matlab

Tipologia: Notas de estudo

Antes de 2010

Compartilhado em 29/04/2009

carlos-santos-oliveira-1
carlos-santos-oliveira-1 🇧🇷

4.7

(6)

12 documentos

1 / 4

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
Simulink Tutorial
University of Texas, Austin
VLSI Communication Systems
Spring 2005
Disclaimer: Tools are made to be played with
Overview:
Simulink is a software add-on to Matlab used for simulating dynamic systems – governed by a set of differential
equations for continuous time and a set of difference equations for discrete time systems. It uses the powerful and
extensive numerical analysis capability of Matlab. Typically, the Matlab ode or pde solvers are used to solve sets of
linear and nonlinear ordinary differential equations. The dataflow is modeled by connecting standard building blocks
available in the Simulink libraries and some enhanced toolboxes e.g. DSPs, Neural Net.
Simulink supports modeling at different levels of abstractions thereby facilitating evaluation of
architectural level tradeoffs for complex systems.
Starting Simulink:
1. Start Matlab, by double clicking on the Matlab icon or typing Matlab <Enter> from terminal.
2. In the Matlab command window, type Simulink <Enter>
3. Select New > Model from the File menu. This creates a new workspace where the block diagram for the
system will be created.
Given below is a snapshot of the Simulink library browser.
pf3
pf4

Pré-visualização parcial do texto

Baixe Simulink Tutorial e outras Notas de estudo em PDF para Engenharia Elétrica, somente na Docsity!

Simulink Tutorial University of Texas, Austin VLSI Communication Systems Spring 2005

Disclaimer: Tools are made to be played with

Overview:

Simulink is a software add-on to Matlab used for simulating dynamic systems – governed by a set of differential equations for continuous time and a set of difference equations for discrete time systems. It uses the powerful and extensive numerical analysis capability of Matlab. Typically, the Matlab ode or pde solvers are used to solve sets of linear and nonlinear ordinary differential equations. The dataflow is modeled by connecting standard building blocks available in the Simulink libraries and some enhanced toolboxes e.g. DSPs, Neural Net.

Simulink supports modeling at different levels of abstractions thereby facilitating evaluation of architectural level tradeoffs for complex systems.

Starting Simulink:

  1. Start Matlab, by double clicking on the Matlab icon or typing Matlab from terminal.
  2. In the Matlab command window, type Simulink
  3. Select New > Model from the File menu. This creates a new workspace where the block diagram for the system will be created.

Given below is a snapshot of the Simulink library browser.

Popular library components:

Sources and sinks Discrete and Continuous time systems Mathematical Operator Logic operators User-defined functions Subsystem Simulink extras

Creating models in Simulink:

  1. “drag” a block icon from the library browser window to the current workspace for the model (Alternatively select the block and select Edit – Copy, then go to the new workspace and select Edit – Paste). Repeat this for all the submodules of the system.
  2. “connect” these icons together by drawing lines connecting them using the left-most mouse button (hold the button down and drag the mouse to draw a line) An arrow will appear to show the direction of the signal flow.
  3. Openthe icons (by double clicking on them with the left-most mouse button) and set the values of the various parameters ; e.g. a sine wave generating source comes with parameters like amplitude, frequency, initial phase etc.
  4. Select the parameter field from the simulation menu (in the block diagram window) and set the proper integration details (min and max stepsizes, start and stop integration times, integration code, etc.). Finally, select start from the simulation menu to start the simulation.

Notes:

  1. A parameter of paramount importance while simulating using Simulink is the simulation time step whose value is determined by the fastest changing components in the simulated system. The parameter is controlled automatically by the internal engine but for sampled time system it is often good to come up with the appropriate settings.
  2. Useful command for Simulink invoked in batch-processing mode: sim can be used in an executable m-file to run a model.
  3. Most of the Simulink blocks come with their own parameters which can be given parametric values being passed form a standard m-file. This helps batch mode simulations by redefining the values across iterations from within a control loop.

A template m-file for such a purpose:

%use % sign for comments

clc close all clear

initialize

BIT_PER=10e-8 %initializing the parameters TX_RX_DIST= CH_BW=2e NOISE_POW=(1e-5)^2/(1/noise_sample_time) NUM_SAMPLES=

sim bpsk_txrx %simulating the model

error=abs(MOD_IN-DEMOD_OUT); BER=sum(error)/NUM_SAMPLES

Transport delay block at receiver is used to prevent sampling the integrator output at the instant it is reset periodically in each bit period slot. The block at the transmitter side is used to time align the input and output samples.

Tips For Matlab and Simulink:

lookfor and help <command_name> are the MOST IMPORTANT to become familiar with Matlab

Simulink :

The most important thing is not to trust any of the results unless they are convincing - first step in debugging is to check the settings for the "simulation configuration parameters" and the settings for all the Simulink block models’ intrinsic parameters.