simulink

35
Overview Simulink ® software models, simulates, and analyzes dynamic systems. It enables you to pose a question about a system, model the system, and see what happens. With Simulink, you can easily build models from scratch, or modify existing models to meet your needs. Simulink supports linear and nonlinear systems, modeled in continuous time, sampled time, or a hybrid of the two. Systems can also be multirate — having different parts that are sampled or updated at different rates. Thousands of scientists and engineers around the world use Simulink to model and solve real problems in a variety of industries, including: Aerospace and Defense Automotive Communications Electronics and Signal Processing Medical Instrumentation Back to Top Tool for Model-Based Design With Simulink, you can move beyond idealized linear models to explore more realistic nonlinear models, factoring in friction, air resistance, gear slippage, hard stops, and the other things that describe real-world phenomena. Simulink turns your computer into a laboratory for modeling and analyzing systems that would not be possible or practical otherwise. Whether you are interested in the behavior of an automotive clutch system, the flutter of an airplane wing, or the effect of the monetary supply on the economy, Simulink provides you with the tools to model and simulate almost any real-world problem. Simulink also provides demos that model a wide variety of real-world phenomena (see Simulink Demo Models ).

Transcript of simulink

Page 1: simulink

Overview

Simulink® software models, simulates, and analyzes dynamic systems. It enables you to pose a question about a system, model the system, and see what happens.

With Simulink, you can easily build models from scratch, or modify existing models to meet your needs. Simulink supports linear and nonlinear systems, modeled in continuous time, sampled time, or a hybrid of the two. Systems can also be multirate — having different parts that are sampled or updated at different rates.

Thousands of scientists and engineers around the world use Simulink to model and solve real problems in a variety of industries, including:

Aerospace and Defense Automotive Communications Electronics and Signal Processing Medical Instrumentation

  Back to Top

Tool for Model-Based Design

With Simulink, you can move beyond idealized linear models to explore more realistic nonlinear models, factoring in friction, air resistance, gear slippage, hard stops, and the other things that describe real-world phenomena. Simulink turns your computer into a laboratory for modeling and analyzing systems that would not be possible or practical otherwise.

Whether you are interested in the behavior of an automotive clutch system, the flutter of an airplane wing, or the effect of the monetary supply on the economy, Simulink provides you with the tools to model and simulate almost any real-world problem. Simulink also provides demos that model a wide variety of real-world phenomena (see Simulink Demo Models).

Simulink provides a graphical user interface (GUI) for building models as block diagrams, allowing you to draw models as you would with pencil and paper. Simulink also includes a comprehensive block library of sinks, sources, linear and nonlinear components, and connectors. If these blocks do not meet your needs, however, you can also create your own blocks. The interactive graphical environment simplifies the modeling process, eliminating the need to formulate differential and difference equations in a language or program.

Models are hierarchical, so you can build models using both top-down and bottom-up approaches. You can view the system at a high level, then double-click blocks to see increasing levels of model detail. This approach provides insight into how a model is organized and how its parts interact.

Page 2: simulink

  Back to Top

Tool for Simulation

After you define a model, you can simulate it, using a choice of mathematical integration methods, either from the Simulink menus or by entering commands in the MATLAB® Command Window. The menus are convenient for interactive work, while the command line is useful for running a batch of simulations (for example, if you are doing Monte Carlo simulations or want to apply a parameter across a range of values).

Using scopes and other display blocks, you can see the simulation results while the simulation runs. You can then change many parameters and see what happens for "what if" exploration. The simulation results can be put in the MATLAB workspace for postprocessing and visualization.

  Back to Top

Tool for Analysis

Model analysis tools include linearization and trimming tools, which can be accessed from the MATLAB command line, plus the many tools in MATLAB and its application toolboxes. Because MATLAB and Simulink are integrated, you can simulate, analyze, and revise your models in either environment at any point.

Page 3: simulink

  Back to Top

How Simulink Software Interacts with the MATLAB Environment

Simulink software is tightly integrated with the MATLAB environment. It requires MATLAB to run, depending on it to define and evaluate model and block parameters. Simulink can also utilize many MATLAB features. For example, Simulink can use the MATLAB environment to:

Define model inputs. Store model outputs for analysis and visualization. Perform functions within a model, through integrated calls to MATLAB operators and

