The battle against PowerFactory

8.33%
Day 5 / 60
Time flies when you set big goals in such a short time. I'm worried that I've already used 8.33% of my deadline and these days have been holidays, so I couldn't work as much as I expected. But I still worked when I could.
As I mentioned in my previous post, the first thing is to build the tools. I decided to start with the one I think will take me the longest and the one I need to get right: DIgSILENT PowerFactory.
What is PowerFactory?
For those not in the electrical world: PowerFactory is the power systems analysis software. It's the standard tool in the Chilean electrical system (and I believe in many parts of the world) for running simulations, power flows, short circuits, stability analysis, protection coordination... basically everything you need for serious electrical studies.
It's German software from DIgSILENT GmbH that has been on the market for decades and has a huge library of electrical component models. The great thing is that it has a Python API that allows automating simulations, which is exactly what I need so the agent can "think" and then execute studies.
The ARM architecture drama
A small detail that cost me a day of work: I've been using the Mac ecosystem for a long time, so all 3 computers I usually work with are Macs with M processors (ARM architecture).
This is very specific, but maybe someone will find it useful or even my future self: PowerFactory doesn't run on M processors. It's only designed for x64 or x86 Windows architecture. Even though I virtualized Windows on my Macs, it didn't work. So I lost a day on this.
Cloud
My second option was to run PowerFactory on a cloud VM. Since it was Windows, I obviously started with Azure.
I have to confess that I hate Azure. And indeed, after a couple of hours trying to configure a VM, I gave up and went back to my always reliable Google Cloud.
On Google Cloud it was easy (I think it's because I already have experience). Now I have running:
- Machine type: e2-standard-4 (4 vCPUs, 16 GB Memory)
- Disk: 50GB SSD

Cloud architecture diagram
For now the simulations run well, they usually take a few seconds although I've tested with 5-10 bus systems. I'll simply forget about the machine size until the simulations start taking too long.
I've been testing with a small electrical system I have for testing purposes. In the coming days I'll be showing the results.

Small electrical system I've been testing with
The architecture: FastAPI + MCP
So, how does this tool work? I have a Python backend that uses the PowerFactory library to run simulations.
The architecture is simple:
- FastAPI as the web server that exposes the endpoints
- Traditional REST API for integration with any system
- MCP (Model Context Protocol) to connect directly with Claude and other LLMs
MCP is key because it allows me to test in Claude without depending on the complete agent. Basically I can ask Claude "run a power flow on this project" and it can execute it directly.
Tools available so far:
- Load project
- Get element information
- Power flow
- Short circuit
The license issue
I've been thinking about making this tool publicly available. For now I have a DIgSILENT student license, which has limitations (I can only run 50 buses, for example). I don't know if I can distribute this so for now this tool stays closed.
I'll leave this comment in case any investor is interested, if someone wants us to run a DIgSILENT service in the cloud, or if any company is interested in this service.
TODO list (Pending or things to improve)
Pending things that would improve the project:
- Machine benchmark: I'll be testing different configurations and their performance during the rest of the challenge
- Queue system: If I want the system to scale, the machine can't run multiple simulations simultaneously. I need to implement a queue manager