E-learning material for learning how to apply systematic methods to control structure design is now available at www.optkontek.com. The courseware on offer is for the maximum gain rule for steady-state systems, with accompanying Excel spreadsheets and instruction via e-book and video.
June 22, 2010
March 28, 2010
Backup of Files With Given Extension
I often need to make backup of a certain class of files, say all text files in a folder. A nice bash one-liner to achieve that is:
for i in *.txt; do cp “$i” “$i.backup”; done
On Windows this is even simpler. There you can simply do:
copy *.txt *.txt.backup
February 16, 2010
The golden mean – a lost path in process control?
Control theory used to be interesting – a field seeing understanding and elegance real virtues. This rather romantic and academic approach to the field seems to have been lost in the euphoria researchers seem to feel for optimization. Admitted, optimization technologies have brought fantastic benefits to the world of manufacturing, but it has also brought its own selection of drawbacks.
- Esthetics of process control have been lost (mostly academic interest).
- Optimization-based results are hard to understand in terms of physics (this is a “real” problem).
The loss of esthetics makes life less enjoyable. The loss of a physical undertanding of the technologies we employ makes life dangerous. If we use optimization technologies to push boundaries and improce profitability, we might be approaching an operating policy that is not very robust. This means that we have increased the risk of a system failure, and this risk may be hidden behind the complexity of the solution that optimization has given us.
I feel the golden mean has its place in modern operating policies. Optimization may very well guide process and control system design – but implementations should be avoided when fundamental physical characteristics of the optimal point are not completely understood.
February 12, 2010
Quadrature for array valued functions
I just discovered that Matlab can numerically integrate matrix valued functions. That’s a time saver – no more reshaping inside quad calls! 🙂
See for yourself: help quadv
February 8, 2010
MathType’s Word Macros don’t Like UTF-8 File Paths
I recently installed MathType on a Mac for use with Word 2004. Didn’t work. After googling in vain, I tried some random things. One was changing the name of the hard drive to something not involving my name, which contains the non-ASCII letter “Ã¥”. That worked. So, if you are struggling with the MathType macros, this may be the solution…
January 25, 2010
A guy said that a guy wrote so in an e-mail…
That’s how the IPCC argues that all glaciers in the Himalayas will disappear by 2035. The only problem is that this isn’t to be found in any peer reviewed literature. An a lot of people who know about such ice cold things, such as glaciers, say that this is simply not true – at the current rate of melting it would probably take a couple of hundred years to melt those glaciers. Way to go, U.N. and IPCC! Politicizing science was maybe not the best of ideas anyway?
BTW – I got this from the Jan 16 issue of New Scientist. It just nagged me enough to write this post here…
January 6, 2010
How to convert a sympy Matrix to numpy array
I suppose not too many people need this, but I do. Consider a sympy matrix with some symbolic variables in it, generated by
import sympy
[x1,x2,x3,x4]=sympy.symbols([‘x1′,’x2′,’x3′,’x4’])
A=sympy.Matrix([[x1,x2],[x3,x4]])
Now, say you want to populate this matrix with x1=x2=x3=x4=1. This is easy:
An=A.subs({x1:1,x2:1,x3:1,x4:1})
Convert to numpy array:
from pylab import array
B=array(An)
This works….., but we have an array of objects, not of floats! Hm… The sympy module gives us the evaluate expression function N:
B_float = array(sympy.N(An))
Hm… fails again, with the error “Not implemented for matrices” (or something like that). So what do we do now? Well, we can iterate over An and apply this to each element. The following function does the job:
def Sym2NumArray(F):
“””Function to convert symbolic expression with numerical data to numpy array “””
shapeF=shape(F)
B=zeros(shapeF)
for i in range(0,shapeF[0]):
for j in range(0,shapeF[1]):
B[i,j]=sympy.N(F[i,j])
return B
Enjoy 🙂
December 17, 2009
Using a digital camcorder with HDD and Linux
Most camcorders come with software and drivers for Windows and Mac. For Linux, the case is…., well, different. However, if your camera records the typical *.vro files (used for DVD’s), you may think you are in trouble. However, making sense of those files is very easy. Install the video editing software “kino”. Then copy the *.vro file to your computer and add it to a kino project. Then you can split, manipulate, edit, author and export at your heart’s will. (Note, it doesn’t autosplit files, everything on your camcorder drive will be in a single *.vro file).
December 14, 2009
Mathtype to oomath problem – one possible solution
OpenOffice.org Writer can convert Word files to ODF files. This works very well. However, if there are MathType equations in the Word document, it does not work. This has been a problem for many years, just google “Mathtype to oomath” to see what I mean.
One company has seen a potential profit in this and created a Mathtype-To-Equation software, which is an add-in to word that can convert MathType to Microsoft Equation 3.x (and to the new equation format in Word 2007, but that does not help us). The nice thing is that OpenOffice.org can convert Microsoft Equation objects.
The software is found at grindeq.com . It is not free, but comes with a trial version that allows 10 launches. I tried it on a fairly long and complicated document (15 pages, 70 equations) and it worked perfectly in OpenOffice.org Writer afterwards. Only too bad this costs money, as it should have been part of the MathType program itself (store in old format).
October 30, 2009
Mellel is finally there!
The word processor Mellel from the Israeli company Mellel has come out with a new version (2.7). Now it finally works with editable MathType equations. This is great news for people who want to use a word processor, but don`t care too much for using Microsoft Word on their Macs…
Enjoy!