Berechnung der Konstante von Madelung

Die gesamte Coulomb-Potentialenergie eines Kristalls ist die Summe der einzelnen Terme der elektrostatischen Potentialenergie

\displaystyle V_{AB} = \frac{e^2}{4\pi\epsilon_0} \frac{Z_AZ_B}{r_{AB}} \hfill (1)

zum Laden von Ionen  {q_A} e {q_B} und  getrennt nach Entfernung {r_{AB}}.

Die Summe erstreckt sich auf alle im Festkörper vorhandenen Ionenpaare für alle kristallinen Strukturen.

Die Summe konvergiert sehr langsam, weil die ersten Nachbarn des Zentralatoms einen substanziellen Beitrag zur Summe mit einem negativen Term liefern, während die benachbarten Sekunden nur mit einem etwas weicheren positiven Term beitragen, und so weiter. Auf diese Weise wird der Gesamteffekt sicherstellen, dass eine totale Initation der Anziehung zwischen Kationen und Anionen vorherrscht mit einem (negativen) Beitrag, der für die Gesamtenergie günstig ist.

Eindimensionales unendliches Kristall

In einem eindimensionalen Gitter (Abbildung 1) mit Kationen und Anionen, die sich in konstanten Abständen der Länge d abwechseln, und mit {q_A = +Z} und {q_B = -Z} die Wechselwirkung eines Ions mit allen anderen ist proportional zu einer Reihe des Typs:

V = -\frac{2Z^2}{d} + \frac{2Z^2}{2d} - \frac{2Z^2}{3d} + \frac{2Z^2}{4d} - ...

= -\frac{2Z^2}{d} \left(1 -\frac{1}{2} +\frac{1}{3} -\frac{1}{4} + ... \right)  

= -\frac{2Z^2}{d} \ln 2

Faktor 2 rührt von der Tatsache her, dass es auf beiden Seiten des Zentralions gleiche Ionen gibt. Die Summe hängt nur vom Typ des Gitters und von einem Skalierungsparameter (Periodizität) ab, der der Abstand (d) zwischen benachbarten Partikelzentren ist

\displaystyle V = -\frac{e^2}{4\pi\epsilon_0} \frac{Z^2}{d} (2 \ln 2) \hfill (2)

Daher besagt die Formel, dass die potentielle Energie durch einen Faktor definiert wird, der von der Ladung der Ionen und der Gitterskala abhängt, $ latex {\ frac {Z ^ 2} {d}} $ und die numerische Konstante A = 2ln2 ( = 1.3862944), genannt Madelung-Costante, verbunden mit der Symmetrie des Kristallgittertyps.

OneDimRet

Abbildung  1: Eindimensionales unendliches Gitter.

Unendlich zweidimensionales Kristall

In einem zweidimensionalen Gitter mit Kationen und Anionen mit $ latex Ladung {q_A = + Z} $ und $ latex {q_B = -Z} $ und regelmäßig auf zusammenhängenden Quadraten mit konstanten Seitenlängen gleich (d) angeordnet.
Die gesamte Wechselwirkungsenergie des zentralen Ions in Abbildung 2 mit allen anderen Gitterionen kann berechnet werden, indem alle Wechselwirkungsterme addiert werden, die durch radiales Bewegen vom Zentrum erhalten werden.
Die resultierende Reihe ist gegeben durch den Ausdruck:

 V = -\frac{4Z^2}{d} + \frac{4Z^2}{\sqrt{2} d} - \frac{8Z^2}{\sqrt{5} d} + \frac{4Z^2}{2\sqrt{2} d} + \frac{4Z^2}{2 d} ...

 = -\frac{4Z^2}{d} \left(1 -\frac{1}{\sqrt{2}} +\frac{2}{\sqrt{5}} -\frac{1}{2\sqrt{2}} + \frac{1}{2 } ... \right)

reticolo2d

Abbildung  2: Unendlich zweidimensionales Gitter.

Unendlicher dreidimensionaler Kristall

Diese Ergebnisse können auf dreidimensionale Muster erweitert werden. In einfachen Festkörpern ist die Konstante von Madelung spezifisch für den Typ des Kristalls und unabhängig von interionischen Abständen.

ThreeDimRetNaCl

Abbildung  3: Unendlich dreidimensionales Gitter (NaCl).

Um die Madelung-Konstante für das zentrale dreidimensionale Kristallatom in Abbildung 3 zu berechnen, betrachten wir zunächst benachbarte Ionen mit der gleichen Ladung {n_1} und in der Entfernung {d_1}. Wenn wir radial fortfahren, erreichen wir die nächsten Nachbarn mit der entgegengesetzten Ladung gleich {n_2} und in einer Entfernung {d_2} und so weiter. Madelung’sche Konstante kann daher als folgende unendliche Summe ausgedrückt werden:

\displaystyle A = \sum_i \left(-sgn(q_A q_B)\right) n_i \frac{1}{(d_i/d)} \hfill (3)

wobei {-sgn (q_A q_B)} anzeigt, dass das Vorzeichen jedes Summenterms positiv ist, wenn die Ionen eine entgegengesetzte Ladung haben (Anziehung) und negativ, wenn sie die gleiche Ladung (Abstoßung) und d = r^{+} + r ^{-} ist die Summe der Ionenstrahlen.

Beispiel

Betrachten wir als Beispiel ein Na {^ +} Ion in NaCl, das so nahe Nachbarn ions Cl ^ - ({n_1} = 6) zum Abstand {d_1 = d} hat. Dann gibt es 12 Latex-Ionen Na ^ {+} nahe Sekunden ({n_2 = 12} ) in der Entfernung {d_2 = d \sqrt(2)} ; 8 Ionen Cl ^ {-} sind die benachbarten Drittel ({n_3 = 8} ) in der Entfernung {d_3 = d \sqrt(3)} , und so weiter. Wir werden dann die Serie haben:

\displaystyle A = + 6 - \frac{12}{\sqrt 2} + \frac{8}{\sqrt 3} - ... \hfill (4)

Die gesamte potentielle Energie pro Mol Formeleinheiten in einer beliebigen kristallinen Struktur ist:

\displaystyle V = - A N_A \frac{e^2}{4\pi\epsilon_0} \frac{Z_AZ_B}{d} \hfill(5)

Tabelle 1: Madelung-Konstanten einiger Feststoffe

Struktur A A / N * Koordination
CsCl 1763 0,88 (8,8)
Steinsalz 1748 0,87 (6,6)
Fluorit (CaF) 2519 0,84 (8,4)
Wurtzit (ZnS) 1641 0,82 (4,4)
CdCl 2244 0,75 (6,3)
CdI 2191 0,73 (6,3)

* n ist die Anzahl der Ionen pro Formel.

Die ständige Madelung wächst mit zunehmender Koordination. Der wichtigste Beitrag kommt von den ersten Nachbarn. Die Werte für die NaCl-Struktur (6.6) und den CsCl (8.8) -Typ verdeutlichen den Trend.

Posted in Science Topics | Leave a comment

La Serie​ di Taylor

La serie di Taylor è un utilissimo strumento matematico ma a volte difficile da comprendere per gli studenti. In questo blog, ne darò una breve descrizione dando qualche esempio di applicazione.

Chi è il signor Taylor?

Brook Taylor (1685 – 1731) era un matematico britannico del XVII secolo che ha dimostrato la formula che porta il suo nome, e l’argomento di questo blog, nel volume Methodus Incrementorum Directa et Inversa (1715). Maggiori informazioni si possono trovare nella corrispondente pagina della wikipedia.

Il Teorema di  Taylor

Sia k ≥ 1 un numero intero e lascia che la funzione f : RR sia k volte differenziabile nel punto aR. Allora esiste una funzione h k : RR tale che

