'// example file for roundedpath() in roundedpath.asy\n' Comment

'// written by stefan knorr\n' Comment

'\n'          Text

'\n'          Text

'// import needed packages\n' Comment

'import'      Keyword
' '           Text
'roundedpath' Name.Function
';'           Punctuation
'\n'          Text

'\n'          Text

'// function definition\n' Comment

'picture'     Keyword.Type
' '           Text
'CreateKOOS'  Name.Function
'('           Punctuation
'real'        Keyword.Type
' '           Text
'Scale'       Name.Function
','           Punctuation
' '           Text
'string'      Keyword.Type
' '           Text
'legend'      Name.Function
')'           Punctuation
'               ' Text
'// draw labeled coordinate system as picture\n' Comment

'{'           Punctuation
'\n'          Text

'  '          Text
'picture'     Keyword.Type
' '           Text
'ReturnPic'   Name
';'           Punctuation
'\n'          Text

'  '          Text
'real'        Keyword.Type
' '           Text
'S'           Name.Variable
' '           Text
'='           Operator
' '           Text
'1.2'         Literal.Number.Float
'*'           Operator
'Scale'       Name.Function
';'           Punctuation
'\n'          Text

'  '          Text
'draw'        Name.Function
'('           Punctuation
'ReturnPic'   Name
','           Punctuation
' '           Text
'('           Punctuation
'('           Punctuation
'-'           Operator
'S'           Name.Variable
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
'-'           Operator
'-'           Operator
'('           Punctuation
'S'           Name.Variable
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
','           Punctuation
' '           Text
'bar'         Name.Function
' '           Text
'='           Operator
' '           Text
'EndArrow'    Name.Function
')'           Punctuation
';'           Punctuation
'         '   Text
'// x axis\n' Comment

'  '          Text
'draw'        Name.Function
'('           Punctuation
'ReturnPic'   Name
','           Punctuation
' '           Text
'('           Punctuation
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'-'           Operator
'S'           Name.Variable
')'           Punctuation
'-'           Operator
'-'           Operator
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'S'           Name.Variable
')'           Punctuation
')'           Punctuation
','           Punctuation
' '           Text
'bar'         Name.Function
' '           Text
'='           Operator
' '           Text
'EndArrow'    Name.Function
')'           Punctuation
';'           Punctuation
'         '   Text
'// y axis\n' Comment

'  '          Text
'label'       Name.Function
'('           Punctuation
'ReturnPic'   Name
','           Punctuation
' '           Text
'"$\\varepsilon$"' Literal.String
','           Punctuation
' '           Text
'('           Punctuation
'S'           Name.Variable
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
','           Punctuation
' '           Text
'SW'          Name.Variable
')'           Punctuation
';'           Punctuation
'             ' Text
'// x axis label\n' Comment

'  '          Text
'label'       Name.Function
'('           Punctuation
'ReturnPic'   Name
','           Punctuation
' '           Text
'"$\\sigma$"' Literal.String
','           Punctuation
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'SW'          Name.Variable
')'           Punctuation
';'           Punctuation
'                  ' Text
'// y axis label\n' Comment

'  '          Text
'label'       Name.Function
'('           Punctuation
'ReturnPic'   Name
','           Punctuation
' '           Text
'legend'      Name.Function
','           Punctuation
' '           Text
'('           Punctuation
'0.7'         Literal.Number.Float
'S'           Name.Variable
','           Punctuation
' '           Text
'-'           Operator
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'NW'          Name.Variable
')'           Punctuation
';'           Punctuation
'                 ' Text
"// add label 'legend' \n" Comment

'  '          Text
'return'      Keyword
' '           Text
'ReturnPic'   Name
';'           Punctuation
'                                         ' Text
'// return picture\n' Comment

'}'           Punctuation
'\n'          Text

'\n'          Text

'\n'          Text

'// some global definitions\n' Comment

'real'        Keyword.Type
' '           Text
'S'           Name.Variable
' '           Text
'='           Operator
' '           Text
'13'          Literal.Number.Integer
'mm'          Name.Variable
';'           Punctuation
'                          ' Text
'// universal scale factor for the whole file\n' Comment

