L: Logarithms Block.
MJMcCann-Consulting

Natural, Base 10, Base 2, any base.
MJMcCann-Consulting Logo

Logarithms Block.
Provides scaled logarithms of a ratio, Av/Cv. Inputs should both be positive.
Bv is used as Base in mode 3 also should be positive.
Modes are:
0: Natural logarithm of ratio Av/Cv, scaled by Dv, where Va is value at output of block An etc and Av = Va+aa, etc .
1: Dv*Log base 10 of Av/Cv
2: Dv*Log base 2 of Av/Cv
3: Dv*Log base Bv of Av/Cv

L-Block Code
Procedure ActivateL(ii:integer); //LOGARITHMS: 0:natural, 1:base10, 2:base2, 3:base Bv.
var x, Av, Bv, Cv, Dv : real ;
begin with B[ii] do begin
if OnOff=0 then EXIT;
Av:= max(TinyNumber, B[An].Vn+aa); // keep it away from zero or negative
Cv:= max(TinyNumber, B[Cn].Vn+cc); //make sure no dividing by zero
Dv:=B[Dn].Vn + dd; //Scale factor not restrained
x:=abs( Av / Cv ) ; // only positive numbers
case State of
0: Vn:=Dv*Ln(x);
1: Vn:=Dv*Log10(x);
2: Vn:=Dv*Log2(x);
3: begin Bv:=abs(B[Bn].Vn+bb); Vn:=Dv*LogN(Bv,x) end;
end{case};
pp:=0.0
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: l.htm