functions.

  Back to Top

  Was this topic helpful?   

Model-Based Design

Model-Based Design is a process that enables faster, more cost-effective development of dynamic systems, including control systems, signal processing, and communications systems. In Model-Based Design, a system model is at the center of the development process, from requirements development, through design, implementation, and testing. The model is an executable specification that is continually refined throughout the development process. After model development, simulation shows whether the model works correctly.

When software and hardware implementation requirements are included, such as fixed-point and timing behavior, you can automatically generate code for embedded deployment and create test benches for system verification, saving time and avoiding the introduction of manually coded errors.

Model-Based Design allows you to improve efficiency by:

Using a common design environment across project teams Linking designs directly to requirements Integrating testing with design to continuously identify and correct errors Refining algorithms through multidomain simulation Automatically generating embedded software code Developing and reusing test suites Automatically generating documentation Reusing designs to deploy systems across multiple processors and hardware targets

  Back to Top

Page 4: simulink

Modeling Process

There are six steps to modeling any system:

1. Defining the System2. Identifying System Components3. Modeling the System with Equations4. Building the Simulink Block Diagram5. Running the Simulation6. Validating the Simulation Results

You perform the first three steps of this process outside of the Simulink software before you begin building your model.

Defining the System

The first step in modeling a dynamic system is to fully define the system. If you are modeling a large system that can be broken into parts, you should model each subcomponent on its own. Then, after building each component, you can integrate them into a complete model of the system.

For example, the demo model used later in this guide models the heating system of a house. This system can be broken down into three main parts:

Heater subsystem Thermostat subsystem Thermodynamic model subsystem

The most effective way to build a model of this system is to consider each of these subsystems independently.

Identifying System Components

The second step in the modeling process is to identify the system components. Three types of components define a system:

Parameters — System values that remain constant unless you change them States — Variables in the system that change over time Signals — Input and output values that change dynamically during the simulation

In Simulink, parameters and states are represented by blocks, while signals are represented by the lines that connect blocks.

For each subsystem that you identified, ask yourself the following questions:

How many input signals does the subsystem have? How many output signals does the subsystem have? How many states (variables) does the subsystem have? What are the parameters (constants) in the subsystem? Are there any intermediate (internal) signals in the subsystem?

Page 5: simulink

Once you have answered these questions, you should have a comprehensive list of the system components, and are ready to begin modeling the system.

Modeling the System with Equations

The third step in modeling a system is to formulate the mathematical equations that describe the system.

For each subsystem, use the list of system components you identified to describe the system mathematically. Your model may include:

Algebraic equations Logical equations Differential equations, for continuous systems Difference equations, for discrete systems

You use these equations to create the block diagram in Simulink.

Building the Simulink Block Diagram

After you have defined the mathematical equations that describe each subsystem, you can begin building a block diagram of your model in Simulink.

Build the block diagram for each of your subcomponents separately. After you have modeled each subcomponent, you can then integrate them into a complete model of the system.

See Creating a Simple Model for more information on building the block diagram.

Running the Simulation

After you build the Simulink block diagram, you can simulate the model and analyze the results.

Simulink allows you to interactively define system inputs, simulate the model, and observe changes in behavior. This allows you to quickly evaluate your model.

See Simulating the Simple Model for more information on running a simulation.

Validating the Simulation Results

Finally, you must validate that the model accurately represents the physical characteristics of the system.

You can use the linearization and trimming tools available from the MATLAB command line, plus the many tools in MATLAB and its application toolboxes to analyze and validate your model.

Opening the Simulink Library Browser

Page 6: simulink

Your MATLAB environment must be running before you can open the Simulink Library Browser. You start Simulink software from within MATLAB.

1. Start MATLAB. For more information, see Starting a MATLAB Session in the MATLAB Getting Started Guide.

2. In the MATLAB Command Window, enter

simulink

The Simulink Library Browser opens.

Note   You can also open the Simulink Library Browser:

From the MATLAB toolbar, click the Simulink icon From the MATLAB task bar, click the Start button, and then select Simulink

> Library Browser

  Back to Top

Creating a New Model

You can create a new model from the Simulink Library Browser.

Page 7: simulink

1. From the Simulink Library Browser menu, select File > New > Model.

A new model opens in the Simulink model window.

2. Select File > Save > .

The Save As dialog box opens.

