Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class Optimasi Distributed Generation PSO-GWO #2: Backward-Forward Power Flow: Power Loss & Voltage Profile”.
Other ways we can help with Python.
Learn with a mentor
Scheduled Simulation & Engineering courses with live guidance and a certificate.

Course/Training Ansys ~ Heat Transfer and Heat Flux Analysis
★ 5.0 (10)

Course/Training MATLAB — MATLAB App Design: The Ultimate Guide to MATLAB Apps
★ 5.0 (10)

Course/Training Ansys — Airflow Simulation of a Car Radiator with ANSYS
★ 5.0 (9)
Have it built for you
No time to learn Python? Our team can do the project for you.

Matlab Development Service — Complete Neural Signal Processing and Analysis Zero to Hero
★ 5.0 (59)

Ansys Maxwell Development Service
★ 5.0 (50)

Petrel Development Service
★ 5.0 (14)
Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
This is the final result, the voltage profile of the entire IEEE 33-bus system, with 21 buses below the 0.95 per unit limit, and a power loss of 202.68 kW, which is exactly the same as in the literature. Everything is calculated using our self-written power flow backward-forward sweep method. Let's start. Hello, welcome to episode two of the Distributed Generation optimization series. To evaluate a DIGI placement, we must know the voltage at each bus and the power loss in each line. That's the purpose of power flow analysis. The Newton-Raphson method is less suitable for radial distribution networks, so we use the simple, fast backward-forward sweep method, which takes advantage of the tree structure of the network.
Create a file named power_flow.py The power flow function receives a list of DIGI buses and their active power in megawatts. DIGI is modeled as a negative load with a power factor of 1. The voltage of all buses is initialized to 1 per unit. In each iteration, the load current of each bus is calculated from the conjugate of the power divided by the voltage. Then the backward sweep processes the lines from the end to the beginning, the current of each line is the current of the destination bus, and this current is added to the source bus, so the current accumulates towards the substation.
The forward sweep runs in the opposite direction, from the substation to the end. The voltage of the destination bus is the voltage of the source bus minus the line impedance multiplied by the current. The iteration stops when the largest voltage change is smaller than the tolerance. Active power loss is the sum of the square of the current multiplied by the resistance of all lines, multiplied by 1000 to be in kilowatts.
Create a test file named power_flow_test.py and run the basic case without DIGI. It converges in just 8 iterations. Active power loss is 202.68 kilowatts, and the minimum voltage is 0.9131 per unit at bus 18. Both numbers are exactly the same as in P per baran and WU, so our power flow is correct. There are 21 buses with voltages below the standard limit of 0.95 per unit.
Let's draw the voltage profile. Voltage drops from the substation until bus 18 at the main feeder end, then jumps at bus 19 because it is a branch close to the substation. Branches from bus 26 to 33 also drop below the limit. Power loss is about 5.5 percent of the total load. This is the problem we will fix with DIGI.
Done. We have already written the backward-forward sweep power flow from scratch, validating it with literature, and analyze power loss and voltage profile for the base case. In the next episode, we formulate the objective function and constraints, as well as observing the effect of location and size of DIGI. Working on thesis,
Thesis or research in the field of power systems and renewable energy. Cerdas Inovasi Digital helps implement the optimization of power systems, From the backward-forward sweep power flow, placement and capacity of distributed generation, PSO, gray wolf optimizer, up to hybrid algorithms, as well as opening a Python programming course for electrical engineering. Want to master the entire series, From IEEE 33 bus data to algorithm comparison analysis? All 6 episodes, complete with step-by-step PDF guides and source code, Available for premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with 12-month package, Or pay once Rp999.000 for lifetime access. Want just one class? Buy single class with lifetime access. Subscribe now on the premium page cerdasinovasidigital.com Contact our WhatsApp or visit cerdasinovasidigital.com Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →