Il Mini Tavolo LED: Illumina l’Universo dei Dettagli Nascosti!

Quante volte ti sei trovato a guardare le tue decorazioni per i dolci, chiedendoti quante perle rimangono nella scatola? Hai mai provato a contare quante piante di senape, basilico o pepe puoi coltivare con i semi che hai in magazzino? E cosa dire dell’urgenza di conoscere il numero esatto delle sfere in acciaio inossidabile da un millimetro che hai recentemente acquistato nel tuo negozio di fai-da-te preferito?
Per questo scopo, un po’ di cartone di recupero, una striscia di LED e un Raspberry Pi Zero con la sua piccola camera potrebbero aiutare a soddisfare il tuo desiderio matematico di enumerare questi oggetti minuscoli.
In un recente articolo su Instructables, abbiamo descritto l’ illuminante esperienza con tutti i dettagli costruttivi di un mini tavolo LED (MTL) compatto, alimentato a batteria, facile da usare e conveniente. Oltre all’hardware viene fortito anche un software opensource basato su OpenCv per l’acquisizione e la semplice elaborazione delle immagini degli oggetti sul MTL per possibili applicazioni.

Caratteristiche principali del progetto:

  • Un tavolo a LED compatto, portatile ed economico realizzato con un foglio di cartone di imballaggio e una striscia di LED bianchi.
  • Può essere alimentato alimentato da una batteria elettrica e ha un dimmer per regolare l’intensità della luce.
  • È dotato di una camera Raspberry Pi per acquisire le immagini (con la distanza focale modificata per mettere a fuoco oggetti vicini).
  • Il software in Python fornito come OpenSource consente di controllare la camera e di elaborare le immagini per contare gli oggetti sul tavolo.

L’articolo originale (in inglese) del MTL si trova sul mio sito Instructables.

L’articolo contiene le istruzioni dettagliate e i file STL per la stampa 3D dei componenti necessari. Il progetto è stato realizzato in collaborazione con i miei due cari collaboratori, in particolare Leonardo. È un progetto semplice e accessibile che può essere utilizzato anche a scopo educativo per imparare concetti di costruzione, elettronica, ottica e programmazione.

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

Easter 2023: Superquadric and Squared-Eggs

First there was the Great Cosmic Egg.

Huai-nan Tzu, China 100 BCE 

Another Easter is arriving, and here I am for a new article on old friends: the Eggs. In my blog for Easter 2021, I mentioned squared eggs paraphrasing a sentence attributed to the extraordinary jeweler Peter Carl Fabergé:” This year, your Highness, we will be featuring square eggs.” A hen is unlikely to make a cubic-shaped egg, but we can still transform a cooked egg to get the cuboid shape. If you look for squared eggs on the internet, you will find a tool called the egg cuber that does the magic. Unfortunately, I could not yet try one, but it seems to be doing an excellent job from the reviews. The shape of the egg is not a perfect cube but a cuboid, namely a cube with rounded corners. In my previous article, I anticipated that this shape could be obtained using the superquadric function. Curiouser and curiouser! In this article, I will give a bit of mathematical background and even a source code to play with such a function as my Easter Bunny gift.

Continue reading

FORTRAN Programming (PART III): NUMERICAL DIFFERENTIATION

In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.

Hugo Rossi. Mathematics Is an Edifice, Not a Toolbox, Notices of the AMS, v. 43, no. 10, October 1996.

Welcome to the third part is the third part of the essential introduction to the FORTRAN programming series. In this part, we will introduce the use of functions and subroutines to structure the programs. Then we use them to make a program to calculate numerical derivatives of mathematical functions.

Continue reading

Numeric Solutions of the Schrödinger equation

For Schrödinger, the atom was an oscillating system — like the string of a musical instrument — for which there exist a number of modes of oscillation (fundamentals and overtones) which are interpreted as the atom’s energy states.

Armin Hermann. Werner Heisenberg 1901-1976.

This set of slides is from one of my courses in Computational Chemistry. It covers the one-dimensional solution of the Schrödinger equation using Numerov’s method. The material for this article was mainly taken from the excellent Levin textbook in the reference.
If you are interested in more details, please like it and subscribe to my website. This way, I will be motivated to add more of these contents.

Continue reading

FORTRAN Programming: A Basic Introduction (PART II)

In college, before video games, we would amuse our- selves by posing programming exercises. One of the favorites was to write the shortest self-reproducing program. Since this is an exercise divorced from reality, the usual vehicle was FORTRAN. Actually, FORTRAN was the language of choice for the same reason that three-legged races are popular.

Ken Thompson, Communications of the ACM. 27 (8), 761–763, 1984.

This is the second part of the basic introductin to FORTRAN programming series.

Control Statements 

Relational operators

Relational operators are used for comparison between variables

< or .lt. : less than 

<= or .le. : less than or equal to 

> or .gt. : greater than 

>= or .ge. :greater than or equal to

