In [4]:
;cd test


/Users/prezaei/Dropbox/JuliaPower/test

In [3]:
include("data/case6ww_ps_2.jl")

In [12]:
reload("ACPowerFlow")


Warning: replacing module ACPowerFlow
Warning: Method definition real(SparseMatrixCSC{Tv,Ti<:Integer},) in module ACPowerFlow at /Users/prezaei/Dropbox/JuliaPower/ACPowerFlow/src/ACPowerFlow.jl:16 overwritten in module ACPowerFlow at /Users/prezaei/Dropbox/JuliaPower/ACPowerFlow/src/ACPowerFlow.jl:16.
Warning: Method definition imag(SparseMatrixCSC{Tv,Ti<:Integer},) in module ACPowerFlow at /Users/prezaei/Dropbox/JuliaPower/ACPowerFlow/src/ACPowerFlow.jl:17 overwritten in module ACPowerFlow at /Users/prezaei/Dropbox/JuliaPower/ACPowerFlow/src/ACPowerFlow.jl:17.

In [9]:
alak = sin


Out[9]:
sin (generic function with 17 methods)

In [10]:
methods(alak)


Out[10]:
17 methods for generic function sin:

In [13]:
using DataFrames, HDF5, JLD, Makeps, ACPowerFlow, Optim, ACSIMSEP

# user input to the code
verbose = true
PartFactFlag = false
PolarFlag = true
# ps = load("data/case2383wp_ps.jld")["ps"]
# ps = load("../data/case6ww_ps.jld")["ps"]
# ps = load("../data/case2_ps.jld")["ps"]; 
ps = load("../data/case6ww_ps_2.jld")["ps"]
ps.shunt[[4:6],[:P,:Q]] = 210.
# ps.shunt[[1:3],[:P,:Q]] = 210.
ps.branch[23,:status] = false

LoadFactor = 1.
ps.shunt[:,:P] = ps.shunt[:,:P] * LoadFactor
ps.shunt[:,:Q] = ps.shunt[:,:Q] * LoadFactor

ACPowerFlow.acpf!(ps, PartFactFlag = PartFactFlag)


