# Apply Kirchhoff’s current law to solve for the unknown current, I3.
# Given data
I1 = 2.5# # Branch 1 Current=2.5 Amps
I2 = 8# # Branch 2 Current=8 Amps
I4 = 6# # Branch 3 Current=6 Amps
I5 = 9# # Branch 4 Current=9 Amps
# I1+I2+I3-I4-I5 = 0 Sum of all currents at node is ZERO
# I1+I2+I3 = I4+I5 Total Incomming Current = Total Outgoing Current
I3 = I4+I5-I1-I2#
print 'The Branch 3 Current I3 = %0.1f Amps'%I3
# Apply Kirchhoff’s voltage law to solve for the voltages V(AG) & V(BG).
# Given data
V1 = 18.# # Source Voltage 1=18 Volts
V2 = 18.# # Source Voltage 2=18 Volts
R1 = 120.# # Resistor 10=120 Ohms
R2 = 100.# # Resistor 2=100 Ohms
R3 = 180.# # Resistor 3=180 Ohms
Vt = V1+V2#
Rt = R1+R2+R3#
I = Vt/Rt#
VR1 = I*R1#
VR2 = I*R2#
VR3 = I*R3#
# V1+V2-VR1-VR2-VR3=0 Sum of all Voltages in loop is ZERO
# V1+V2 = VR1+VR2+VR3 Total Applied Voltage = Total Dropped Voltage in Resistors
Vt = VR1+VR2+VR3#
VAG = VR2+VR3-V2#
print 'The Voltage V(AG) = %0.2f Volts'%VAG
VBG = V1-VR1-VR2#
print 'The Voltage V(BG) = %0.2f Volts'%VBG