3. In the File name box, enter a name for your model, and then click Save.

The software saves your model with the file extension .mdl.

  Back to Top

Opening an Exiting Model

You can open an existing Simulink model from the Simulink Library Browser.

1. From the Simulink Library Browser menu, select File > Open.

The Open dialog box opens.

2. Select the model (.mdl file) you want to open, and then click Open.

Simulink Library Browser

The Simulink Library Browser displays the block libraries installed on your computer. You build models by copying blocks from a library into a model window.

Page 8: simulink

Simulink Library Browser

The selected model opens in the Simulink model window.

lock Connections in the Model Window

After you add blocks to the model window, you must connect them. The connecting lines represent the signals within the model.

Most blocks have angle brackets on one or both sides. These angle brackets represent input and output ports:

The > symbol pointing into a block is an input port. The > symbol pointing out of a block is an output port.

  Back to Top

Drawing Lines Between Blocks

After you add blocks to your model. you can connect the blocks by drawing lines between output ports and input ports. For how to add blocks to the model in this example, see Adding Blocks to the Model.

1. Position the mouse pointer over the output port on the right side of the Sine Wave block.

The pointer changes to a cross hairs (+) shape while over the port.

2. Drag a line from the output port to the top input port of the Mux block.

While you hold the mouse button down, the connecting line is dashed. The pointer changes to a double-lined cross hairs as it approaches the input port of the Mux block.

Page 9: simulink

3. Release the mouse button over the output port.

The blocks connect with an arrow that indicates the direction of signal flow.

4. Drag a line from the output port of the Integrator block to the bottom input port on the Mux block.

The Integrator block connects to the Mux block with a signal line.

5. Select the Mux block, hold down the Ctrl key, and then select the Scope block.

A line automatically draws between the blocks to connect them.

Note   The Ctrl+click shortcut is useful when you are connecting widely separated blocks, or when working with complex models.

The model should now look similar to the following figure.

  Back to Top

Drawing a Branch Line

Page 10: simulink

The model is almost complete, but one connection is missing. To finish the model, you must connect the Sine Wave block to the Integrator block.

This final connection is somewhat different from the other three connections, which all connect output ports to input ports. Because the output port of the Sine Wave block already has a connection, you must connect this existing line to the input port of the Integrator block. The new line, called a branch line, carries the same signal that passes from the Sine Wave block to the Mux block.

1. Position the mouse pointer on the line between the Sine Wave and the Mux block.

2. Hold down the Ctrl key, and then drag a line to the input port of the Integrator block input port.

This step adds a connection to the existing line and draws a line between the connection and the input port of the Integrator block.

3. From the File menu, click Save.

The model is now complete. It should look similar to the following figure.

Now you can simulate the model as described in Simulating the Simple Model.

Page 11: simulink

Diode

Implement diode model

Library

Power Electronics

Description

The diode is a semiconductor device that is controlled by its own voltage Vak and current Iak. When a diode is forward biased (Vak > 0), it starts to conduct with a small forward voltage Vf across it. It turns off when the current flow into the device becomes 0. When the diode is reverse biased (Vak < 0), it stays in the off state.

The Diode block is simulated by a resistor, an inductor, and a DC voltage source connected in series with a switch. The switch operation is controlled by the voltage Vak and the current Iak.

The Diode block also contains a series Rs-Cs snubber circuit that can be connected in parallel with the diode device (between nodes A and K).

Page 12: simulink

Dialog Box and Parameters

Resistance Ron

The diode internal resistance Ron, in ohms (Ω). The Resistance Ron parameter cannot be set to 0 when the Inductance Lon parameter is set to 0.

Inductance Lon

The diode internal inductance Lon, in henries (H). The Inductance Lon parameter cannot be set to 0 when the Resistance Ron parameter is set to 0.

Forward voltage Vf

The forward voltage of the diode device, in volts (V).

Initial current Ic

Specifies an initial current flowing in the diode device. It is usually set to 0 in order to start the simulation with the diode device blocked. If the Initial Current IC parameter is set to a value greater than 0, the steady-state calculation considers the initial status of the diode as closed.

Page 13: simulink

Initializing all states of a power electronic converter is a complex task. Therefore, this option is useful only with simple circuits.

Snubber resistance Rs