f(x)=f(a)+f^{(1)}(a)(x-a)+\frac{f^{(2)}(a)}{2!}(x-a)^2+\frac{f^{(3)}(a)}{3!}(x-a)^3 +\dots +\frac{f^{(k)}(a)}{k!}(x-a)^k + h_k(x)(x-a)^k

Il polinomio della serie è chiamato polinomio Taylor di ordine- k :

 P_k(x)=\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!}(x-a)^k

la differenza, $R_k(x)$, della serie rispetto alla funzione $f(x)$ è data dalla relazione

 R_k(x)=f(x)-P_k(x),

che dà l’errore nell’approssimare f(x) con il polinomio di Taylor, che può essere scritta anche nella forma:

R_k(x)=o(|x-a|^k),  x\rightarrow a.

La serie MacLaurin

La serie di Taylor fu ampiamente usata dal matematico scozzese Colin MacLaurin (1698-1746) per caratterizzare i massimi, minimi e punti d’inflessione per funzioni infinitamente differenziabili nel suo Treatise of Fluxions. Per i suoi contributi allo sviluppo di questo importante strumento matematico, quando viene usata l’espressione generale data a=0 . la serie è anche chiamata serie Maclaurin.

Un esempio: l’espansione di \cos (x)

La serie MacLaurin per il cos(x) la funzione è data dall’espressione:

\cos x = 1- \frac{x^2}{2!} + \frac{x^4}{4!} + \dots = \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k)!}x^{2k}.

Nei seguenti pannelli viene riportata l’espansione per k = 1, 2, 3, 6 e 10 termini (il programma per generare queste figure si trova nel corrispondente blog in Inglese). La funzione è mostrata in rosso, la serie in nero e la differenza in colore blu.

 

Alcuni esempi di serie di MacLaurin

Alcune delle serie Maclaurin comunemente usate includono:

e^x  = 1+ x+ \frac{x^2}{2!} + + \frac{x^3}{3!} + \dots = \sum_{n=0}^{\infty} \frac{x^n}{n!},

\sin x = x-\frac{x^3}{3!} + \frac{x^5}{5!} - \dots = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!}x^{2n+1},

\frac{1}{1+x} = 1- x+x^2 - \dots, \text{for } |x| <1

\ln(1+x) = x- \frac{x^2}{2}+\frac{x^3}{3} - \dots, \text{for } |x| <1

È possibile utilizzare il programma citato precedentemente per esplorare graficamente le serie di MacLaurin di alcune di queste funzioni.

Serie di Taylor multivariata

La serie di Taylor può essere facilmente generalizzata alle funzioni a più variabili. Per esempio si prenda in considerazione il f:\mathbf{R^2}\rightarrow \mathbf{R^2} , k volte differenziabile nel punto (a,b) \in \mathbf{R^2}. L’espansione di Taylor per k = 4 è data dalla espressione:

f(x,y)=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b)+\frac{1}{2!}\left[f_{xx}(a,b) (x-a)^2+ 2f_{xy}(a,b) (x-a)(y-b)+f_{yy}(a,b)(y-a)^2\right]+\frac{1}{3!}\left[f_{xxx}(a,b)(x-a)^3+3f_{xxy}(a,b)(x-a)^2(y-b)+3f_{xyy}(a,b)(x-a)(y-b)^2 +f_{yyy}(a,b)(y-a)^3\right]+\frac{1}{4!}\left[f(x,y)_{xxxx}(x-a)^4+4f_{xxxy}(x-a)^3(y-b)+6f_{xxyy}(x-a)^2(y-b)^2+f_{yyyx}(x-a)(y-b)^3 + f_{yyyy}(y-b)^4\right]

Un esempio

Vediamo come esempio la funzione

F(x,y)=\cos(x) \cos(y)

Il secondo ordine della serie di Taylor è dato da

