MADYMO Example

explicit time                               // Time is request #0
assume linear                               // All requests take up one line
requests "Component"                        // In the GUI, use Madymo
components "Channel"                        // nomenclature
header                                      // Read file header
                                            // Begin block
    set mark                                // Remember file position
    if                                      // Begin conditional
                                            // Begin block
        read strict "A\.G"                  // Read first three characters and check
    } then                                  // End block; if true, proceed
    {                                       // Begin block
        read strict "FAIL!"                 // It's a graphics file, so reject
    }                                       // End block
    rewind                                  // Go back to previous mark
    set precision = 9                       // Set numeric precision for I/O
    set units = 1000                        // Set time units to milliseconds
    type "MADYMO Results"                   // Set default type for requests
    types "//LINDIS/Relative Displacement"  // Set type based on file name
    types "//LINVEL/Linear Velocities"
    types "//LINACC/Linear Acceleration"
    types "//ANGVEL/Angular Velocity"
    types "//ANGACC/Angular Acceleration"
    types "//FORCES/Force"
    types "//TORQU1/Torque"
    types "//TORQU2/Torque"
    types "//RELDIS/Relative Displacement"
    types "//DISVEL/Distance"
    types "//REACTF/Force"
    types "//CARANG/Angle"
    types "//FLEANG/Angle"
    types "//PENETR/Penetration"
    types "//RELONG/Relative Elongation"
    types "//TORQU3/Torque"
    types "//AXLOAD/Axial Load"
    types "//REACTT/Torque"
    set mark                                // Remember position
    readln null                             // Skip two lines (read and discard)
    readln null
    read strict "[0-9]+ "                   // Check for integer in file
    rewind                                  // Return to previous mark
    readln null                             // Skip two lines again
    readln null
    read numrequests                        // Read the number of requests
    readln numcomponents                    // Read the number of components
    do numrequests                          // For each request (except time)
                                            // Begin block
        readln longname                     // Read next request name
    }                                       // End block
    do numcomponents                        // For each component
                                            // Begin block
        readln compname                     // Read next component name
    }                                       // End block
    set start                               // indicate position where data starts
    readln strict "[+-]*[0-9]*\.[0-9]*"     // Check for a floating point number
}                                           // End block

record                                      // Read a record
                                            // Begin block
    readln time                             // Read in time (only one component)
    do numrequests                          // For each other request
                                            // Begin block
        readln request                      // Read a request
    }                                       // End block
}                                           // End block

request                                     // Read a request
                                            // Begin block
    do numcomponents                        // For each component
                                            // Begin block
        read component                      // Read a component
    }                                       // End block
}                                           // End block