diff --git a/ipynb/Clustering and wiring potential microgrids.ipynb b/ipynb/Clustering and wiring potential microgrids.ipynb index 4c7918658c80afa45b8e4e3f1f6fe04ee9fad8e3..e5d0aa44cbcaf4b3c41a38b3fcd74e2a0c42f3c8 100644 --- a/ipynb/Clustering and wiring potential microgrids.ipynb +++ b/ipynb/Clustering and wiring potential microgrids.ipynb @@ -960,7 +960,9 @@ "collapsed": true }, "outputs": [], - "source": [] + "source": [ + "" + ] }, { "cell_type": "markdown", @@ -978,7 +980,9 @@ "collapsed": true }, "outputs": [], - "source": [] + "source": [ + "" + ] } ], "metadata": { @@ -990,7 +994,7 @@ "language_info": { "codemirror_mode": { "name": "ipython", - "version": 3 + "version": 3.0 }, "file_extension": ".py", "mimetype": "text/x-python", @@ -1006,4 +1010,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} +} \ No newline at end of file diff --git a/ipynb/Percolation theory.ipynb b/ipynb/Percolation theory.ipynb index 8d7e9fe24a7f72dbee5bbd32c9835c82f9decab5..281aef6bfd61616f7f9ec6b2d6aacce8e2e4ac6e 100644 --- a/ipynb/Percolation theory.ipynb +++ b/ipynb/Percolation theory.ipynb @@ -16,7 +16,8 @@ "\n", "import sys\n", "upper_path = os.path.abspath(os.path.join(os.path.dirname( \"__file__\" ), '..'))\n", - "path_add = os.path.join(upper_path, \"/\", \"py/\")\n", + "path_add = os.path.join(upper_path, \"py/\")\n", + "path_png = os.path.join(upper_path, \"png/\")\n", "sys.path.append(path_add)\n", "\n", "import matplotlib.pyplot as plt\n", @@ -64,8 +65,7 @@ "outputs": [], "source": [ "import sys\n", - "path = \"/Users/Thomas/Documents/BlocPower/Microgrids/Simulation/py/\"\n", - "sys.path.append(path)\n", + "sys.path.append(path_add)\n", "\n", "from simulated_annealing_algo import distance_matrix" ] @@ -193,7 +193,7 @@ }, "outputs": [], "source": [ - "?neighbor_generator" + "#?neighbor_generator" ] }, { @@ -308,7 +308,7 @@ "graph = T0.copy()\n", "monte_carlo_n = 100\n", "start = time.clock()\n", - "size_l = [[step_montecarlo(graph, q) for q in q_l] for j in range(monte_carlo_n)]\n", + "size_l = simulate_montecarlo(n_sim=n_sim, graph=g, q_l=q_l)[1]\n", "print(\"Execution time: %f minutes\" % ((time.clock() - start)/60))" ] }, diff --git a/py/power_flow.py b/py/power_flow.py index a7a51e02ec324e0f5e34942ee84f5a3035cafc8b..d8c004ec330ec584c81c73c8be5e364e810f275f 100644 --- a/py/power_flow.py +++ b/py/power_flow.py @@ -53,9 +53,7 @@ def power_flow(graph, size, pcc_node, load_str='load', gen_str='gen', distance_s node_reactance += line_reactance graph.node[i]['voltage_angle'] = (graph.node[i][gen_str] - graph.node[i][load_str]) * node_reactance - absolute_flow = 0 - set_edge_attributes(graph, 'flow', 0) for i in range(size):