f(x,y)= F(a,b)+\sin(x)\cos(y)(x-a) + \cos(x)\sin(y)(y-b)+\frac{1}{2!}\left[-\cos(x)\cos(y) (x-a)^2+ 2\sin(x)\sin(y)(x-a)(y-b) -\cos(x)\cos(y)(y-b)^2\right] + \frac{1}{3!}\left[ \sin(x)\cos(y)(x-a)^3+3\cos(x)\sin(y)(x-a)^2(y-b)+3\sin(x)\cos(y)(x-a)(y-b)^2+\cos(x)\sin(y)(y-b)^3\right] + \frac{1}{4!}\left[\cos(x)\cos(y)(x-a)^4-4\sin(x)\sin(y)(x-a)^3(y-b)+6\cos(x)\cos(y)(x-a)^2(y-b)^2-\sin(x)\sin(y)(x-a)(y-b)^3 + \cos(x)\cos(y)(y-b)^4\right]

Nel caso della serie di MacLaurin con (a,b)\equiv(0,0) la precedente espressione si riduce a

f(0,0)= 1-\frac{1}{2}\left[(x)^2 + (y)^2\right]+\frac{1}{24}\left[ x^4 +x^2y^2+y^4\right]

Nella Figura 2 vengono mostrati la funzione e la serie di MacLaurin troncata al secondo ordine.

 

2D

Figura 2: La funzione F(x,y) è mostrata come una griglia forata, mentre la sua approssimazione al secondo ordinedi MacLaurin  come superfice continua colorata secondo il valore della coordinata z. Il grafico è stato prodotto usando il programma Grapher. 

Nella Figura 3 viene mostrata anche l’approssimazione al quarto ordine della serie. Si noti che il terzo ordine della espansione non contribuisce alla serie in quanto le derivate parziali calcolate a (0,0) sono nulle.

 

2D4order

Figura 3: La funzione F(x,y) è mostrata come una superficie a griglia forata, mentre la sua approssimazione, al quarto ordine di MacLaurin,  come superfice continua colorata secondo il valore della coordinata z.

 

 

 

 

Posted in Uncategorized | Leave a comment

The Taylor Series

The Taylor series is a mathematical tool that, sometimes, it is not easy to immediately grasp by freshman students. In this blog, I will give a short review of it giving some examples of applications.

Who is Mr. Taylor?

Brook Taylor (1685 – 1731) was a 17th-century British mathematician. He demonstrated the celebrated Taylor formula, the topics of this blog, in his masterwork Methodus Incrementorum Directa et Inversa (1715). For more information, just give a read to the following wiki page.

The Taylor Theorem

Let k ≥ 1 be an integer and let the function f : RR be k times differentiable at the point aR. Then there exists a function hk : RR such that

f(x)=f(a)+f^{(1)}(a)(x-a)+\frac{f^{(2)}(a)}{2!}(x-a)^2+\frac{f^{(3)}(a)}{3!}(x-a)^3 +\dots +\frac{f^{(k)}(a)}{k!}(x-a)^k + h_k(x)(x-a)^k

The polynomial in the series is called k-th order Taylor polynomial:

 P_k(x)=\sum_{k=0}^{\infty} \frac{f^{(k)}(a)}{k!}(x-a)^k.

The difference of the series with respect the funzion $f(x) is given by the relation

 R_k(x)=f(x)-P_k(x),

which gives the error in the approximation of f(x) with the Taylor polynomial. Using the little-o notation, the statement in Taylor’s theorem reads as

R_k(x)=o(|x-a|^k),  x\rightarrow a.

The MacLaurin Series

The work developed by Taylor was promtly adopted by the Scottish mathematician Colin MacLaurin (1698–1746) that used Taylor series to characterize maxima, minima, and points of inflection for infinitely differentiable functions in his Treatise of Fluxions. For his contributions to the development of this important mathematical tool, when the general expression given is used with a=0. the series is also called Maclaurin series.

An example: the cos(x) expansion

The MacLaurin series for the cos(x) function is given by the expression:

\cos x = 1- \frac{x^2}{2!} + \frac{x^4}{4!} + \dots = \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k)!}x^{2k}.

