Page 1
Aside

How slow is MATLAB really?

A couple of days ago, I wrote a quick post discussing the usage of CPLEX instead of MATLAB’s built in solvers. CPLEX is a proprietary tool that is developed by IBM and is capable of solving certain types of problems much, much quicker – especially when the number of search parameters becomes large. As an addendum to my previous findings, in the post where I bashed MATLAB and praised CPLEX (link), I herewith would like to continue my bashing, based on yet another bottleneck that I discovered in MATLAB: populating space matrices.

Continue Reading →

more
Standard

IBM to the rescue

Our research laboratory uses a large variety of programming and scripting languages to run simulations, mine data, analyse results and find optimised solutions. The two languages I begun to like most are MATLAB and Python. They both are easy to lean and use, and they both have powerful toolboxes and modules that extend the basic functions of MATLAB and Python, respectively. Nonetheless, for most initial implementations we frequently choose MATLAB over Python since it provides a (in my view) cleaner way to do large matrix manipulation and complex optimisation calls. Once we solved the problem on a theoretical level, we then proceed to stage two, where Python accelerates the computation (especially when we deploy it on our compute cluster HTCondor).

However, with the most recent problem we had to tackle, transition from step one to step two was not straight forward. We had to assure all components operate correctly, and that our solver could find a solution. Yet with an increasing number of input parameters, the developed procedure took more and more time to solve. In fact, the increase in time was exponential as the number of parameters increased – not good. So what could we do now?

Deadlines were coming up and we needed to solve problems lasting several weeks, however a solution may only be returned after several days of computation. At this hopeless moment in time, one of my colleagues suggested an amazing tool called CPLEX by IBM; she really saved us, because it’s free for academics and works so much quicker than MATLAB  (get it here). So, if you are interested in the mathematical problem we wanted to solve, why it is difficult to solve it, how CPLEX performed in comparison to native MATLAB solvers, and how to acquire CIPLEX and use it within your MATLAB code, then you have come to the right post. Continue Reading →

more
Aside

e – like everywhere

Everybody doing any kind of geometry, calculus or higher algebra will have stumbled over this number:

2.71828182845904523536028747135266249775724709369995…

More commonly it is known as e, Euler’s number. You may wonder, where does this number come from and why is it so important? Well… If you are like me that is: waiting for simulations to finish, having 20 minutes of spare time on your hands, and having a tenacious drive to understand things. So come along as I explain two different ways that result explain where this beautiful number comes from.

Continue Reading →

more
more
Standard

Python and DLLs (applied to OpenDSS)

It has been a very long time since I programmed using a Dynamic Linked Library (DLL). Last time I remember was during my 3rd year for our master project to interface the xbox Kinect to our semi-autonomous drone; good old days… For my PhD we need to interface our developed energy management algorithms with a standardized simulation environment. The one we chose is OpenDSS (link), and as it seems it comes with a so called “Direct Connection Shared Library (DLL) for OpenDSS”! This far, every time we wanted to interface with OpenDSS, we had to fully install OpenDSS on our target machines in the HTCluster and let our code interface to the simulation engine via the registered COM server. Now we can achieve the same without installing OpenDSS by simply including the relevant DLLs alongside our Python code! This post addresses (and in the future will remind me) how this is done, and how some traps and errors can be prevented and fixed.

Continue Reading →

more