'real'        Keyword.Type
' '           Text
'grad'        Name
' '           Text
'='           Operator
' '           Text
'0.25'        Literal.Number.Float
';'           Punctuation
'                       ' Text
'// gradient for lines\n' Comment

'real'        Keyword.Type
' '           Text
'radius'      Name.Function
' '           Text
'='           Operator
' '           Text
'0.04'        Literal.Number.Float
';'           Punctuation
'                     ' Text
"// radius for the rounded path'\n" Comment

'real'        Keyword.Type
' '           Text
'lw'          Name
' '           Text
'='           Operator
' '           Text
'2'           Literal.Number.Integer
';'           Punctuation
'                            ' Text
'// linewidth\n' Comment

'pair'        Keyword.Type
' '           Text
'A'           Name
' '           Text
'='           Operator
' '           Text
'('           Punctuation
'-'           Operator
'1'           Literal.Number.Integer
','           Punctuation
' '           Text
'-'           Operator
'1'           Literal.Number.Integer
')'           Punctuation
';'           Punctuation
'                      ' Text
'// start point for graphs\n' Comment

'pair'        Keyword.Type
' '           Text
'E'           Name.Variable
' '           Text
'='           Operator
' '           Text
'('           Punctuation
' '           Text
'1'           Literal.Number.Integer
','           Punctuation
'  '          Text
'1'           Literal.Number.Integer
')'           Punctuation
';'           Punctuation
'                      ' Text
'// end point for graphs\n' Comment

'path'        Keyword.Type
' '           Text
'graph'       Name.Function
';'           Punctuation
'                             ' Text
'// local graph\n' Comment

'pen'         Keyword.Type
' '           Text
'ActPen'      Name
';'           Punctuation
'                             ' Text
'// actual pen for each drawing\n' Comment

'picture'     Keyword.Type
' '           Text
'T'           Name
'['           Punctuation
']'           Punctuation
';'           Punctuation
'                            ' Text
'// vector of all four diagrams\n' Comment

'real'        Keyword.Type
' '           Text
'inc'         Name
' '           Text
'='           Operator
' '           Text
'2.8'         Literal.Number.Float
';'           Punctuation
'                         ' Text
'// increment-offset for combining pictures\n' Comment

'\n'          Text

'//////////////////////////////////////// 1st diagram\n' Comment

'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
' '           Text
'='           Operator
' '           Text
'CreateKOOS'  Name
'('           Punctuation
'S'           Name.Variable
','           Punctuation
' '           Text
'"$T_1$"'     Literal.String
')'           Punctuation
';'           Punctuation
'                                        ' Text
'// initialise T[1] as empty diagram with label $T_1$                  \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'A'           Name
';'           Punctuation
'                                                            ' Text
"//  # pointwise definition of current path 'graph'                    \n" Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'A'           Name
'.'           Punctuation
'x'           Name
' '           Text
'+'           Operator
' '           Text
'grad'        Name
'*'           Operator
'1.6'         Literal.Number.Float
','           Punctuation
' '           Text
'A'           Name
'.'           Punctuation
'y'           Name
' '           Text
'+'           Operator
' '           Text
'1.6'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                         ' Text
'//  #                                                                 \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'E'           Name.Variable
'.'           Punctuation
'x'           Name
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.4'         Literal.Number.Float
','           Punctuation
' '           Text
'E'           Name.Variable
'.'           Punctuation
'y'           Name
' '           Text
'-'           Operator
' '           Text
'0.4'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                         ' Text
'//  #                                                                 \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'E'           Name.Variable
';'           Punctuation
'                                                   ' Text
'//  #\n'     Comment

'\n'          Text

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'roundedpath' Name.Function
'('           Punctuation
'graph'       Name.Function
','           Punctuation
' '           Text
'radius'      Name.Function
','           Punctuation
' '           Text
'S'           Name.Variable
')'           Punctuation
';'           Punctuation
'                                ' Text
"// round edges of 'graph' using roundedpath() in roundedpath.asy      \n" Comment