In the following panels the expansion for k=1, 2, 3, 6 and 10 terms are reported (see appendix for the program). The function is shown in red, the series in black and the difference in blue colour.

 

Some examples of MacLaurin series

Some of commonly used Maclaurin series include:

e^x  = 1+ x+ \frac{x^2}{2!} + + \frac{x^3}{3!} + \dots = \sum_{n=0}^{\infty} \frac{x^n}{n!},

\sin x = x-\frac{x^3}{3!} + \frac{x^5}{5!} - \dots = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!}x^{2n+1},

\frac{1}{1+x} = 1- x+x^2 - \dots, \text{for } |x| <1

\ln(1+x) = x- \frac{x^2}{2}+\frac{x^3}{3} - \dots, \text{for } |x| <1

You can use the program in the Appendix I to graphically explore the MacLaurin series of some these function

Multivariate Taylor Series

The Taylor series can be easily generalized to the multivariate functions. For example let consider the  f:\mathbf{R^2}\rightarrow \mathbf{R^2}k times differentiable at the point (a,b) \in \mathbf{R^2}. The Taylor expansion for k=3 is given by

f(x,y)=f(a,b)+f_x(a,b)(x-a)+f_y(a,b)(y-b)+\frac{1}{2!}\left[f_{xx}(a,b) (x-a)^2+ 2f_{xy}(a,b) (x-a)(y-b)+f_{yy}(a,b)(y-a)^2\right]+\frac{1}{3!}\left[f_{xxx}(a,b)(x-a)^3+3f_{xxy}(a,b)(x-a)^2(y-b)+3f_{xyy}(a,b)(x-a)(y-b)^2 +f_{yyy}(a,b)(y-a)^3\right]+\frac{1}{4!}\left[f(x,y)_{xxxx}(x-a)^4+4f_{xxxy}(x-a)^3(y-b)+6f_{xxyy}(x-a)^2(y-b)^2+f_{yyyx}(x-a)(y-b)^3 + f_{yyyy}(y-b)^4\right]

An example

Let see as an example the function

F(x,y)=\cos(x) \cos(y)

The fourth order Taylor series is given by

f(x,y)= F(a,b)+\sin(x)\cos(y)(x-a) + \cos(x)\sin(y)(y-b)+\frac{1}{2!}\left[-\cos(x)\cos(y) (x-a)^2+ 2\sin(x)\sin(y)(x-a)(y-b) -\cos(x)\cos(y)(y-b)^2\right] + \frac{1}{3!}\left[ \sin(x)\cos(y)(x-a)^3+3\cos(x)\sin(y)(x-a)^2(y-b)+3\sin(x)\cos(y)(x-a)(y-b)^2+\cos(x)\sin(y)(y-b)^3\right] + \frac{1}{4!}\left[\cos(x)\cos(y)(x-a)^4-4\sin(x)\sin(y)(x-a)^3(y-b)+6\cos(x)\cos(y)(x-a)^2(y-b)^2-\sin(x)\sin(y)(x-a)(y-b)^3 + \cos(x)\cos(y)(y-b)^4\right]

In the case of the MacLaurin series (a,b)\equiv(0,0) so that for the above expansion reduce to

f(0,0)= 1-\frac{1}{2}\left[(x)^2 + (y)^2\right]+\frac{1}{24}\left[ x^4 +x^2y^2+y^4\right]

In  Figure 2, the function and its second order approximation approximation is shown.

2D

Figure 2: The function F(x,y) is shown as the hollow grid and its second-order approximation at (0,0) as a continuous surface. The plot was made using the  MacOSX program Grapher.

In Figure 3, the MacLaurin surface including also the 4th order approximation terms is shown. Note that the third order expansion does not contribute to the series since all the third order partial derivatives calculated at (0,0) are equal to zero.

2D4order

Figure 3: The function F(x,y) is shown as the hollow grid and its fourth-order approximation at (0,0) as a continuous surface. The plot was made using the  MacOSX program Grapher.

 

