ENGINEERING PROJECT

Matlab/Simulink Program

6:35 PM

Function of Block: Gain

Posted by Shahrul

  • Gain
Multiply the input by a constant


  • Library
Math Operations


  • Description

The Gain block multiplies the input by a constant value (gain). The input and the gain can each be a scalar, vector, or matrix.

You specify the value of the gain in the Gain parameter. The Multiplication parameter lets you specify element-wise or matrix multiplication. For matrix multiplication, this parameter also lets you indicate the order of the multiplicands.

The gain is converted from doubles to the data specified in the block mask offline using round-to-nearest and saturation. The input and gain are then multiplied, and the result is converted to the output data type using the specified rounding and overflow modes.



  • Data Type Support

The Gain block accepts a real or complex scalar, vector, or matrix of any data type supported by Simulink except Boolean. The Gain block supports fixed-point data types. If the input of the Gain block is real and the gain is complex, the output is complex.



  • Parameters and Dialog Box

The Main pane of the Gain block dialog appears as follows:





  • Gain
Specify the value by which to multiply the input. The gain may be a scalar, vector, or matrix. The gain may not be Boolean.


  • Multiplication
Specify the multiplication mode:

Element-wise(K*u)
Each element of the input is multiplied by each element of the gain. The block performs expansions, if necessary, so that the input and gain have the same dimensions.

Matrix(K*u)
The input and gain are matrix multiplied with the input as the second operand.

Matrix(u*K)
The input and gain are matrix multiplied with the input as the first operand.

Matrix(K*u)(u vector)
The input and gain are matrix multiplied with the input as the second operand. The input and the output are required to be vectors and their lengths are determined by the dimensions of the gain.


  • Sample time (-1 for inherited)
Specify the time interval between samples. To inherit the sample time, set this parameter to -1.

The Signal Data Types pane of the Gain block dialog appears as follows:


  • Output data type mode

Set the data type and scaling of the output to be the same as that of the input, or to be inherited via an internal rule or by back propagation. Alternatively, choose to specify the data type and scaling of the output through the Output data type and Output scaling value parameters in the dialog.

If you select Inherit via internal rule for this parameter, Simulink chooses a combination of output scaling and data type that requires the smallest amount of memory consistent with accommodating the output range and maintaining the output precision of the block and with the word size of the targeted hardware implementation specified for the model. If the Device type parameter on the Hardware Implementation configuration parameters pane is set to ASIC/FPGA, Simulink chooses the output data type without regard to hardware constraints. Otherwise, Simulink chooses the smallest available hardware data type capable of meeting the range and precision constraints. For example, if the block multiplies an input of type int8 by a gain of int16 and ASIC/FPGA is specified as the targeted hardware type, the output data type is sfix24. If Unspecified (assume 32-bit Generic), i.e., a generic 32-bit microprocessor, is specified as the target hardware, the output data type is int32. If none of the word lengths provided by the target microprocessor can accommodate the output range, Simulink displays an error message in the Simulation Diagnostics Viewer.


  • Output data type
Set the output data type. This parameter is only visible if you select Specify via dialog for the Output data type mode parameter.


  • Output scaling value
Set the output scaling using either binary point-only or [Slope Bias] scaling. This parameter is only visible if you select Specify via dialog for the Output data type mode parameter.


  • Lock output scaling against changes by the autoscaling tool
Select to lock scaling of outputs. This parameter is only visible if you select Specify via dialog for the Output data type mode parameter.


  • Round integer calculations toward
Select the rounding mode for fixed-point operations.


  • Saturate on integer overflow
Select to have overflows saturate.




The Parameter Data Types pane of the Gain block dialog appears as follows


  • Parameter data type mode
Set the data type and scaling of the gain to be the same as that of the input, or to be inherited via an internal rule. Alternatively, choose to specify the data type and scaling of the gain through the Parameter data type, Parameter scaling mode, and Parameter scaling parameters in the dialog.


  • Parameter data type
Specifies the data type of the Gain parameter. This parameter is visible only if you select Specify via dialog for the Parameter data type mode parameter.


  • Parameter scaling mode

Set the mode to determine the scaling of the gain.

Use specified scaling
This mode allows you to set the scaling of the gain in the Parameter scaling parameter.

Best Precision: Element-wise
This mode sets binary points for the elements of the gain such that the precision of each element is maximized.

Best Precision: Row-wise
This mode sets a common binary point within each row of the gain such that the largest element of each row has the best possible precision.

Best Precision: Column-wise
This mode sets a common binary point within each column of the gain such that the largest element of each column has the best possible precision.

