Hacker News new | ask | show | jobs
by 7thaccount 2249 days ago
I've been making a similar argument for awhile. With the libraries now available and high level tools (Python, SQL, Numpy...etc) we can build tiny applications (just a few pages of code) that are easy to maintain and do exactly what we need. So replacing the majority of PSSE isn't very hard. An entire EMS system is another game entirely. It's not just the algorithms, but the full integration with SCADA and other things that most companies don't want to get involved with (too much risk).

On a different note, how are you approaching sparse matrices in Octave? Also, I assumed Octave's performance would be a non-starter here for large models. Is it performant enough for you?

1 comments

Octave includes support for sparse matrices and MATPOWER makes use of them by default. It doesn't require any additional effort from me. In general, Octave can quite match MATLAB for performance, but it is typically not far off. Running it as WebAssembly also comes with a small performance penalty. I haven't run any benchmarks yet, but this can be expected to improve as browser vendors optimize their runtimes.

Octave is using UMFPACK to solve sparse systems of linear equations. There may be some performance to be gained by using KLU with AMD preordering.

I am interested to know how best to compile BLAS and LAPACK to WebAssembly. Traditionally, implementations optimized for a particular machine architecture are used to extract maximum performance. However, WebAssembly targets a stack-based conceptual machine. At present, I use LAPACK v3.4.2 and convert it to C with f2c before compiling to WebAssembly. It would be interesting to perform some benchmark tests against other implementations and compare across browsers.

Neat and thanks for the explanations! When you say running it as Webassembly, is the entire thing compiled that way, or is that just in the front end with Octave running on the server?
The whole application runs on the client (in the browser). The server just serves up static resources. These are cached by the browser so the application will still work if you are offline. The result is much like the desktop applications you mentioned, but without anything needing to be installed.

The JavaScript application presents the UI and controls editing of a JSON representation of the MATPOWER case structure. This data can be seen using the JSON option on the Export page. The WebAssembly program contains GNU Octave and its dependencies. It is run in a WebWorker (background thread) and the JSON data is passed to and fro. The program that converts the JSON into Octave data structures and back again is available here:

https://github.com/rwl/octpower