APPENDIX

A program to explore MacLaurin series of functions in one variable

The following program in TCL/TK language allows to calculates and compares the first terms of a MacLaurin series of some transcendent functions.

#! /bin/sh
# the next line restarts using wish \
exec wish "$0" "$@"

# root is the parent window for this user interface

package require Tk

wm title . ""
tk_setPalette cyan3

# Define some variables
# this treats "." as a special case
set root "."

set base ""
set maxX 500
set maxY 500
set width 0
set height 0
set midX 0
set midY 0

set rmin -1.0
set rmax 1.0
set ymax 5.
set ymin -5.
set np 500
set nt 1
set lfuncts "exp(x)"

# Define global variables

global nt width height dcc lfuncts maxX maxY

#############################################################################
## Procedures
# Some of the procedure are adapted from: http://wiki.tcl.tk/15073
#
#############################################################################

proc fact n {expr {$n<2? 1: $n * [fact [incr n -1]]}}

proc ClrCanvas {w } {
global dcc
global rmin rmax width height ymax ymin midX midY

$w delete "all"
set dcc 0
DrawAxis $w
}

proc DrawAxis {w} {

global rmin rmax width height ymax ymin midX midY maxX maxY

set midX [expr { $maxX / 2 }]
set midY [expr { $maxY / 2 }]
set incrX [expr { ($maxX -50) /10 }]
set incrY [expr { $maxY /11 }]
# puts "$midX $midY"

$w create line 0 $midY $width $midY -tags "Xaxis" -fill black -width 1
$w create line $midX 0 $midX $height -tags "Yaxis" -fill black -width 1
$w create text [expr $midX-20] 20 -text "Y"
$w create text [expr $width-20] [expr $midY+20] -text "X"
}