Best Precision: Matrix-wise
This mode sets a common binary point for all the elements of the gain such that the largest element has the best possible precision.


  • Parameter scaling

Set the gain scaling using either binary point-only or [Slope Bias] scaling. This parameter is only visible if you select Specify via dialog for the Parameter data type mode parameter, and if you select Use specified scaling for the Parameter scaling mode parameter.

Characteristics



Thank You..

9:40 PM

Function of Block: Transfer Function (2)

Posted by Shahrul





Continue....

  • Specifying the Absolute Tolerance for the Block's States
By default Simulink uses the absolute tolerance value specified in the Configuration Parameters dialog box (see Absolute tolerance) to solve the states of the Transfer Fcn block. If this value does not provide sufficient error control, specify a more appropriate value in the Absolute tolerance field of the Transfer Fcn block's dialog box. The value that you specify is used to solve all the block's states.



  • Data Type Support
The Transfer Fcn block accepts and outputs signals of type double.



  • Parameters and Dialog Box



  • Numerator coefficient
The row vector of numerator coefficients. A matrix with multiple rows can be specified to generate multiple output. The default is [1].


  • Denominator coefficient

The row vector of denominator coefficients. The default is [1 1].


  • Absolute tolerance

Absolute tolerance used to solve the block's states. You can enter auto or a numeric value. If you enter auto, Simulink determines the absolute tolerance (see Specifying Variable-Step Solver Error Tolerances). If you enter a numeric value, Simulink uses the specified value to solve the block's states. Note that a numeric value overrides the setting for the absolute tolerance in the Configuration Parameters dialog box


Characteristics



1:01 AM

Function of Block: Transfer Function (1)

Posted by Shahrul






  • Description


The Transfer Fcn block models a linear system by a transfer function of the Laplace-domain variable s. The block can model both single-input single-output (SISO) and single-input multiple output (SIMO) systems.

This block assumes that the transfer function has the following form:



Where u and y are the system's input and outputs, respectively, nn and nd are the number of numerator and denominator coefficients, respectively. num and den contain the coefficients of the numerator and denominator in descending powers of s. The order of the denominator must be greater than or equal to the order of the numerator. This block also assumes that the transfer functions for the outputs of a multiple output system have the same denominator and that the numerators of the transfer functions have the same order.


To model a single-output system, enter a vector containing the system transfer function's numeric coefficients in the Numerator coefficient field in the block's parameter dialog box. Enter a vector containing the transfer function's denominator coefficients in the Denominator coefficient field. In this case, the input and output of the block are scalar time-domain signals.


To model a multiple-output system, enter a matrix in the Numerator coefficient field where each row of the matrix contains the numerator coefficients of a transfer function that determines one of the block's outputs. Enter a vector containing the denominator coefficients common to the system's transfer functions in the Denominator coefficient field. In this case, the block's input is a scalar and the block's output is a vector each of whose elements is an output of the system modeled by the block.

Initial conditions are preset to zero. If you need to specify initial conditions, convert to state-space form using tf2ss and use the State-Space block. The tf2ss utility provides the A, B, C, and D matrices for the system.


  • Transfer Fcn Display

The numerator and denominator are displayed on the Transfer Fcn block depending on how they are specified:

  • If each is specified as an expression, a vector, or a variable enclosed in parentheses, the icon shows the transfer function with the specified coefficients and powers of s. If you specify a variable in parentheses, the variable is evaluated. For example, if you specify Numerator as [3,2,1] and Denominator as (den) where den is [7,5,3,1], the block looks like this:



  • If each is specified as a variable, the block shows the variable name followed by (s). For example, if you specify Numerator as num and Denominator as den, the block looks like this


Electric machines play an important role in industry as well as our day to day life. They are used to generate electrical power in power plants and provide mechanical work in industries. They are also an indispensable part of our daily lives. Electric machines are very important pieces of equipment in our everyday lives. The DC machine is considered to be basic electric machines.

The aim of this final year project is to introduce students to the modeling of power components and to use computer simulation as a tool for conducting transient and control studies. Simulation can be very helpful in gaining insights to the dynamic behavior and interactions that are often not readily apparent from reading theory. Simulation is often chosen by engineers to study transient and control performance or to test conceptual designs.

MATLAB/SIMULINK is used because of the short learning curve that most students require to start using it, its wide distribution, and its general purpose of nature. This will demonstrate the advantages of using MATLAB for analyzing power system steady-state behavior and its capabilities for simulating transients in power systems and power electronics, including control system dynamic behavior