The snubber resistance, in ohms (Ω). Set the Snubber resistance Rs parameter to inf to eliminate the snubber from the model.

Snubber capacitance Cs

The snubber capacitance in farads (F). Set the Snubber capacitance Cs parameter to 0 to eliminate the snubber, or to inf to get a resistive snubber.

Show measurement port

If selected, adds a Simulink output to the block returning the diode current and voltage.

Inputs and Outputsm

The Simulink output of the block is a vector containing two signals. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library.

Signal Definition Units

1 Diode current A

2 Diode voltage V

Assumptions and Limitations

The Diode block implements a macro model of a diode device. It does not take into account either the geometry of the device or the complex physical processes underlying the state change [1]. The leakage current in the blocking state and the reverse-recovery (negative) current are not considered. In most circuits, the reverse current does not affect converter or other device characteristics.

Depending on the value of the inductance Lon, the diode is modeled either as a current source (Lon > 0) or as a variable topology circuit (Lon = 0). The Diode block cannot be connected in series with an inductor, a current source, or an open circuit, unless its snubber circuit is in use. See Improving Simulation Performance for more details on this topic.

Use the powergui block to specify either continuous simulation or discretization of your electrical circuit containing diodes. When using a continuous model, the ode23tb solver with a relative tolerance of 1e-4 is recommended for best accuracy and simulation speed.

The inductance Lon is forced to 0 if you choose to discretize your circuit.

Page 14: simulink

Example

The power_diode demo illustrates a single pulse rectifier consisting of a Diode block, an RL load, and an AC Voltage source block.

Simulation produces the following results.

Thyristor

Implement thyristor model

Library

Power Electronics

Description

The thyristor is a semiconductor device that can be turned on via a gate signal. The thyristor model is simulated as a resistor Ron, an inductor Lon, and a DC voltage source representing the forward voltage Vf, connected in series with a switch. The switch is controlled by a logical signal depending on the voltage Vak, the current Iak, and the gate signal g.

Page 15: simulink

The Thyristor block also contains a series Rs-Cs snubber circuit that can be connected in parallel with the thyristor device.

The static VI characteristic of this model is shown below.

The thyristor device turns on when the anode-cathode Vak voltage is greater than Vf and a positive pulse signal is applied at the gate input (g > 0). The pulse height must be greater than 0 and last long enough to allow the thyristor anode current to become larger than the latching current Il.

The thyristor device turns off when the current flowing in the device becomes 0 (Iak = 0) and a negative voltage appears across the anode and cathode for at least a period of time equal to the turnoff time Tq. If the voltage across the device becomes positive within a period of time less than Tq, the device turns on automatically even if the gate signal is low (g = 0) and the anode current is less than the latching current. Furthermore, if during turn-on, the device current amplitude stays below the latching current level specified in the dialog box, the device turns off after the gate signal level becomes low (g = 0).

The turnoff time Tq represents the carrier recovery time: it is the time interval between the instant the anode current has decreased to 0 and the instant when the thyristor is capable of withstanding positive voltage Vak without turning on again.

Dialog Box and Parameters

Thyristor Model and Detailed Thyristor Model

In order to optimize simulation speed, two models of thyristors are available: the thyristor model and the detailed thyristor model. For the thyristor model, the latching current Il and recovery time Tq are assumed to be 0.

Page 16: simulink

Resistance Ron

The thyristor internal resistance Ron, in ohms (Ω). The Resistance Ron parameter cannot be set to 0 when the Inductance Lon parameter is set to 0.

Inductance Lon

The thyristor internal inductance Lon, in henries (H). The Inductance Lon parameter is normally set to 0 except when the Resistance Ron parameter is set to 0.

Forward voltage Vf

The forward voltage of the thyristor, in volts (V).

Initial current Ic

When the Inductance Lon parameter is greater than 0, you can specify an initial current flowing in the thyristor. It is usually set to 0 in order to start the simulation with the thyristor blocked.

You can specify an Initial current Ic value corresponding to a particular state of the circuit. In such a case all states of the linear circuit must be set accordingly.

Page 17: simulink

Initializing all states of a power electronic converter is a complex task. Therefore, this option is useful only with simple circuits.

Snubber resistance Rs

The snubber resistance, in ohms (Ω). Set the Snubber resistance Rs parameter to inf to eliminate the snubber from the model.

