Loop analysis is a method for obtaining loop currents. The technique uses Kir-
choff voltage law (KVL) to write a set of independent simultaneous equations.
The Kirchoff voltage law states that the algebraic sum of all the voltages
around any closed path in a circuit equals zero.
In loop analysis, we want to obtain current from a set of simultaneous equa-
tions. The latter equations are easily set up if the circuit can be drawn in pla-
nar fashion. This implies that a set of simultaneous equations can be obtained
if the circuit can be redrawn without crossovers.
For a planar circuit with n-meshes, the KVL can be used to write equations for
each mesh that does not contain a dependent or independent current source.
Using KVL and writing equations for each mesh
ELECTRICAL POWER SYSTEM & INFORMATION TECHNOLOGY
RAMAH DALAM PERKATAAN MENCIPTAKAN KEYAKINAN, RAMAH DALAM PEMIKIRAN MENCIPTAKAN KEDAMAIAN,RAMAH DALAM MEMBERI MENCIPTAKAN KASIH
Monday, August 15, 2011
LOOP ANALYSIS
Thursday, August 4, 2011
Interactive Modeling— Experiment Protocol and Simulation Studies
Practical computer simulation is not simply a matter of programming and
solving model equations. We must also make it convenient to modify our
models and try many different experiments (see also Section 1-5). In addition
to DYNAMIC program segments listing the model equations (1-1), each sim-
ulation study requires an experiment protocol program that sets and changes
initial conditions and model parameters, calls computer runs, and displays or
tabulates solutions for different model configurations.
The simplest experiment protocols are just sequences of successive
commands, say
a = 20.0 | b = – 3.35 (set parameter values)
x = 12.0 (set the initial value of x)
drun (make a differential-equation
-solving simulation run)
reset (reset initial values)
a = 20.1 (change model parameters)
b = b – 2.2
drun (try another run)
Dynamic-system Models and Computer Programs 3Each drun command calls a differential-equation-solving simulation run, and
reset resets initial conditions. Typed commands ought to execute immediately
to permit interactive modeling. The operator inspects the solution output after
each simulation run and then types new commands for the next run. Command-
mode operation also permits interactive program debugging [5].
A simulation study combines such commands into a storable program seg-
ment (experiment-protocol script) that can branch and loop to call repeated
simulation runs for different parameter combinations. Simulation studies
may involve thousands of model and parameter changes, so programming
must be easy and computations must be as fast as possible. This is why we
like to interpret experiment-protocol scripts and compile the program seg-
ments executing the actual simulation runs.
Simulation Software
Commercially available equation-oriented simulation programs such as
ACSLTM accept system equations in a more or less human-readable form,
sort defined variable assignments as needed, and feed the sorted equations to
an optimizing Fortran or c compiler [5]. Berkeley Madonna and DESIRE
(see below) have built-in equation-language compilers and execute immedi-
ately. Block-diagram interpreters (e.g., SimulinkTM, VissimTM, and the open-
source program Scicos) permit graphical block-diagram composition and
immediately execute interpreted simulation runs. Such programs usually pro-
vide equation-language blocks for complicated expressions. Interpreted code
is slow; production runs are sometimes translated into c for faster execution.
Alternatively, ACSLTM, Easy5TM, and Berkeley Madonna have block-diagram
preprocessors for compiled simulation programs. More advanced modeling
is possible with the Modelica language
OPEN DESIRE and DESIRE
The simulation programs described in this book, and, in particular, our new
techniques for model replication (vectorization), Monte Carlo simulation,
and submodels (Chapters 3–7), use the open-software simulation package
OPEN DESIRE for Linux, Unix including Cygwin (Unix under Windows),
and Microsoft WindowsTM, or the commercially available DESIRE/2000
program for Windows.
DESIRE simulation systems allow inexpensive per-
sonal computers and workstations solve thousands of differential equations
in seconds.
DESIRE uses double-precision (64-bit) floating-point arithmetic and
accepts command scripts and model descriptions in a readable mathematical
notation such as
y = a
*
cos(x) + b d/dt x = – x + 4
*
y
Command scripts can include operating-system calls, shell scripts, and calls to
other computer programs. DESIRE’s command-script language is itself a
general-purpose mathematical language and handles vectors, matrices, and
even complex numbers (e.g., for frequency-response and root-locus plots)
Programs are entered and edited in editor windows. Each program
begins with an experiment-protocol script that is interpreted much like an
advanced Basic dialect. When the experiment-protocol script encounters a
drun statement, a built-in runtime compiler automatically compiles a
DYNAMIC program segment listing model equations. The state-equation-
solving simulation run then executes at once and produces solution displays
in bright color.
Very fast compilation (typically under 50 ms) simplifies interactive mod-
eling. Experimenters can immediately observe results of programmed or
screen-edited models and experiment-protocol changes. One can enter and
edit different models in multiple editor windows and run these models in turn
to compare results (Fig. 1-1). Runtime displays show solution time histories
and error messages during rather than after each simulation run, so that you
can save time by aborting undesirable runs before they complete.
The experiment-protocol script starting each DESIRE program defines an
experiment. Subsequent DYNAMIC program segments define models used
in the experiment and specify runtime input/output requests. An experiment
protocol can call multiple DYNAMIC segments with different models, dif-
ferent versions of the same model, and/or different input/output operations.
Differential-equation Models
Continuous-system simulation models delayed interactions of physical state
variables x1, x2, … with first-order ordinary differential equations (state
equations)
(d/dt) xi = fi(t; x1, x2,…; y1, y2,…; a1, a2,…) (i = 1, 2,…) (1-1a)
Here t represents the time, and the quantities
yj = gj(t; x1, x2, ...; y1, y2,…; b1, b2,…) (j = 1, 2,…) (1-1b)
are defined variables. a1, a2, …, and b1, b2, … are constant model
parameters.
Simulation programs exercise such models by solving the state-equation
system (1-1) to produce time histories of the system variables xi = xi(t) and
yj = yj(t) for t = t0 to t = t0 + TMAX, starting with given initial values t0 and
xi(t0). In Section 1-6 and Chapter 2, we shall add sampled-data operations
representing periodic inputs and outputs, sample-holds, and digital
controllers.
The state variables xi are system outputs. They start at t = t0 with given
initial values; subsequent values are produced by an integration routine
(Section 1-7) from the fi-values generated by the preceding execution
(derivative call) of the operations (1).
There are three kinds of defined variables yj:
1. system inputs (specified functions of the time t)
2. system outputs
3. intermediate results needed to compute the derivatives fi
It must be possible to sort the defined-variable assignments (1-1b) into a pro-
cedure that successively derives all the yj from state variables xi and/or the
time t without recurrence relations or “algebraic loops” (Section 1-9).
Some dynamic systems (e.g., systems involving interconnected mechani-
cal devices in automotive engineering and robotics) are modeled with differ-
ential-equation systems that cannot be explicitly solved for state-variable
derivatives as in Eq. (1-1). Simulation then requires solution of algebraic
equations at each integration step. Such differential-algebraic-equation
(DAE) systems are not treated in this book. References [1–4] describe suit-
able mathematical methods and special software.
DYNAMIC-SYSTEM MODELS AND COMPUTER PROGRAMS
Computer Modeling and Simulation
Simulation is experimentation with models. Simulation for engineering
design, research, and education studies must rapidly exercise a wide variety
of models and then store and access a large volume of results. This is practi-
cal only with models programmed on computers.
Dynamic-system models relate model-system states to earlier states. Classical
physics, for example, predicts continuous changes of quantities such as position,
velocity, or voltage with continuous time. Computer simulation of such systems
started in the aerospace industry and is now indispensable in biology, medicine,
and agroecology as well as in all engineering disciplines. At the same time, dis-
crete-event simulation has gained importance for business and military planning.
Simulation is at its best when combined with mathematical analyses. But
simulation results can often provide insight and possibly useful decisions
where exact analysis is impractical. This was true for many early control-
system optimizations. As another example, Monte Carlo simulations simple-
mindedly measure statistics over repeated experiments to solve problems that
are too complicated for probability theory analysis. Simulation results must
eventually be validated by real experiments, just like analytical results.
Computer simulations can be speeded up or slowed down at the experi-
menter’s convenience. You can simulate a flight to Mars or to Alpha Centauri
in one second. Periodic clock interrupts synchronizing suitably scaled simu-
lations with real time permit “hardware in the loop”: you can “fly” a real
autopilot—or a real human pilot—on a tilting platform controlled by a com-
puter flight simulation. In this book, we are interested in very fast simulation,
for we want to study the effects of many different model changes.
Specifically, we want to
1. Enter and edit programs in convenient editor windows.
2. Use typed or graphical-interface commands to start, stop, and pause
simulations, to select displays, and to make parameter changes. Results
ought to appear immediately to provide an intuitive “feel” for the
effects of model changes (interactive modeling).
3. Program systematic parameter-influence studies and produce cross-
plots or tables.
4. Program model changes to optimize effectiveness measures, and study
effects of random parameter changes or random model inputs by taking
statistics on repeated simulations (Monte Carlo simulation).