Iter   Max(|g|)   |g|_2      max(Jac'*g)      alpha

at /Users/prezaei/Dropbox/JuliaPower/ACPowerFlow/src/nrsolve.jl:35

      34           g2 = sqrt(sum(g.^2))
 -->  35           @bp
      36   

debug:35> STDIN> det(Jac)
1.5752209568095036e9

debug:35> STDIN> q
interrupted
while loading In[13], in expression starting on line 19

 in trap at /Users/prezaei/.julia/v0.3/Debug/src/UI.jl:68
 in __nrsolve#270__ at no file:35
 in acpf! at /Users/prezaei/Dropbox/JuliaPower/ACPowerFlow/src/acpf.jl:34

In [39]:
ps.bus


Out[39]:
IDtypePdQdGsBsareaVmagVangbasekVzoneVmaxVminlamPlamQmuVxmuVnlocXlocY
113.00.00.00.00.01.01.050.0230.01.01.051.050.00.00.00.01.51.0
222.00.00.00.00.01.01.05-0.06407378348652876230.01.01.051.050.00.00.00.02.01.0
332.00.00.00.00.01.01.07-0.0745825871344223230.01.01.071.070.00.00.00.02.51.0
441.00.00.00.00.01.00.9893728693486216-0.07323090241990156230.01.01.050.950.00.00.00.01.02.0
551.00.00.00.00.01.00.9854448350522254-0.09209034811199586230.01.01.050.950.00.00.00.02.02.0
661.00.00.00.00.01.01.0044252703572052-0.10380265472313888230.01.01.050.950.00.00.00.03.02.0
772.00.00.00.00.01.00.00.0230.01.01.051.050.00.00.00.01.51.0
882.00.00.00.00.01.00.00.0230.01.01.051.050.00.00.00.02.01.0
992.00.00.00.00.01.00.00.0230.01.01.071.070.00.00.00.02.51.0
10101.00.00.00.00.01.00.00.0230.01.01.050.950.00.00.00.01.02.0
11111.00.00.00.00.01.00.00.0230.01.01.050.950.00.00.00.02.02.0
12121.00.00.00.00.01.00.00.0230.01.01.050.950.00.00.00.03.02.0

In [40]:
ps.gen


Out[40]:
busPQQmaxQminVspmBasestatusPmaxPminmuPxmuPnmuQxmuQntypecost
11107.8754969156380215.956206299830427100.0-100.01.05100.01.0200.050.00.00.00.00.03.011.669
2250.000000000226674.35647509772897100.0-100.01.05100.01.0150.037.50.00.00.00.02.010.333
3360.00000000012559689.6267744989007260.0-100.01.07100.01.0180.045.00.00.00.00.02.010.833
470.00.0100.0-100.01.05100.01.0200.050.00.00.00.00.03.011.669
580.00.0100.0-100.01.05100.01.0150.037.50.00.00.00.02.010.333
690.00.060.0-100.01.07100.01.0180.045.00.00.00.00.02.010.833

In [41]:
ps.branch


Out[41]:
fromtoRXBrateArateBrateCtapshiftstatusPfQfPtQtmuFmuTImagFImagTswitchablefail_ratetypecontg_st
1120.10.20.0440.040.040.01.00.0true28.68967918746788-15.418662090643664-27.78473718499573412.8185460955879760.00.00.31019456004816090.291420283798124570.00.00.00.0
2140.050.20.0460.060.060.01.00.0true43.5849494284468920.12014966750796-42.497393816493656-19.932644568901080.00.00.457189307096792950.47443928668309860.00.00.00.0
3150.080.30.0640.040.040.01.00.0true35.6008682997232511.254718722966182-34.52732269404179-13.4497272704540230.00.00.355595443554049760.37601734760754760.00.00.00.0
4230.050.250.0640.040.040.01.00.0true2.930319554440286-12.268749405066632-2.89000628297047875.7281157624156530.00.00.120131819003139180.059961444583278160.00.00.00.0
5240.050.10.0260.060.060.01.00.0true33.0909465838373146.05406848658985-31.585843319780682-45.1252206330795640.00.00.5400922042707180.55672956726805390.00.00.00.0
6250.10.30.0430.030.030.01.00.0true15.5145262558775515.353153175036585-15.01657680656928-18.0065078729740480.00.00.20787660681474430.237926685075137640.00.00.00.0
7260.070.20.0590.090.090.01.00.0true26.24894479106710712.399456745581194-25.665641584970246-16.011301466063510.00.00.276478278657866840.301171274108449960.00.00.00.0
8350.120.260.0570.070.070.01.00.0true19.11682390948796623.174456112664586-18.023247504648793-26.095044376174120.00.00.28076427214586680.32182596353648280.00.00.00.0
9360.020.10.0280.080.080.01.00.0true43.77318237360804460.72420262382019-42.76979738721798-57.8610478156021060.00.00.69959499903177550.71635453215972780.00.00.00.0
10450.20.40.0820.020.020.01.00.0true4.0832371362880595-4.942134797899984-4.047017528564535-2.7852667767898680.00.00.064795943894131640.049854100843547450.00.00.00.0
11560.10.30.0640.040.040.01.00.0true1.6141645340893462-9.663453703215161-1.56456102782085643.87234928203085230.00.00.099420478162899230.041580740088062070.00.00.00.0
12780.10.20.0440.040.040.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
137100.050.20.0460.060.060.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
147110.080.30.0640.040.040.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
15890.050.250.0640.040.040.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
168100.050.10.0260.060.060.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
178110.10.30.0430.030.030.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
188120.070.20.0590.090.090.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
199110.120.260.0570.070.070.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
209120.020.10.0280.080.080.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
2110110.20.40.0820.020.020.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
2211120.10.30.0640.040.040.01.00.0true0.00.00.00.00.00.00.00.00.00.00.00.0
236110.20.40.0820.020.020.01.00.0false0.00.00.00.00.00.00.00.00.00.00.00.0
&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip&vellip

In [4]:
ps2=Caseps[]


Out[4]:
0-element Array{Caseps,1}

In [6]:
typeof(ps1)


Out[6]:
Caseps (constructor with 1 method)

In [7]:
ps2.bus = DataFrame(A = [1,2,3])


type Array has no field bus
while loading In[7], in expression starting on line 1

In [8]:
DataFrame(A = [1,2,3])


Out[8]:
A
11
22
33

In [ ]:
ps2[1]