'ActPen'      Name
' '           Text
'='           Operator
'  '          Text
'rgb'         Name.Function
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0.6'         Literal.Number.Float
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'lw'          Name
')'           Punctuation
';'           Punctuation
'                               ' Text
'// define pen for drawing in 1st diagram                              \n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'                   ' Text
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw 'graph' with 'ActPen' into 'T[1]' (1st hysteresis branch)     \n" Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'rotate'      Name.Function
'('           Punctuation
'180'         Literal.Number.Integer
','           Punctuation
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
'*'           Operator
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw rotated 'graph' (2nd hysteresis branch)                       \n" Comment

'\n'          Text

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'grad'        Name
'*'           Operator
'0.6'         Literal.Number.Float
','           Punctuation
' '           Text
'0.6'         Literal.Number.Float
')'           Punctuation
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
' '           Text
'('           Punctuation
'grad'        Name
'*'           Operator
'0.6'         Literal.Number.Float
','           Punctuation
' '           Text
'0.6'         Literal.Number.Float
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'('           Punctuation
'0.1'         Literal.Number.Float
','           Punctuation
' '           Text
'0'           Literal.Number.Integer
')'           Punctuation
' '           Text
')'           Punctuation
';'           Punctuation
'   '         Text
'// define branch from origin to hysteresis\n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'roundedpath' Name.Function
'('           Punctuation
'graph'       Name.Function
','           Punctuation
' '           Text
'radius'      Name.Function
','           Punctuation
' '           Text
'S'           Name.Variable
')'           Punctuation
';'           Punctuation
'                                ' Text
'// round this path                        \n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                                            ' Text
"// draw this path into 'T[1]'             \n" Comment

'\n'          Text

'\n'          Text

'//////////////////////////////////////// 2nd diagram\n' Comment

'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
' '           Text
'='           Operator
' '           Text
'CreateKOOS'  Name
'('           Punctuation
'S'           Name.Variable
','           Punctuation
' '           Text
'"$T_2$"'     Literal.String
')'           Punctuation
';'           Punctuation
'                                        ' Text
'// initialise T[2] as empty diagram with label $T_2$              \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'A'           Name
';'           Punctuation
'                                                            ' Text
"//  # pointwise definition of current path 'graph'                \n" Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'A'           Name
'.'           Punctuation
'x'           Name
' '           Text
'+'           Operator
' '           Text
'grad'        Name
'*'           Operator
'1.3'         Literal.Number.Float
','           Punctuation
' '           Text
'A'           Name
'.'           Punctuation
'y'           Name
' '           Text
'+'           Operator
' '           Text
'1.3'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                         ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'E'           Name.Variable
'.'           Punctuation
'x'           Name
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.7'         Literal.Number.Float
' '           Text
','           Punctuation
' '           Text
'E'           Name.Variable
'.'           Punctuation
'y'           Name
' '           Text
'-'           Operator
' '           Text
'0.7'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                        ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'E'           Name.Variable
';'           Punctuation
'                                                   ' Text
'//  #\n'     Comment

'                                                                                                \n' Text

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'roundedpath' Name.Function
'('           Punctuation
'graph'       Name.Function
','           Punctuation
' '           Text
'radius'      Name.Function
','           Punctuation
' '           Text
'S'           Name.Variable
')'           Punctuation
';'           Punctuation
'                                ' Text
"// round edges of 'graph' using roundedpath() in roundedpath.asy      \n" Comment

'ActPen'      Name
' '           Text
'='           Operator
'  '          Text
'rgb'         Name.Function
'('           Punctuation
'0.2'         Literal.Number.Float
','           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0.4'         Literal.Number.Float
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'lw'          Name
')'           Punctuation
';'           Punctuation
'                             ' Text
'// define pen for drawing in 2nd diagram                              \n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'                   ' Text
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw 'graph' with 'ActPen' into 'T[2]' (1st hysteresis branch)     \n" Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'rotate'      Name.Function
'('           Punctuation
'180'         Literal.Number.Integer
','           Punctuation
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
'*'           Operator
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw rotated 'graph' (2nd hysteresis branch)                       \n" Comment

