-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomp_constants.py
25 lines (22 loc) · 1.17 KB
/
comp_constants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
############################################################
# Created on Mon Jan 21, 2019 #
# #
# @author: sdm #
# #
# Constants used by the... #
# program to solve resister network with a voltage source #
############################################################
# Define some constants we'll use to reference things
RESIS = 'R' # a resistor
V_SRC = 'VS' # a voltage source
# Define the list data structure that we'll use to hold components:
# [ Type, Name, i, j, Value ] ; set up an index for each component's property
TYPE = 0 # voltage source or resister
NAME = 1 # name of the component
I = 2 # "from" node of the component
J = 3 # "to" node of the component
VAL = 4 # value of the component
# Define the different types of component
R = 0 # A resistor
VS = 1 # An independent voltage source
CCCS = 1 # A current controlled current source