A circuit contains six nodes lettered A, B, C, D, E, and F. Let
be the voltage between nodes A and B with its positive reference at the
first named node, here A. Find
,
,
and
if
=6V,
=-3V,
=-8V,
=4V,
and (a)
=1V
(b)
=1V
=
4V. (Dr. M Fogiel, Director, Staff of Research and Education Association,
The Electric Circuits Problem Solver Problem 1.19.) (The figure
was drawn using Quickroute 4.0.)
In order to find the voltages in the question, you need to write a
KVL (Kirchoff's Voltage Law) equation around the loop which contains the
unknown voltages. Mathematica can be used to simplify the equations
and solve for the unknowns. The expressions for each element are
written in a list as shown below.
In[1]:=eqn1={VAC==VAB+VBD+VDE+VEC,VAB==6V,
VBD==-3V, VEC==4V, VDE==1V}
Out[1]=
In[2]:= Solve[eqn1,
VAC]
Out[2]=
In the above equation we employ the Mathematica function Solve
to reduce the equation, solving for the unknown component,
.The
double equal sign (==) represents a symbolic equation;
it tests whether the left-hand side (lhs) of the equation is equal to the
right-hand side of the equation (rhs), and does not cause an explicit action.
In[3]:= eqn2={VAD==VAB+VBD,
VAB==6V, VBD==-3V}
Out[3]=
In[4]:= v2=Solve[eqn2,VAD]
Out4]=
In[5]:=eqn3={VAE==VBD+VDE,VAB==6V,
VBD==-3V, VDE==1V}
Out[5]=
In[6]:= v3 = Solve[eqn3,
VAE]
Out[6]=
In[7]:= eqn4={VAF==VAB+VBD+VDE+VEC+VCF,
VAB==6V, VBD==-3V, VDE==1V, VEC==4V, VCF==-8V}
Out[7]=
In[8]:= v4=Solve[eqn4,
VAF]
Out[8]=
It is possible to do all of the above in just a few less steps, again
using the function Solve to obtain results for simultaneous equations,
as shown in the following:
In[9]:= eqn1= {VAC==VAB+VBD+VDE+VEC,
VAD==VAB+VBD, VAE==VAB+VBD+VDE,VAF==VAB+VBD+VDE+VEC+VCF,VAB==6V, VBD==-3V,
VEC==4V, VDE==1V}
Out[9]={VAC==VAB+VBD+VDE+VEC,
VAD==VAB+VBD, VAE==VAB+VBD+VDE,VAF==VAB+VBD+VDE+VEC+VCF,VAB==6V, VBD==-3V,
VEC==4V, VDE==1V}
In[10]:= Solve[eqn1,
{VAC, VAD, VAE, VAF}]
Out[10]=
The answer is given in the form of a Mathematica rule, these
rules are useful in substituting answers into other expressions.
The Mathematica function N can be used to obtain the numerical
values for the expressions, and the Out[%]function is a global
object that is assigned to be the value produced on the n
(last) output line.
In[11]:= N[%]
Out[11]=