'\n'          Text

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'grad'        Name
'*'           Operator
'0.3'         Literal.Number.Float
','           Punctuation
' '           Text
'0.3'         Literal.Number.Float
')'           Punctuation
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
' '           Text
'('           Punctuation
'grad'        Name
'*'           Operator
'0.3'         Literal.Number.Float
','           Punctuation
' '           Text
'0.3'         Literal.Number.Float
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'('           Punctuation
'0.1'         Literal.Number.Float
','           Punctuation
' '           Text
'0'           Literal.Number.Integer
')'           Punctuation
' '           Text
')'           Punctuation
';'           Punctuation
'   '         Text
'// define branch from origin to hysteresis\n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'roundedpath' Name.Function
'('           Punctuation
'graph'       Name.Function
','           Punctuation
' '           Text
'radius'      Name.Function
','           Punctuation
' '           Text
'S'           Name.Variable
')'           Punctuation
';'           Punctuation
'                                ' Text
'// round this path                        \n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                                            ' Text
"// draw this path into 'T[2]'             \n" Comment

'\n'          Text

'\n'          Text

'//////////////////////////////////////// 3rd diagram\n' Comment

'T'           Name
'['           Punctuation
'3'           Literal.Number.Integer
']'           Punctuation
' '           Text
'='           Operator
' '           Text
'CreateKOOS'  Name
'('           Punctuation
'S'           Name.Variable
','           Punctuation
' '           Text
'"$T_3$"'     Literal.String
')'           Punctuation
';'           Punctuation
'                                        ' Text
'// initialise T[3] as empty diagram with label $T_3$              \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'A'           Name
';'           Punctuation
'                                                            ' Text
"//  # pointwise definition of current path 'graph'                \n" Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'A'           Name
'.'           Punctuation
'x'           Name
' '           Text
'+'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.7'         Literal.Number.Float
','           Punctuation
' '           Text
'A'           Name
'.'           Punctuation
'y'           Name
' '           Text
'+'           Operator
' '           Text
'0.7'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                         ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.3'         Literal.Number.Float
' '           Text
','           Punctuation
' '           Text
'-'           Operator
' '           Text
'0.3'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                               ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
';'           Punctuation
'                                               ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'grad'        Name
'*'           Operator
'0.6'         Literal.Number.Float
','           Punctuation
' '           Text
'0.6'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                                     ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'E'           Name.Variable
'.'           Punctuation
'x'           Name
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.4'         Literal.Number.Float
','           Punctuation
' '           Text
'E'           Name.Variable
'.'           Punctuation
'y'           Name
' '           Text
'-'           Operator
' '           Text
'0.4'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                         ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'E'           Name.Variable
';'           Punctuation
'                                                   ' Text
'//  #                                                             \n' Comment

'                                                                                                                                        \n' Text

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'roundedpath' Name.Function
'('           Punctuation
'graph'       Name.Function
','           Punctuation
' '           Text
'radius'      Name.Function
','           Punctuation
' '           Text
'S'           Name.Variable
')'           Punctuation
';'           Punctuation
'                                ' Text
"// round edges of 'graph' using roundedpath() in roundedpath.asy  \n" Comment

'ActPen'      Name
' '           Text
'='           Operator
'  '          Text
'rgb'         Name.Function
'('           Punctuation
'0.6'         Literal.Number.Float
','           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0.2'         Literal.Number.Float
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'lw'          Name
')'           Punctuation
';'           Punctuation
'                             ' Text
'// define pen for drawing in 3rd diagram                          \n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'3'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'                   ' Text
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw 'graph' with 'ActPen' into 'T[3]' (1st hysteresis branch) \n" Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'3'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'rotate'      Name.Function
'('           Punctuation
'180'         Literal.Number.Integer
','           Punctuation
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
'*'           Operator
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw rotated 'graph' (2nd hysteresis branch)                   \n" Comment

'\n'          Text

'\n'          Text

'//////////////////////////////////////// 4th diagram\n' Comment