Snubber capacitance Cs

The snubber capacitance in farads (F). Set the Snubber capacitance Cs parameter to 0 to eliminate the snubber, or to inf to get a resistive snubber.

Show measurement port

If selected, add a Simulink output to the block returning the thyristor current and voltage.

Page 18: simulink

Latching current Il

The latching current of the detailed thyristor model, in amperes (A).

Turn-off time Tq

The turnoff time Tq of the detailed thyristor model, in amperes (A).

Inputs and Outputsg

Simulink signal to control the gate of the Thyristor.

m

The Simulink output of the block is a vector containing two signals. You can demultiplex these signals by using the Bus Selector block provided in the Simulink library.

Signal Definition Units

1 Thyristor current A

2 Thyristor voltage V

Assumptions and Limitations

The Thyristor block implements a macro model of the real thyristor. It does not take into account either the geometry of the device or complex physical processes that model the behavior of the device [1, 2]. The forward breakover voltage and the critical value of the derivative of the reapplied anode-cathode voltage are not considered by the model.

Depending on the value of the inductance Lon, the Thyristor block is modeled either as a current source (Lon > 0) or as a variable topology circuit (Lon = 0). The Thyristor block cannot be connected in series with an inductor, a current source, or an open circuit, unless its snubber circuit is in use. See Improving Simulation Performance for more details on this topic.

Use the Powergui block to specify either continuous simulation or discretization of your electrical circuit containing Thyristor blocks. When using a continuous model, the ode23tb solver with a relative tolerance of 1e-4 is recommended for best accuracy and simulation speed.

The inductance Lon is forced to 0 if you choose to discretize your circuit.

Page 19: simulink

Example

In the power_thyristor demo a single-pulse thyristor rectifier is used to feed an RL load. The gate pulses are obtained from a pulse generator synchronized on the source voltage. The following parameters are used:

R   1 Ω

L   10 mH

Thyristor block: Ron 0.001 Ω

  Lon 0 H

  Vf 0.8 V

  Rs 20 Ω

  Cs 4e-6 F

The firing angle is varied by a pulse generator synchronized on the voltage source. Run the simulation and observe the load current and load voltage, as well as the thyristor current and voltage.

Description

matlab is a script that runs the main MATLAB executable on Microsoft Windows platforms. (In this document, the term matlab refers to the script, and MATLAB refers to the main executable). Before actually initiating the execution of MATLAB, it configures the run-time environment by

Determining the MATLAB root directory

Page 20: simulink

Determining the host machine architecture Selectively processing command line options with the rest passed to MATLAB. Setting certain MATLAB environment variables

There are two ways in which you can control the way matlab works:

By specifying command line options By setting environment variables before calling the program

Specifying Options at the Command Line

Options that you can enter at the command line are as follows:

matlab helpOption displays information that matches the specified helpOption argument without starting MATLAB. helpOption can be any one of the keywords shown in the table below. Enter only one helpOption keyword in a matlab statement.

Values for helpOption

Option Description

-help Display matlab command usage.

-h The same as -help.

-? The same as -help.

matlab -automation starts MATLAB as an automation server. The server window is minimized, and the MATLAB splash screen does not display on startup.

matlab -c licensefile starts MATLAB using the specified license file. The licensefile argument can have the form port@host. This option causes MATLAB to ignore the LM_LICENSE_FILE and MLM_LICENSE_FILE environment variables.

matlab -jdb portnumber starts MATLAB, enabling use of the Java debugger. If you specify a port number, the Java debugger uses that port to communicate with MATLAB. You can specify any port number in the range 0-65535 that is not reserved or currently in use by another application on your system. By default, MATLAB uses port 4444. If you are running multiple MATLAB sessions and want to use the Java debugger, be sure to specify a port number.

matlab -logfile filename starts MATLAB and makes a copy of any output to the Command Window in filename. This includes all crash reports.

matlab -nosplash starts MATLAB, but does not display the splash screen during startup.

matlab -noFigureWindows starts MATLAB, but disables the display of any figure windows in MATLAB.

Page 21: simulink

matlab -r "statement" starts MATLAB and executes the specified MATLAB statement. Any required file must be on the MATLAB search path or in the startup directory.

matlab -regserver registers MATLAB as a Component Object Model (COM) server.

