Capture video of your desktop using online apps

ScreenToaster is a nice java apps to capture video of your desktop. I just tried it and use it for one of my presentation. I need to demo the steps of running a simulation to my manager, and ScreenToaster is just nice for that.

OpenModelica simulate with small time step

I am currently exploring OpenModelica for some simulation that requires high frequency. It turns out that the plot of a sine source is always wrong. This is the test code:

model testfreq
parameter Real f1=1e10;
Real u;
equation
u=sin(2*3.14*f1*time);
end testfreq;

simulate(testfreq,stopTime=10e-10)
plot(u)

The Forum was very helpful. It turns out that the default solver for OpenModelica is dassl, and it has some problem for small time step simulation.

sjoelund.se suggested to use “euler” or “dassl2″ for the solver, and it works! To do this simply add method=”euler” in the simulate command,

simulate(testfreq,stopTime=10e-10,method="euler")

Installing SimForge 0.9

1. Download using subversion:

$ svn co https://svn.ws.dei.polimi.it/simforge-anonymous/trunk simforge-0.9

2. Create local copies of setting files:

$ cd simforge-0.9
$ cp .classpath.template .classpath
$ cp settings.xml.template .settings.xml
$ cp .simforge/properties.template .simforge/properties

3. Run eclipse with JDT
4. click File|Import
5. Expand the “General” node and click on “Existing Projects into Workspace”.
6. Choose simforge-0.9 as the root directory and click finish.
7. Select the project name, and then click on Project|Properties.
8. Select the “Java Build Path” and click on the “Libraries” tab.
9. Select “htmlconverter.jar”, click on edit, and browse to the /lib directory of your Java 6 JDK installation. Do the same with “jconsole.jar” and “tools.jar”. In order to find the directory in Linux, type “locate htmlconverter.jar”. In my ubuntu 10.04, it is located at /usr/lib/jvm/java-6-sun/lib/
10. Click on Project|Clean.
11. Click on Project|Build.
12. open the “SimForge” node, open the “(default package)” node, right-click on the main class Start.java, then select “Run As” “Java Application”.

Check this link on building a stand-alone application.

Building libmico CORBA

SimForge requires libmico path in the LD_LIBRARY_PATH. I downloaded mico from: http://www.mico.org/

However, when I type make, I came across this problem:
fast_array.cc:51: error: 'UINT_MAX' was not declared in this scope

I found the solution from this forum
Basically I needed to include limits.h in “orb/fast_array.cc”

Scicos: a Simulink alternative

check out scicos for a simulink alternatives. What I like is that we can add our own block and code it using fortran or scilab language.

scicos.org

Move multiple files using python

Move multiple files using python. Download
$ mvmult.py [common] [targetcommon]

e.g. to move field1.dat, field2.dat, … to fieldref1.dat, fieldref2.dat,…, use the following command:
$ mvmult.py field field*.dat fieldref

The command simply replacing the [common] string in list by [targetcommon].

Creating a linear integer array in fortran using implied DO loop


program linarr
implicit none
integer:: idx, min, max, interval
integer,dimension(5)::myarray
min=1
max=10
interval=2
myarray=(/ (idx, idx=min,max,interval) /)
write(*,*) myarray
end program linarr