'T'           Name
'['           Punctuation
'4'           Literal.Number.Integer
']'           Punctuation
' '           Text
'='           Operator
' '           Text
'CreateKOOS'  Name
'('           Punctuation
'S'           Name.Variable
','           Punctuation
' '           Text
'"$T_4$"'     Literal.String
')'           Punctuation
';'           Punctuation
'                                        ' Text
'// initialise T[4] as empty diagram with label $T_4$              \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'A'           Name
';'           Punctuation
'                                                            ' Text
"//  # pointwise definition of current path 'graph'                \n" Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'A'           Name
'.'           Punctuation
'x'           Name
' '           Text
'+'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.4'         Literal.Number.Float
','           Punctuation
' '           Text
'A'           Name
'.'           Punctuation
'y'           Name
' '           Text
'+'           Operator
' '           Text
'0.4'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                         ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.6'         Literal.Number.Float
' '           Text
','           Punctuation
' '           Text
'-'           Operator
' '           Text
'0.6'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                               ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
';'           Punctuation
'                                               ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'grad'        Name
'*'           Operator
'0.9'         Literal.Number.Float
','           Punctuation
' '           Text
'0.9'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                                     ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'('           Punctuation
'E'           Name.Variable
'.'           Punctuation
'x'           Name
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.1'         Literal.Number.Float
','           Punctuation
' '           Text
'E'           Name.Variable
'.'           Punctuation
'y'           Name
' '           Text
'-'           Operator
' '           Text
'0.1'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                         ' Text
'//  #                                                             \n' Comment

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'graph'       Name.Function
' '           Text
'-'           Operator
'-'           Operator
' '           Text
'E'           Name.Variable
';'           Punctuation
'                                                   ' Text
'//  #                                                             \n' Comment

'                                                                                                                                        \n' Text

'graph'       Name.Function
' '           Text
'='           Operator
' '           Text
'roundedpath' Name.Function
'('           Punctuation
'graph'       Name.Function
','           Punctuation
' '           Text
'radius'      Name.Function
','           Punctuation
' '           Text
'S'           Name.Variable
')'           Punctuation
';'           Punctuation
'                                ' Text
"// round edges of 'graph' using roundedpath() in roundedpath.asy  \n" Comment

'ActPen'      Name
' '           Text
'='           Operator
'  '          Text
'rgb'         Name.Function
'('           Punctuation
'0.6'         Literal.Number.Float
','           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'lw'          Name
')'           Punctuation
';'           Punctuation
'                               ' Text
'// define pen for drawing in 4th diagram                          \n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'4'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'                   ' Text
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw 'graph' with 'ActPen' into 'T[4]' (1st hysteresis branch) \n" Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'4'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'rotate'      Name.Function
'('           Punctuation
'180'         Literal.Number.Integer
','           Punctuation
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
'*'           Operator
'graph'       Name.Function
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                          ' Text
"// draw rotated 'graph' (3nd hysteresis branch)                   \n" Comment

'\n'          Text

'\n'          Text

'// add some labels and black dots to the first two pictures\n' Comment

'pair'        Keyword.Type
' '           Text
'SWW'         Name
' '           Text
'='           Operator
' '           Text
'('           Punctuation
'-'           Operator
'0.8'         Literal.Number.Float
','           Punctuation
' '           Text
'-'           Operator
'0.6'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'\n'          Text

'label'       Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'"$\\sigma_f$"' Literal.String
','           Punctuation
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
' '           Text
'0.6'         Literal.Number.Float
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'NE'          Name.Variable
')'           Punctuation
';'           Punctuation
'                             ' Text
'// sigma_f\n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
' '           Text
'0.6'         Literal.Number.Float
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'3'           Literal.Number.Integer
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'black'       Name.Variable
')'           Punctuation
';'           Punctuation
'\n'          Text

'label'       Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'"$\\sigma_f$"' Literal.String
','           Punctuation
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
' '           Text
'0.3'         Literal.Number.Float
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'NE'          Name.Variable
')'           Punctuation
';'           Punctuation
'                             ' Text
'// sigma_f\n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
' '           Text
'0.3'         Literal.Number.Float
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'3'           Literal.Number.Integer
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'black'       Name.Variable
')'           Punctuation
';'           Punctuation
'\n'          Text