matlab -sd "startdir" specifies the startup directory for MATLAB (the current directory in MATLAB after startup). The -sd option has been deprecated. For information about alternatives, see Startup Folder on Windows Platforms.

matlab shieldOption provides the specified level of protection of the address space used by MATLAB during startup on Windows 32–bit platforms. It attempts to help ensure the largest contiguous block of memory available after startup, which is useful for processing large data sets. The shieldOption does this by ensuring resources such as DLLs, are loaded into locations that will not fragment the address space. With shieldOption set to a value other than none, address space is protected up to or after the processing of matlabrc. Use higher levels of protection to secure larger initial blocks of contiguous memory, however a higher level might not always provide a larger size block and might cause startup problems. Therefore, start with a lower level of protection, and if successful, try the next higher level. You can use the memory function after startup to see the size of the largest contiguous block of memory; this helps you determine the actual effect of the shieldOption setting you used. If your matlabrc (or startup.m) requires significant memory, a higher level of protection for shieldOption might cause startup to fail; in that event try a lower level. Values for shieldOption can be any one of the keywords shown in the table below.

Option Description

-shield minimum

This is the default setting. It protects the range 0x50000000 to 0x70000000 during MATLAB startup until just before startup processes matlabrc. It ensures there is at least approximately 500 MB of contiguous memory up to this point.

Start with this, the default value. To use the default, do not specify a shield option upon startup.

If MATLAB fails to start successfully using the default option, -shield minimum, instead use -shield none.

If MATLAB starts successfully with the default value for shieldOption and you want to try to ensure an even larger contiguous block after startup, try using the -shield medium option.

-shield medium

This protects the same range as for minimum, 0x50000000 to 0x70000000, but protects the range until just after startup processes matlabrc. It ensures there is at least approximately 500 MB of contiguous memory up to this point.

If MATLAB fails to start successfully with the -shield medium option, instead use the default option (-shield minimum).

If MATLAB starts successfully with the -shield medium option and you want to try to ensure an even larger contiguous block after startup, try using the -

Page 22: simulink

Option Description

shield maximum option.

-shield maximum

This protects the maximum possible range, which can be up to approximately 1.5 GB, until just after startup processes matlabrc.

If MATLAB fails to start successfully with the -shield maximum option, instead use the -shield medium option.

-shield none

This completely disables address shielding. Use this if MATLAB fails to start successfully with the default (-shield minimum) option.

matlab -singleCompThread limits MATLAB to a single computational thread. By default, MATLAB makes use of the multithreading capabilities of the computer on which it is running.

matlab -unregserver removes all MATLAB COM server entries from the registry.

matlab -wait MATLAB is started by a separate starter program which normally launches MATLAB and then immediately quits. Using this option tells the starter program not to quit until MATLAB has terminated. This option is useful when you need to process the results from MATLAB in a script. Calling MATLAB with this option blocks the script from continuing until the results are generated.

Setting Environment Variables

You can set the following environment variables before starting MATLAB.

Variable Name Description

LM_LICENSE_FILE This variable specifies the License File to use. If you use the -c argument to specify the License File it overrides this variable. The value of this variable can be a list of License Files, separated by semi-colons, or port@host entries.

See Also

matlab (UNIX), mex, userpath

Starting the MATLAB Program on Windows Platforms, and Startup Options in the MATLAB Desktop Tools and Development Environment documentation

 Was this topic helpful?   

 

 

Page 23: simulink

© 1984-2010 The MathWorks, Inc. • Terms of Use • Patents • Trademarks • Acknowledgments

MATLAB Functions

To perform any task within your instrument control application, you must call MATLAB functions from the MATLAB workspace. Among other things, these functions allow you to:

Create instrument objects, which provide a gateway to your instrument's capabilities and allow you to control the behavior of your application.

Connect the object to the instrument. Configure property values. Write data to the instrument, and read data from the instrument. Examine your hardware resources and evaluate your application status.

For a listing of all Instrument Control Toolbox software functions, refer to Functions — Alphabetical List . You can also display the toolbox functions by typing

help instrument

  Back to Top

Interface Driver Adaptor

The interface driver adaptor (or just adaptor) is the link between the toolbox and the interface driver. The adaptor's main purpose is to pass information between the MATLAB workspace and the interface driver. Interface drivers are provided by your instrument vendor. For example, if you are communicating with an instrument using a National Instruments GPIB controller, then an interface driver such as NI-488.2 must be installed on your platform. Note that interface drivers are not installed as part of the Instrument Control Toolbox software.