== or .eq. : equal to  

/= or .ne. : not equal to

Logical operators

Logical operator are used to perfrom

.and. : Logical multiplication ( and) 

.or. : Logical addition (or) 

.not. : Logical negation (not)

Continue reading

FORTRAN Programming: A Basic Introduction (PART I)

In college, before video games, we would amuse our- selves by posing programming exercises. One of the favorites was to write the shortest self-reproducing pro- gram. Since this is an exercise divorced from reality, the usual vehicle was FORTRAN. Actually, FORTRAN was the language of choice for the same reason that three-legged races are popular.

Ken Thompson, Communications of the ACM. 27 (8), 761–763, 1984.

In December of last year, I celebrated the 30th anniversary of my Laurea in Chemistry dissertation. The starting of my thesis dissertation also signed my acquaintance to one of the grannies of the scientific programming languages, FORTRAN. Since then, I have used and (continue to) this language for my research activity by writing several thousands of lines of code. Therefore, I want to share some of my modest programming achievements using this language.

I will concisely introduce this captivating programming language in a series of articles. This is a primer on a programming language with much more to offer, especially in the new versions starting from the FORTRAN 90. Readers interested in deepening their knowledge in FORTRAN can find online many excellent tutorials and discussion groups, as well as plenty of excellent textbooks that have been written.

The FORTRAN language 

Fortran (FORmula TRANslation) language was introduced in 1957 and remains the language of choice for most scientific programming. The language was constantly restyled and updated (e.g. Fortran IV, Fortran 77). Recent improvements, recently introduced with the Fortran 90 and 95/2003, include several extensions in more modern languages (e.g. in the C language). Some of the most important features of Fortran 90/95 include recursive subroutines, dynamic storage allocation and pointers, user-defined data structures, modules, and the ability to manipulate entire arrays. Fortran 90 is compatible with Fortran 77 but not the other way around. However, the new Fortran language has evolved in a modern computer language by incorporating constructs from other languages.  

Continue reading

NATALE 2022: Il Trigesimo Anniversario della mia Tesi di Laurea

Mais à l’instant même où la gorgée mêlée des miettes du gâteau toucha mon palais, je tressaillis, attentif à ce qui se passait d’extraordinaire en moi. Un plaisir délicieux m’avait envahi, isolé, sans la notion de sa cause.

PROUST Marcel, Du côté de chez Swann.

Ci sono ricordi del passato che rievocano nostalgicamente piacevoli momenti nella nostra vita. Questi preziosi tesori sono, a volte, sepolti nella nostra mente o, come nel mio caso, in quella di dimenticati cristalli di ferrite. Come per dolcetti di Proust, il ritrovamento di queste vestigie ci fa rivivere le emozioni di un passato lontano. I ricordi di cui parlo sono quelle della mia tesi di Laurea in Chimica che dopo essere stata scritta e discussa fu poi dimenticata nella memoria artificiale di obsoleti supporti magnetici degli albori della rivoluzione digitale.

Discussi la mia tesi di laurea il 23 dicembre dell’anno 1992, era l’ultima sessione di laurea di quell’anno. A quell’epoca, non esisteva ancora la laurea triennale che fu introdotta in conformità con il processo di Bologna dall’anno scolastico 2001/2002. Il corso di laurea in chimica era quinquennale e si entrava in tesi nell’ultimo anno. La tesi sperimentale comportava un lavoro originale che doveva essere discusso di fronte a una commissione di laurea composta dai professori del dipartimento, i relatori e i controrelatori (coloro che dovevano leggere la tesi e valutare il lavoro di ricerca e la sua presentazione). Pertanto, la tesi di Laurea (come del resto l’equivalente tesi magistrale) era un’esperienza molto importante nel condizionare la scelta dello studente nell’avviarsi o meno in una carriera accademica. Nel mio caso, la tesi segnò la scelta di intraprendere la carriera dello scienziato e educatore.  Scelta che, come gli academici goliardici delle prime università europee, mi ha portato a peregrinare lontano dalla mia alma mater nelle lontane Università del nord Europa. Di fatti, questa prefazione è stata abbozzata a Brema in Germania e completata a Lincoln nel Regno Unito, a pochi chilometri dalla città che diede i natali a Isacco Newton.

Continue reading

Physical Chemistry: The Simple Hückel Method (Part VI): PREVIEW

LIST OF PREVIOUS LESSONS

Continue reading

Introduzione alla programmazione in Python (II)

In questa second parte, continuiamo la nostra esplorazione del linguaggio Python introducedo altri operatori e commandi per manipolare dati.

ESPRESSIONI LOGICHE E OPERATORI

Python dispone di operatori logici che consentono di costruire complesse espressioni logiche.

In Python, le espressioni logiche e gli operatori sono ampiamente utilizzati per la costruzione di complessi algoritmi di controllo di flusso dei dati in un programma.

Continue reading