RasMol: A Classic Tool for Molecular Visualization

In questo articolo descrivo come ho usato per molti anni il programma di visualizzazione molecolare Rasmol per delle esercitazioni pratiche di chimica generale presso l’Università dell’Aquila (Italia). Le esercitazioni consistevano nella visualizzazione di strutture cristallografiche di sistemi molecolari e nella misura di alcune proprietà geometriche. Per questo scopo è stato usato Rasmol controllato da un’interfaccia, scritta nel linguaggio Tcl/Tk, che permetteva di selezionare la struttura molecolare da visualizzare.

RasMol è uno tra i programmi più diffusi per la visualizzazione di strutture molecolari. Esso è liberamente distribuito e nel sito web (http://www.rasmol.org) è possibile ottenere il codice sorgente e gli eseguibili per i sistemi operativi Linux, MS Windows e Mac OS. Il programma ha un’ottima documentazione in lingua inglese. In questa pagina sono fornite le istruzioni necessarie per usare il programma per l’esercitazione. I lettori interessati sono comunque invitati ad esplorare le potenzialità di questo programma, installandolo sul proprio computer.

Continue reading

Retro Programming Nostalgia VI: Exploring the Hyperspace

Henk Rogers: Um, I like Pascal. Assembler is my go-to. But never underestimate…
Alexey Pajitnov: …the power of BASIC.

From the movie Tetris (2023).

It has been a long while that I wanted to write this article. The usual motivation is to propose another of my BASIC programming explorations performed in the 80s on my Philips MSX VG-8010 and Amiga 500 microcomputer. The exploration was encouraged by the reading of another of the brilliant articles by A. K. Dewdney in his column “Ricreazioni al Calcolatore” (Computer Recreation) of Le Scienze, the edition in Italian of Scientific American [1]. Dewdney’s article was inspired by the beautiful book by Thomas F. Banchoff [2] who pioneered in the early 1990s the study using computer graphics of hyperdimensional objects.

Continue reading

Easter 2024: Dinosaur Eggs, Kinder Surprise, Drug Capsules, Jumping Beans Toy and Retro programming

Oh my God. Do you know what this is? This is a dinosaur egg. The dinosaurs are breeding.

Dr. Alan Grant, Jurassic Park movie (1993)

We are again approaching Easter time and, as tradition, I would like to celebrate with an article dedicated to the most perfect thing in nature: the egg. I came across interesting books about the discovery of dinosaur eggs last year. Dinosaurs are the ancestors of birds and modern reptiles, so we will take a little detour from the traditional Easter egg, and with the spirit of equal opportunity justice, we will look at the shape of these.

Continue reading

Retro Programming Nostalgia V: Phase Plane of Autonomous Planar System of DE

What is the origin of the urge, the fascination that drives physicists, mathematicians, and presumably other scientists as well? Psychoanalysis suggests that it is sexual curiosity. You start by asking where little babies come from, one thing leads to another, and you find yourself preparing nitroglycerine or solving differential equations. This explanation is somewhat irritating, and therefore probably basically correct. David Ruelle, in Chance and Chaos

Here I am again for a new appointment with the Italian version of the column “Retro Programming Nostalgia“, my very own adventure in computer archaeology, rediscovering old programs written some time ago on microcomputers that have made their mark on an era.

This time, in my old floppy disks for the glorious Amiga 500, I found a program in Amiga Basic that I wrote during the early years of my university studies, when I was taking the course on differential equations II. Specifically, I was very fascinated by autonomous systems of differential equations due to their numerous applications in mathematical modeling of physical, chemical, and biological systems, as well as their importance in the theory of chaos. As in the series articles, I want to release an adapted version for the QB64 BASIC meta-compiler, but before presenting the program, I want to briefly explain what an autonomous system of differential equations is.

Continue reading

Retro Programming Nostalgia V: Sistemi Autonomi di Equazioni differenziali

“Qual è l’origine del desiderio, della fascinazione che spinge i fisici, i matematici e presumibilmente anche altri scienziati? La psicoanalisi suggerisce che si tratti di curiosità sessuale. Si comincia chiedendosi da dove vengano i bambini piccoli, una cosa porta all’altra e ci si ritrova a preparare il nitroglicerina o a risolvere equazioni differenziali. Questa spiegazione è un po’ irritante, e quindi probabilmente fondamentalmente corretta.” – David Ruelle, in “Chance and Chaos”

Eccomi di nuovo per un nuovo appuntamento con la versione in italiano della Rubrica “Retro Programming Nostalgia “, la mia personalissima avventura d’ archeologia informatica alla riscoperta di vecchi programmi scritti qualche tempo fa su microcomputers che hanno segnato un’epoca.

Questa volta, nei miei vecchi dischetti per il glorioso Amiga 500, ho trovato un programma in Amiga Basic che scrissi durante i primi anni dei miei studi universitari, quando studiavo nel corso di matematica II, i sistemi d’equazioni differenziali. In particolare, ero molto affascinato dai sistemi di equazioni differenziali autonomi per via delle molteplici applicazioni nella modellazione matematica di sistemi fisici, chimici e biologici, e per la loro importanza nella teoria del caos. Come negli articoli della serie, voglio rilasciare una versione riadattata per il meta compilatore QB64 BASIC, ma prima di presentare il programma, voglio brevemente spiegare cosa sia un sistema autonomo di equazioni differenziali.

Continue reading

Programming in Awk Language. LiStaLiA: Little Statistics Library in Awk. Part II

This article describes a new function of the LiStaLiA library. As I mentioned in Part I of this series of articles, I didn’t extensively test the library, so I am releasing it as an alpha version. Please let me know if you find any errors or if you improve the function, and feel free to send me your modified code!

CALCULATING STATISTICS PROPERTIES OF DATA SETS

The new functions perform a statistical analysis of the data set read by the function ReadData(). The source code of this new library functions is reported in the Appendix. The following list report all the descriptor calculated buy the functions.

Continue reading

Unix C-Shell Programming Notes: Part II

This is the second part of this series of notes on the advanced use of the Unix shell. The first part can be accessed by following the link. In this second part, I will show some advanced examples I wrote for my research activity.

1. CHANGE FILE NAMES SCRIPT

I wrote this script to change the default names of the files generated during a molecular dynamics simulation by the program mdrun in the early version of the GROMACS package for MD simulation. GROMACS is a widely used software package for simulating the behavior of molecules and molecular systems. Although it is now possible to define the root name of the files upon running the simulation program, this script can still be helpful. The script is written in the C Shell (csh) .

 #! /bin/csh -ef
#
# Change the names of the default  output Files
# generated by the program GROMACS mdrun program
#
# (c) Danilo Roccatano
#######
#
#Define the radix of the files name
#
setenv RADIX  'EH_min'

if (-e md.log) then
   if (  -e $RADIX'.log')  then 
     echo Warning $RADIX'.log' exist
   else
     mv md.log            $RADIX'.log'
   endif
else
   echo The md.log file does not exist!
endif

if (-e ener.ene) then
  if (  -e 'e'$RADIX'.ene') then 
   echo Warning 'e'$RADIX'.ene' exist
  else
    mv ener.ene       'e'$RADIX'.ene'
  endif
else
  echo The energy file does not exist
endif

if (-e ctraj.xtc ) then
  if ( -e 'r'$RADIX'.xtc') then 
    echo Warning 'r'$RADIX'.xtc' exist
  else
    mv ctraj.xtc      'r'$RADIX'.xtc'
  endif
else
  echo The compressed trajectory file does not exist
endif

if (-e confout.gro) then
  if ( -e 'x'$RADIX'.gro') then 
    echo Warning 'x'$RADIX'.gro' exist
  else
    mv confout.gro    'x'$RADIX'.gro'
  endif
else
  echo The final configuration file does not exit.
  echo Probably your simulation crashed before the end 
endif
 
exit
Continue reading

Introducing the Mini LED Table: Compact, Affordable, and Enhanced With Computer Vision

How many times have you found yourself looking at your cake decorations, wondering how many pearls are left in the box? Have you ever tried to count how many mustard, basil or pepper plants you can grow with the seeds you have in stock? And what about the urge to know the exact number of millimeter stainless steel balls you recently purchased at your favorite DIY store?
For this purpose, some scrap cardboard, a strip of LEDs, and a Raspberry Pi Zero with its tiny chamber might help satisfy your mathematical desire to enumerate these tiny objects.
In a recent article on Instructables, we detailed the eye-opening experience with all the construction details of a compact, battery-powered, easy-to-use, and affordable mini LED table (MTL). In addition to the hardware, an open source software based on OpenCv is also strengthened for the acquisition and simple processing of the images of the objects on the MTL for possible applications.

Continue reading

Introduzione alla programmazione in Python (III)

Puntate precedenti:

  1. Introduzione alla programmazione in Python (I)
  2. Introduzione alla programmazione in Python (II)

Siamo giunti alla terza parte di questa serie dove vedremo come usare le istruzion condizionali per il controllo del flusso del programma.

DIAGRAMMI DI FLUSSO

Per una descrizione più semplice e intuitiva dei commandi per il controllo del programma, verranno utilizzati diagrammi di flusso. Un diagramma di flusso è un tipo di diagramma (grafico o simbolico) che rappresenta un algoritmo o un processo. Ogni passo nel processo è rappresentato da un simbolo diverso e contiene una breve descrizione del passo del processo. I simboli del diagramma di flusso sono collegati tra loro con frecce che mostrano la direzione del flusso del processo. Un diagramma di flusso mostra tipicamente il flusso dei dati in un processo, dettagliando le operazioni/passi in un formato pittorico che è più facile da capire rispetto alla lettura di un formato testuale.

Continue reading

Retro programming Nostalgia IV: Acid/Base Equilibrium and Titration (Part I)

The motivation for this article stems from my interest in retro-computing connected, on the one hand, to the re-evaluation of my youthful explorations of scientific computing in the BASIC language and, on the other, to the popularity they are having in the amateur sector in recent years and of teaching, single-board microcomputers (single-board computers, such as, for example, the Raspberry Pi). These small computers have considerably more power at a much lower cost than the microcomputers of the 80s. This made it possible to emulate the operating systems of the legendary Commodore home computer models and the MSX extension on these computers.

Therefore, a renewed interest in the BASIC programming language is also occurring. This interest in retro-computing reflects the nostalgia for the great emotions that the development of consumer information technology brought to my generation in the 1970s and 1980s. I remember being so struck by the creativity in using and programming these microcomputers that it redirected my scientific interests and academic career. I have written in other articles about my first programming adventures with Commodore home computers and MSX systems in the late 80s and early 90s and my rediscoveries in computer archaeology. Among the exhibits, I found a small program I used to study acid/base titrations developed in MSX BASIC. Therefore, I took the opportunity to write notes on acid-base balance and titration and thus provide a restored and improved version of my program to students passionate about programming and grappling with this important concept of analytical chemistry.

Continue reading