The Sum block computes the sum of several Inputs (2-6), each multiplied by a gain value. The sum is calculated at the rate specified by the Evaluate Block. A diagram of the Sum (2 Input) block is shown below:
Example
The following example demonstrates how to make a summation routine, where the model starts with a constant, then uses the Sum block to add the output to the constant after each sample. In this example a 4 Input Summing junction is used to add Feed Forwards into the control loop. |
The configuration values for this block are as follows:
|
Simulink InterfaceThe inputs are double precision values that are multiplied by their respective gains and summed to form the output. The block has two user data fields (User Data 0, User Data 1) to store application-specific data for convenient storage and retrieval. See User Data Storage for details. The block's update schedule is determined by the Evaluate Block.
The following Parameter Dialog Box can be opened by double-clicking on the
block in a Simulink Model (2 Input version shown):
|
Declaration
Public Method
class SUMBlock: public virtual Block
{
public:
// User accessible coefficients
long nSum;
double Coeff[MFWMaxObserverSize];
};
|
|
Required Header: mechaware.h |
Description
The Sum block computes the sum of several Inputs (2-6), each multiplied by a gain value.
|
Methods