'label'       Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'"$\\varepsilon_p$"' Literal.String
','           Punctuation
' '           Text
'('           Punctuation
'0.7'         Literal.Number.Float
'S'           Name.Variable
','           Punctuation
' '           Text
'0'           Literal.Number.Integer
')'           Punctuation
','           Punctuation
' '           Text
'SWW'         Name
')'           Punctuation
';'           Punctuation
'                       ' Text
'// epsilon_p\n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'('           Punctuation
'0.75'        Literal.Number.Float
'S'           Name.Variable
','           Punctuation
' '           Text
'0'           Literal.Number.Integer
')'           Punctuation
','           Punctuation
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'3'           Literal.Number.Integer
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'black'       Name.Variable
')'           Punctuation
';'           Punctuation
'\n'          Text

'label'       Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'"$\\varepsilon_p$"' Literal.String
','           Punctuation
' '           Text
'('           Punctuation
'0.7'         Literal.Number.Float
'S'           Name.Variable
','           Punctuation
' '           Text
'0'           Literal.Number.Integer
')'           Punctuation
','           Punctuation
' '           Text
'SWW'         Name
')'           Punctuation
';'           Punctuation
'                       ' Text
'// epsilon_p\n' Comment

'draw'        Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
' '           Text
'('           Punctuation
'0.75'        Literal.Number.Float
'S'           Name.Variable
','           Punctuation
' '           Text
'0'           Literal.Number.Integer
')'           Punctuation
','           Punctuation
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'3'           Literal.Number.Integer
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'black'       Name.Variable
')'           Punctuation
';'           Punctuation
'\n'          Text

'\n'          Text

'\n'          Text

'// add all pictures T[1...4] to the current one\n' Comment

'add'         Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'1'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'('           Punctuation
'0'           Literal.Number.Integer
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
';'           Punctuation
'\n'          Text

'add'         Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'2'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'('           Punctuation
'1'           Literal.Number.Integer
'*'           Operator
'inc'         Name
'*'           Operator
'S'           Name.Variable
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
';'           Punctuation
'\n'          Text

'add'         Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'3'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'('           Punctuation
'2'           Literal.Number.Integer
'*'           Operator
'inc'         Name
'*'           Operator
'S'           Name.Variable
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
';'           Punctuation
'\n'          Text

'add'         Name.Function
'('           Punctuation
'T'           Name
'['           Punctuation
'4'           Literal.Number.Integer
']'           Punctuation
','           Punctuation
'('           Punctuation
'3'           Literal.Number.Integer
'*'           Operator
'inc'         Name
'*'           Operator
'S'           Name.Variable
','           Punctuation
'0'           Literal.Number.Integer
')'           Punctuation
')'           Punctuation
';'           Punctuation
'\n'          Text

'\n'          Text

'\n'          Text

'// draw line of constant \\sigma and all intersection points with the graphs in T[1...4]\n' Comment

'ActPen'      Name
' '           Text
'='           Operator
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'1'           Literal.Number.Integer
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'dashed'      Name.Variable
' '           Text
'+'           Operator
' '           Text
'gray'        Name.Function
'('           Punctuation
'0.5'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                           ' Text
'// pen definition\n' Comment

'draw'        Name.Function
'('           Punctuation
'('           Punctuation
'-'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
'-'           Operator
'-'           Operator
'('           Punctuation
'('           Punctuation
'3'           Literal.Number.Integer
'*'           Operator
'inc'         Name
'+'           Operator
'1'           Literal.Number.Integer
')'           Punctuation
'*'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'                    ' Text
'// draw backgoundline\n' Comment

'label'       Name.Function
'('           Punctuation
'"$\\sigma_s$"' Literal.String
','           Punctuation
' '           Text
'('           Punctuation
'-'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'S'           Name.Variable
')'           Punctuation
','           Punctuation
' '           Text
'W'           Name.Variable
')'           Punctuation
';'           Punctuation
'                            ' Text
"// label 'sigma_s'\n" Comment

'\n'          Text

'path'        Keyword.Type
' '           Text
'mark'        Name
' '           Text
'='           Operator
' '           Text
'scale'       Name.Function
'('           Punctuation
'2'           Literal.Number.Integer
')'           Punctuation
'*'           Operator
'unitcircle'  Name.Variable
';'           Punctuation
'                                  ' Text
'// define mark-symbol to be used for intersections\n' Comment

'ActPen'      Name
' '           Text
'='           Operator
' '           Text
'linewidth'   Name.Function
'('           Punctuation
'1'           Literal.Number.Integer
')'           Punctuation
' '           Text
'+'           Operator
' '           Text
'gray'        Name.Function
'('           Punctuation
'0.5'         Literal.Number.Float
')'           Punctuation
';'           Punctuation
'                                    ' Text
'// define pen for intersection mark\n' Comment

'draw'        Name.Function
'('           Punctuation
'shift'       Name.Function
'('           Punctuation
'('           Punctuation
' '           Text
'1'           Literal.Number.Integer
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.55'        Literal.Number.Float
' '           Text
'+'           Operator
' '           Text
'0'           Literal.Number.Integer
'*'           Operator
'inc'         Name
')'           Punctuation
'*'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
'*'           Operator
'mark'        Name
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'         '   Text
'//  # draw all intersections\n' Comment

'draw'        Name.Function
'('           Punctuation
'shift'       Name.Function
'('           Punctuation
'('           Punctuation
'-'           Operator
'1'           Literal.Number.Integer
' '           Text
'+'           Operator
' '           Text
'grad'        Name
'*'           Operator
'1.45'        Literal.Number.Float
' '           Text
'+'           Operator
' '           Text
'0'           Literal.Number.Integer
'*'           Operator
'inc'         Name
')'           Punctuation
'*'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
'*'           Operator
'mark'        Name
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'         '   Text
'//  #\n'     Comment

'draw'        Name.Function
'('           Punctuation
'shift'       Name.Function
'('           Punctuation
'('           Punctuation
' '           Text
'1'           Literal.Number.Integer
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.55'        Literal.Number.Float
' '           Text
'+'           Operator
' '           Text
'1'           Literal.Number.Integer
'*'           Operator
'inc'         Name
')'           Punctuation
'*'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
'*'           Operator
'mark'        Name
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'         '   Text
'//  #\n'     Comment

'draw'        Name.Function
'('           Punctuation
'shift'       Name.Function
'('           Punctuation
'('           Punctuation
' '           Text
'1'           Literal.Number.Integer
' '           Text
'-'           Operator
' '           Text
'grad'        Name
'*'           Operator
'0.55'        Literal.Number.Float
' '           Text
'+'           Operator
' '           Text
'2'           Literal.Number.Integer
'*'           Operator
'inc'         Name
')'           Punctuation
'*'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
'*'           Operator
'mark'        Name
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'         '   Text
'//  # \n'    Comment

'draw'        Name.Function
'('           Punctuation
'shift'       Name.Function
'('           Punctuation
'('           Punctuation
'     '       Text
'grad'        Name
'*'           Operator
'0.45'        Literal.Number.Float
' '           Text
'+'           Operator
' '           Text
'2'           Literal.Number.Integer
'*'           Operator
'inc'         Name
')'           Punctuation
'*'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
'*'           Operator
'mark'        Name
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'         '   Text
'//  # \n'    Comment

'draw'        Name.Function
'('           Punctuation
'shift'       Name.Function
'('           Punctuation
'('           Punctuation
'     '       Text
'grad'        Name
'*'           Operator
'0.45'        Literal.Number.Float
' '           Text
'+'           Operator
' '           Text
'3'           Literal.Number.Integer
'*'           Operator
'inc'         Name
')'           Punctuation
'*'           Operator
'S'           Name.Variable
','           Punctuation
' '           Text
'0.45'        Literal.Number.Float
'*'           Operator
'S'           Name.Variable
')'           Punctuation
'*'           Operator
'mark'        Name
','           Punctuation
' '           Text
'ActPen'      Name
')'           Punctuation
';'           Punctuation
'         '   Text
'//  #\n'     Comment
