Listing 1: Stage 1 in Tcl/Tk, duffing2.tcl

set k 0.05
set B 7.5
proc NewValue {Name Value} {
  puts "$Name [expr $Value]"
}
scale .k -variable k -label Damping    \
         -from  1.0 -to 0.0 -resolution 0.01 \
         -command "NewValue k"
scale .b -variable B -label Forcing    \
         -from 30.0 -to 0.0 -resolution 0.10 \
         -command "NewValue B"
pack .k .b  -side left