E: Exponents.
MJMcCann-Consulting

Selectable Modes:
Exponential, non-integer powers, input as exponent.
MJMcCann-Consulting Logo

Exponments.
The E block type provides various exponents and exponential forms. The key variable is formed as:
x = (Va+aa-Vb)/(Vc+cc)
where: Av, Bv and Cv represent the output values from blocks at An, Bn, Cn respectively.
Note that the bb value is not used in forming x (it is really redundant as an addition to Bv) and is used instead as the exponent when x is the base.
The modes of operation are:
0: Vn = (Dv+dd)*Exp(x)
1: Vn = (Dv+dd)*10^x
2: Vn = (Dv+dd)*x^bb

The first form allows positive and negative exponentials and is constructed to make it easy to model the Arrhenius form for the rate of chemical reactions.
The second allows powers of 10 which are convenient for scaling and anti-logs.
The third is fixed so that it only gives real answers. As can be seen from the code, below, it avoids using ln(0), and makes the sign of x determine the sign of the output. Thus it can be used for things like Reynolds analogy in heat transfer and other cases where non-integer powers of physical variables are used.

E Block Code
Procedure ActivateE(ii:integer); //Exponents : e^x, 10^x, x^bb ,scaled by D
var x, d: real; // note bb can be the exponent, is not needed in x.
begin with B[ii] do begin // x is (A+aa-B)/(C+cc)
if OnOff=0 then EXIT;
x:= (B[An].Vn+aa -B[Bn].Vn)/(B[Cn].Vn+cc) ;
d:= B[Dn].Vn+dd;
case State of
0: Vn:= d*Exp(x);
1: Vn:= d*Exp(Ln10*x);
2: Vn:= sign(x)*d*Exp(Ln(abs(x)+TinyNumber)*abs(bb)); //avoids complex numbers, gives real
end{case};
end{with Bii}
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
Request. Please let us know how you found this software and your interests by sending an email to mjmccann@iee.org Thank you Date: 2012.02.26
File: e.htm