Instrument Control Toolbox software provides adaptors for the GPIB interface and the VISA standard. The serial port, TCP/IP, and UDP interfaces do not require an adaptor.

Interface Adaptor Name

GPIB advantech, agilent, cec, contec, ics, iotech, keithley, mcc, ni

Serial port N/A

TCP/IP N/A

UDP N/A

VISA standard agilent, ni, tek

Page 24: simulink

As described in Examining Your Hardware Resources, you can list the supported interfaces and adaptor names with the instrhwinfo function. For a list of vendor driver requirements and limitations, refer to Vendor Driver Requirements and Limitations.

Full Wave Rectifier

This demonstration illustrates use of the Ideal Switching Device solution method to simulate a full wave rectifier using ideal diodes.

G. Sybille (Hydro-Quebec)

Contents

Demonstration   

Demonstration

Open the powergui block and click on the Configure parameters button to access the block parameters. The Enable use of ideal switching devices option is selected and it tells SimPowerSystems™ to use the Ideal Switching Device solution for this model.

A convenient way of disabling snubbers of all switches in the model is to select the Disable snubbers in switching devices. Alternatively you can individually disable the snubbers of selected switches by specifying Rs=inf in their block menu.

In order to simulate diodes as ideal switches, the Disable On resistance and Disable Forward voltage options are also selected.

The elimination of the snubbers reduces the circuit stiffness so that you can use a non-stiff solver such as ode45. This solver produces correct results and good simulation speed.

Page 25: simulink

To simulate this circuit with the original SimPowerSystems simulation method, you need to use snubbers across diodes D1 and D2 because these elements are connected in series with inductances (transformer leakage inductances of the two secondary windings and filter inductance L). Otherwise, when you start the simulation SimPowerSystems will prompt an error message. In this case if you attempt to simulate this circuit with specified resistive snubbers (Rs=1e6 ohms) by using the ode45 solver, you will observe a slow simulation speed and numerical oscillations. If you use instead the ode23tb recommended solver, you will observe wrong simulation results unless you use a relative tolerance of 1e-6.

Single-Phase Rectifier

This demonstration illustrates use of the Universal Bridge, Multimeter, and Discrete System blocks

G. Sybille (Hydro-Quebec)

Contents

Circuit Description    Demonstration   

Page 26: simulink

Circuit Description

This system contains two identical circuits showing the operation of a single phase rectifier.

The rectifiers are fed by a 120 V/ 24 V linear transformer. The rectified voltage is filtered by a 100 mH / 200 uF filter and applied to a 5 ohm resistive load. The load voltages are measured by two Voltage Measurement blocks Vd1 and Vd2.

The top circuit (circuit 1) uses four individual diodes connected in a bridge configuration. The currents of diodes 2 and 4 are obtained at the measurement 'm' output of the diode blocks and sent to input 1 of Scope 2 through Selector and Multiplex blocks.

The bottom circuit (circuit 2) is functionally identical to circuit 1, but the circuit assembly is considerably simplified by the use of the Universal Bridge.

Demonstration

Open the Universal Bridge dialog box and notice that in order to obtain a four-diode bridge configuration, the Power Electronic device field has been set to Diodes and that the number of arms has been set to 2. Also, observe that the Measurements field has been set to Device currents, thus allowing measurement of diode currents through the Multimeter block.

Now, double click on the Multimeter block. The four diode currents are listed in the left column. Notice that only currents in diodes 2 and 4 have been selected and transferred in the right column. The number of available signals at the multimeter output (2) is displayed on the block icon.

Open the two scopes and start the simulation. Compare the two load voltages Vd1 and Vd2 which are superimposed on Scope1. Also, compare on Scope2 the currents flowing in diodes 2 and 4 for circuit 1 and circuit 2.

Notice that the circuit has been discretized by means of the Powergui block. The sample time (50e-6 s) appears on the block icon.

Now, open the Powergui block and select the simulation type Continuous. The continuous ode23tb solver specified in the Simulation Parameters will now be used. Restart the simulation and compare the continuous simulation results with the previous simulation results obtained with a discretized system.

Page 27: simulink