proc DrawFn w {

#
# Plot the sunflover florets
#

global cc np nt
global rmin rmax width height ymax ymin midX midY lfuncts maxX maxY

ClrCanvas .cv
# puts "$lfuncts"
if {$lfuncts == "exp(x)"} {
set rmin -1.0
set rmax 1.0
set ymax 5.
set ymin -5.
} else {
set rmin -3.1415*2
set rmax 3.1415*2
set ymax 1.
set ymin -1.
}
if {$lfuncts == "sinh(x)"} {
set rmin -3.1415/2
set rmax 3.1415/2
set ymax 3.
set ymin -3.
}

set divy [expr ($ymax-$ymin)/$maxY ]
set divx [expr ($rmax-$rmin)/$maxX ]
set asp_ratio 1.
set x $rmin

DrawAxis $w
for { set n 1 } { $n <= $np } { incr n 1 } {

set x [expr $x+$divx]
set xp [expr $midX+ $x/$divx]

if {$lfuncts == "exp(x)"} {
set y [expr exp($x)]
set ys 1.0
for { set m 1} {$m <= $nt} { incr m 1} {
set ys [expr $ys + pow($x,$m)/([fact $m])]
}
}
if {$lfuncts == "sin(x)"} {
set y [expr sin($x)]
set ys 0
for { set m 0} {$m <= $nt} { incr m 1} {
set kk [expr 2*$m+1]
set sign [expr pow(-1,$m)]
set ys [expr $ys + $sign*pow($x,$kk)/([fact $kk])]
}
}
if {$lfuncts == "cos(x)"} {
set y [expr cos($x)]
set ys 1
for { set m 1} {$m <= $nt} { incr m 1} {
set kk [expr 2*$m]
set sign [expr pow(-1,$m)]
set ys [expr $ys + $sign*pow($x,$kk)/([fact $kk])]
}
}
if {$lfuncts == "atan(x)"} {
set y [expr atan($x)]
set ys 0
for { set m 0} {$m <= $nt} { incr m 1} {
set kk [expr 2*$m+1]
set sign [expr pow(-1,$m)]
set ys [expr $ys + $sign*pow($x,$kk)/($kk)]

}
}
if {$lfuncts == "sinh(x)"} {
set y [expr sinh($x)]
set ys 0
for { set m 0} {$m  1} {
.cv create line $x0 $y1 $xp $yp -tags "Exact" -fill red -width 2
.cv create line $x0 $y2 $xp $ysp -tags "approx" -fill black -width 1
.cv create line $x0 $y3 $xp $re -tags "resid" -fill blue -width 1
}
set y1 $yp
set y2 $ysp
set y3 $re
set x0 $xp

}

}

###############################################################################################
#
# Main with the setup up of the GUI
###############################################################################################

# Row 1
label $base.label#12 \
-background magenta -padx 64 -relief raised -text {MacLaurin Series Calculator (c) Danilo Roccatano 2002-2018}

# Row 2

label $base.label#1 -background green -relief groove -text "Functions: "
ttk::combobox $base.functions -textvariable lfuncts

.functions configure -values [list exp(x) sin(x) cos(x) atan(x) sinh(x)]

# row 3

label $base.terms -background cyan -relief groove -text "Number of terms:" -bg cyan
entry $base.nt -cursor {} -textvariable nt -bg white

# row 5

canvas $base.cv -bg white -height $maxY -width $maxX

# row 6

button $base.plot -text PLOT -command { DrawFn .cv }
button $base.b0 -text "Clear" -command { ClrCanvas .cv }
button $base.b1 -text "EXIT" -command { exit -1}

text $base.t -width 50 -height 5 -wrap word -bg gray90

.t insert end "Select the function and the number of terms of its MacLaurin expansion.\n
The function is plotted in red, the approximation in black and the residual in blue lines."

#
# Add contents to grid
#

# Row 1

grid $base.label#12 -in $root -row 1 -column 1 -columnspan 4 -sticky nesw
# Row 2
grid $base.label#1 -in $root -row 2 -column 1 -sticky nesw
grid $base.functions -in $root -row 2 -column 2 -sticky nesw

grid $base.terms -in $root -row 4 -column 1 -sticky nesw
grid $base.nt -in $root -row 4 -column 2 -sticky nesw

# Row 9 (Canvas)

grid $base.cv -in $root -row 5 -column 1 -columnspan 4 -sticky nesw

# Row 10

grid $base.t -in $root -row 6 -column 1 -columnspan 4 -sticky nesw

grid $base.b0 -in $root -row 7 -column 1
grid $base.plot -in $root -row 7 -column 2
grid $base.b1 -in $root -row 7 -column 4

# additional interface code

bind $base.nt  {DrawFn .cv }

update

# end additional interface code

set width [winfo width .cv ]
set height [winfo height .cv ]

DrawFn .cv


Posted in Uncategorized | 1 Comment

Modeling Natural Shapes: Sunflowers Florets and the Golden Ratio

Il girasole piega a occidente
e già precipita il giorno nel suo
occhio in rovina … 
from the poem  “Quasi un madrigale” by Salvatore Quasimodo.

 

Continue reading

Posted in Programming, Science Topics | Leave a comment

Modeling Natural Shapes: Seashells

O conchiglia marina, figlia
della pietra e del mare biancheggiante,
tu meravigli la mente dei fanciulli.

La conchiglia di Alceo. (Traduzione di Salvatore Quasimodo, da Lirici greci, 1940) 

 

Continue reading

Posted in Uncategorized | Leave a comment

Physical Chemistry: The Simple Hückel Method

The Hückel molecular orbital method is a quantum mechanics approach for calculating the energies of molecular orbitals of π electrons in conjugated hydrocarbon systems, such as ethylene, benzene, and butadiene. Continue reading

Posted in Science Topics | Leave a comment

Retro Programming II: the Amiga and the computational beauty of the leaf

In my archeological exploration of old computer files, I came across to another simple but interesting Amiga Basic program that I programmed in 1989. It is named “Foglie”, the Italian name for leaves. Continue reading

Posted in Leonardo's Corner, Programming | Leave a comment