X: Multiplier.
Mode 0: This device is a simple multiplier, It takes up to 5 inputs
and for each one adds in a constant if needed.
Mode 1: This does a DOT (inner) product between the data values in two blocks,
designated by An and Bn but only if they have data storage and only up to the lesser number of data points.
Memory blocks and function Generator blocks both store data, and a conveyor belt also has a series of content values.
The dot product can therefore be used to generate Finite Impulse Response (FIR) filters,
where the data is sampled in a memory block and the weighting function is the series of values in the function Generator.
The base values in either case are ignored.
Another use might be in checking what is coming along in a conveyor Belt, serving as a delivery service.
The Dot product of a vector with itself can be used to calculate the RMS value.
Multiplier Block Code
Procedure ActivateX(ii:integer); //Multiplier for 5 channels, Dot product of stores An,Bn
var Av,Bv,Cv,Dv,Pv: real; //values to be used in multiplication.
LenA, LenB,Lmax,jj : Integer; //lengths of stores, index
begin with B[ii] do begin
if OnOff=0 then EXIT;
case State of
0: begin //normal 5 channel multiply.
Av:= B[An].Vn + aa;
Bv:= B[Bn].Vn + bb;
Cv:= B[Cn].Vn + cc;
Dv:= B[Dn].Vn + dd;
Pv:= B[Pn].Vn + pp;
Vn:= Av*Bv*Cv*Dv*Pv; end;
1: begin //dot product of A and B stores to maximum common length.
LenA:=High(B[An].Store); LenB:=High(B[Bn].Store); //see if there is stored data
if (LenA>0) and (LenB>0) then begin //there is some data stored.
if (B[An].Ty='G') or (B[An].Ty='M') then LenA:= LenA div 2;
if (B[Bn].Ty='G') or (B[Bn].Ty='M') then LenB:= LenB div 2;
Lmax:=max(LenA,LenB);
Vn:=0.0;
for jj:=1 to Lmax do Vn:=Vn+B[An].Store[jj]*B[Bn].Store[jj];
end {if data in store};
end{case 1};
end{cases state};
end{withBii}
end;
|
MJMcCann-Consulting
Help Index:
Index/Search
Background
Simulation Concepts
Continuous Systems
Discrete Systems
McSimAPN Structure
McSimAPN Operation
Using McSimAPN
Start McSimAPN
Save Model,data
Create Blocks
Run-Hold-Reset
Link Excel+VBA
PetriNet Block Types
A activity/action
B belt conveyor
C container/constant
D diverter(random)
Analogue Block Types
E exponents
F flux/flow
G function Generator
H hysteresis
I integrator
J inductor
K logic element
L logarithms
M memory
N note/label
O oscilloscope/graph
p not assigned
Q quantizer/rounding
R relay on/off
S sin/asin/atan
T timer/clock
U user link Excel
V visual voltmeter
W sWitch selector/MUX
X multiply
y not assigned
Z random (fuZZ)
& signed summation
% division/difference
@ access/move values
|
Invitation. McCann can help if you have a
design or operational problem that needs some technical support that is outside your
team's experience, some quantitative assessment of what is really the cause of the
difficulties, some design alternatives or just a fresh look by an intelligent
interrogator.
If you have a problem with the behaviour of a market sector, plant, process or item of
equipment and would like to get a quantitative handle on it to improve yield or optimise
performance, then contact us. We are always ready to give a little time
to discuss a new puzzle, in confidence,
of course. We'll only worry about fees
when we have some defined work. We can be flexible
about how we work with you. Top
|
MJMcCann-Consulting,
POB 902,
Chadds Ford PA
19317 USA.
T: 1 302 654-2953
F: 1 302 429 9458
E: mjmccann@iee.org
|