summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice/Processing.py
diff options
context:
space:
mode:
authorFahim2016-03-02 13:42:25 +0530
committerFahim2016-03-02 13:42:25 +0530
commit0b0949cb657b07341c9cb17a9bce5c7e1aee09f4 (patch)
tree85f0adde2d87490f8cda367a9c80957215d83b61 /src/kicadtoNgspice/Processing.py
parent9347ac2e7c7d7c0693cd85327297b519196dbb90 (diff)
downloadeSim-0b0949cb657b07341c9cb17a9bce5c7e1aee09f4.tar.gz
eSim-0b0949cb657b07341c9cb17a9bce5c7e1aee09f4.tar.bz2
eSim-0b0949cb657b07341c9cb17a9bce5c7e1aee09f4.zip
Bug fixing for transformer model
Diffstat (limited to 'src/kicadtoNgspice/Processing.py')
-rw-r--r--src/kicadtoNgspice/Processing.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py
index fd9795e6..a80084ce 100644
--- a/src/kicadtoNgspice/Processing.py
+++ b/src/kicadtoNgspice/Processing.py
@@ -160,7 +160,7 @@ class PrcocessNetlist:
unknownModelList = []
multipleModelList = []
plotList = ['plot_v1','plot_v2','plot_i2','plot_log','plot_db','plot_phase']
-
+ interMediateNodeCount=1
k = 1
for compline in schematicInfo:
words = compline.split()
@@ -336,6 +336,24 @@ class PrcocessNetlist:
elif compType == 'transfo':
schematicInfo.insert(index,"* "+compline)
+
+ #For Primary Couple
+ modelLine = "a"+str(k)+" ("+words[1]+" "+words[2]+") (interNode_"+str(interMediateNodeCount)+" "+words[3]+") "
+ modelLine += compName+"_primary"
+ schematicInfo.append(modelLine)
+ k=k+1
+ #For iron core
+ modelLine = "a"+str(k)+" ("+words[4]+" "+words[2]+") (interNode_"+str(interMediateNodeCount+1)+" "+words[3]+") "
+ modelLine += compName+"_secondary"
+ schematicInfo.append(modelLine)
+ k=k+1
+ #For Secondary Couple
+ modelLine = "a"+str(k)+" (interNode_"+str(interMediateNodeCount)+" interNode_"+str(interMediateNodeCount+1)+") "
+ modelLine += compName+"_iron_core"
+ schematicInfo.append(modelLine)
+ k=k+1
+ interMediateNodeCount += 2
+
modelname = "transfo"
comment = "* "+compline
title = "Transformer details for model "+compName