Guide to Coach 6

Transcription

Guide to Coach 6
This guide describes the use and all features of the Coach 6.3 program.
Amsterdam, March 2010, version 3
CMA Foundation
P.O. Box 94224, 1090 GE Amsterdam, The Netherlands
Telephone: +31 20 5255869
Fax: +31 20 5255866
E-mail: [email protected]
Internet: http://www.cma.science.uva.nl/english
© CMA
Text: Ewa Kędzierska, Vincent Dorenbos, Marijn van Eupen
André Heck contributed to the sections on perspective correction, point tracking and
signal analysis.
2
Contents at a glance
GENERAL INTRODUCTION......................................................................................................... 5
1. INTRODUCTION...................................................................................................................................................... 6
2. COACH AND HARDWARE ....................................................................................................................................... 6
3. INSTALLATION OF COACH 6 .................................................................................................................................. 7
4. CONTENT OF THIS MANUAL ................................................................................................................................... 9
FOR STUDENTS........................................................................................................................ 11
I. USER INTERFACE.................................................................................................................. 11
1. STARTING COACH ............................................................................................................................................... 12
2. COACH ACTIVITIES ............................................................................................................................................. 15
3. COACH APPLICATION WINDOWS AND PANES........................................................................................................ 19
4. MANAGING RESULTS .......................................................................................................................................... 28
II. DIAGRAMS AND TABLES...................................................................................................... 29
1. DIAGRAMS AND TABLES IN COACH ..................................................................................................................... 30
2. SPECIFIC DIAGRAM OPTIONS ................................................................................................................................ 39
3. SPECIFIC TABLE OPTIONS ..................................................................................................................................... 44
III. MEASUREMENT................................................................................................................... 51
1. INTRODUCTION.................................................................................................................................................... 52
2. THE PANEL WINDOW ........................................................................................................................................... 52
3. COMMUNICATION BETWEEN COMPUTER AND INTERFACE .................................................................................... 53
4. SENSORS ............................................................................................................................................................. 55
5. CALIBRATION ...................................................................................................................................................... 62
6. THE MEASUREMENT SETTINGS ............................................................................................................................ 66
7. MEASURING ........................................................................................................................................................ 72
8. SYNCHRONIZED MEASUREMENT AND VIDEO CAPTURE ........................................................................................ 73
9. REPLAY A MEASUREMENT ................................................................................................................................... 75
10. ADDITIONAL ACTIVITY OPTIONS FOR MEASUREMENT ACTIVITIES .................................................................... 75
IV. CONTROL............................................................................................................................ 77
1. INTRODUCTION.................................................................................................................................................... 78
2. ACTUATORS ........................................................................................................................................................ 78
3. THE PROGRAM WINDOW...................................................................................................................................... 82
4. CREATING PROGRAMS ......................................................................................................................................... 82
5. EDITING A PROGRAM ........................................................................................................................................... 85
6. EXECUTING A PROGRAM...................................................................................................................................... 86
7. ADDITIONAL ACTIVITY OPTIONS FOR CONTROL .................................................................................................. 87
V. DATA VIDEO......................................................................................................................... 89
1. INTRODUCTION.................................................................................................................................................... 90
2. DATA-VIDEO WINDOW ........................................................................................................................................ 91
3. OPENING A VIDEO/IMAGE .................................................................................................................................... 92
4. CAPTURE VIDEO .................................................................................................................................................. 93
5. EDITING VIDEO .................................................................................................................................................... 96
6. EXPORTING A VIDEO/IMAGE FILE......................................................................................................................... 99
7. PREPARING A VIDEO/IMAGE FOR MEASUREMENT............................................................................................... 101
8. DATA VIDEO MEASUREMENT............................................................................................................................ 105
9. DIAGRAMS AND TABLES .................................................................................................................................... 111
10. ADDITIONAL SETTINGS .................................................................................................................................... 112
VI. MODELING ........................................................................................................................ 115
1. INTRODUCTION.................................................................................................................................................. 116
2. THE MODEL WINDOW ........................................................................................................................................ 118
3. THE GRAPHICAL MODE ..................................................................................................................................... 118
3
4. EQUATIONS MODE ............................................................................................................................................. 126
5. TEXT MODE ....................................................................................................................................................... 129
6. MODEL EXECUTION ........................................................................................................................................... 132
7. SIMULATIONS .................................................................................................................................................... 134
8. MANAGEMENT OF MODELS................................................................................................................................ 135
9. CONSTRUCTING MODELS IN COACH LANGUAGE ............................................................................................... 135
VII. ANIMATION ...................................................................................................................... 139
1. INTRODUCTION.................................................................................................................................................. 140
2. THE ANIMATION PANE ...................................................................................................................................... 141
3. BACKGROUND PROPERTIES ............................................................................................................................... 145
4. ANIMATED OBJECTS PROPERTIES ....................................................................................................................... 148
5. CONTROL OBJECTS ............................................................................................................................................ 155
6. CREATING AND EDITING AN ANIMATION ........................................................................................................... 159
7. EXECUTING AN ANIMATION ............................................................................................................................... 160
8. MANAGEMENT OF ANIMATIONS ........................................................................................................................ 160
VIII. DATA PROCESSING AND ANALYSIS ............................................................................... 161
1. INTRODUCTION.................................................................................................................................................. 162
2. SELECT/REMOVE DATA..................................................................................................................................... 162
3. SMOOTH ............................................................................................................................................................ 163
4. DERIVATIVE ...................................................................................................................................................... 167
5. INTEGRAL .......................................................................................................................................................... 169
6. SLOPE ................................................................................................................................................................ 170
7. AREA................................................................................................................................................................. 171
8. FUNCTION FIT .................................................................................................................................................... 172
9. SIGNAL ANALYSIS ............................................................................................................................................. 174
10. STATISTICS ...................................................................................................................................................... 186
11. HISTOGRAM .................................................................................................................................................... 186
IX. COACH LANGUAGE........................................................................................................... 189
1. INTRODUCTION INTO COACH LANGUAGE .......................................................................................................... 190
2. NAMES AND NUMBERS ...................................................................................................................................... 190
3. EXPRESSIONS .................................................................................................................................................... 192
4. STATEMENTS ..................................................................................................................................................... 195
5. STANDARD FUNCTIONS AND PROCEDURES OF COACH LANGUAGE .................................................................... 198
6. ERROR MESSAGES IN COACH LANGUAGE .......................................................................................................... 204
FOR AUTHORS ....................................................................................................................... 207
X. AUTHORING ENVIRONMENT .............................................................................................. 207
1. USER LEVELS..................................................................................................................................................... 208
2. COACH PROJECTS .............................................................................................................................................. 209
3. COACH ACTIVITIES ........................................................................................................................................... 212
4. AUTHOR TOOLS ................................................................................................................................................. 217
5. CREATING AND EDITING SENSORS AND ACTUATORS .......................................................................................... 219
6. CREATING CUSTOMIZED PROGRAMMING ENVIRONMENT ................................................................................... 221
XI. UTILITY PROGRAMS .......................................................................................................... 231
1. RCX CONTROL PANEL ...................................................................................................................................... 232
2. FIRMWARE UPDATE .......................................................................................................................................... 234
3. ULAB VIEW ..................................................................................................................................................... 237
APPENDIX I. INTERFACE PANELS .......................................................................................... 239
APPENDIX II. COACH SHORTCUTS......................................................................................... 243
APPENDIX III. CONVERSION OF COACH 5 MATERIALS .......................................................... 245
4
General Introduction
Table of Contents
1. INTRODUCTION...................................................................................................................................................... 6
2. COACH AND HARDWARE ....................................................................................................................................... 6
3. INSTALLATION OF COACH 6 .................................................................................................................................. 7
3.1. System requirements ..................................................................................................................................... 7
3.2. Installation.................................................................................................................................................... 7
3.3. Coach 6 shortcuts ......................................................................................................................................... 7
4. CONTENT OF THIS MANUAL ................................................................................................................................... 9
5
1. Introduction
Already for a long time it has been clear to scientists that computers can be used to collect data,
to control experiments, to represent the data in visual forms, to analyze and process huge
amounts of data. In addition they can help to explore mathematical models and to compare the
resulting data of these models to the experimental data.
AMSTEL1 Institute of Universiteit van Amsterdam is for many years active in the integration
of the use of computers in Science and Technology Education.
Since 1987 the concept of an open learning environment has been developed. Such environment
should change the computer into instrument and give the science learner power to explore,
measure and learn from the physical world. It should offer scientific tools to investigate science.
These tools should be universal for using with many different curricula and should be structured
to encourage an inquiring approach to science.
Years of development based on this concept lead to the Coach 6 environment – a versatile
Learning and Authoring software, which:
• can be used in Science, Mathematics and Technology with many different curricula,
• integrates tools for Measurement, Control, Video measurement, Modeling, Animations and
Data processing,
• supports a variety of hardware platforms together with a wide range of sensors and actuators,
• offers a reach multimedia environment with text, pictures, videoclips, animations and
internet links,
• can be customized to be used by students starting at primary up to undergraduate level (age
10 to 20).
2. Coach and hardware
Measurement and Control Activities in Coach support the following interfaces:
• CMA €Sense, €Lab, €Motion, CoachLab I, CoachLab II/II+ and ULAB,
• Texas Instruments CBL, CBL2™ and CBR™,
• Vernier LabPro™,
• LEGO DACTA® Control Interface, RCX™ and NXT™.
In order to measure and control with Coach the interface must have been installed. The
installation program configures Coach 6 software to the hardware. The setting of the program
must match those made with the hardware. It is possible to change these settings also inside
Coach, see I. Coach User Interface, 1.2. Hardware setting.
User Manuals of interfaces give all technical details about the interfaces and their installations.
1
Amsterdam Mathematics Science and Technology Education Laboratory, the former Department of
Physics Education of Universiteit van Amsterdam
6
3. Installation of Coach 6
3.1. System requirements
Coach 6 can be installed on a PC with at least the following requirements:
• A processor which can be compared with Pentium 4, 2.4 GHz,
• 200 MB of free disk space,
• 512 MB RAM (1GB recommended),
• Screen resolution 800 x 600, 16 bit, (recommended 1024 x 768)
• Windows operating system: Win 2000/ Win XP /Win Vista (32 bits),
• DirectX version 9.0c,
• Internet Explorer version 6.0.
For use of the Vernier LabPro the installation of LabQuest and LabPro USB device driver (Win
XP/Win Vista/Win 7) or LabPro USB device driver (Win 2000) is required2.
For use of the LEGO NXT the installations of LEGO MINDSTORMS Education NXT v2.0
driver software3 and Microsoft .NET 2.02,4 are required.
3.2. Installation
To install Coach 6 use the provided Coach 6 CD or download the latest version via
www.cma.science.uva.nl/english/resources/installCoach6.html.
Follow the installation instructions from the Installation guide Coach 6.
3.3. Coach 6 shortcuts
During installation the group CMA Coach 6 will be created in the Windows’ Start menu. It has
the following shortcuts:
Author
Starting Coach 6 via this icon opens Coach 6 in Author mode which allows creating, modifying
and managing projects and activities. In this mode the program is protected with password, by
default the password is 0000 (see IX. Authoring environment). The all exemplary CMA Coach
projects are visible to Authors.
Student
Starting Coach 6 via icons under the Student folder opens Coach in Student mode.
1. Measurement
This shortcut starts Coach with CMA exemplary projects for Measurement. The following Coach
projects are available:
1. Mathematic Activities without Interface – with examples of Measurement Activities for
Mathematics. In these activities data are not collected via an interface but are typed in.
2. Measurements with CMA €Sense – with examples of Measurement Activities for the
€Sense interface and its temperature, light and sound sensors.
2
Can be downloaded via www.cma.science.uva.n/english, see Resources > Coach 6.
Not delivered by CMA. This driver is included in LEGO MINDSTORMS Education NXT v2.0 software.
4
For Win 2000 and Win XP only.
3
7
3. Measurements with CMA €Lab – with examples of Measurement Activities for the €Lab
interface and for temperature, light and sound sensors.
4. Measurements with CMA €Motion – with examples of Measurement Activities for the
€Motion USB sensor.
5. Measurements with CMA CoachLab II – with examples of Measurement Activities for
the CoachLab II/II+ interface and for different school subject Biology, Chemistry and
Physics.
6. Measurements with CMA ULAB – with examples of Measurement Activities for the
ULAB datalogger for different school subject Biology, Chemistry and Physics.
2. Control
This shortcut starts Coach with CMA exemplary projects for Control. The following projects are
available:
1. Examples of control programs for CMA €Sense - with examples of Control Activities for
the €Sense interface.
2. Examples of control programs for CMA CoachLab II - with examples of Control
Activities for the CoachLab II/II+ interface.
3. The Control Workshops - with Coach Activities offering open environments for different
interfaces allowing to design and program control systems.
3. Data Video
This shortcut starts Coach with CMA exemplary projects for Data Video. The following projects
are available:
1. Introduction to Data Video - with tutorial Activities to learn how to perform
measurements on videoclips and how to use advanced video tools.
2. Data Video Examples - with examples of Data Video Activities.
3. Introduction to Data Image - with tutorial Activities to learn how to perform
measurements on single images.
4. Data Image Examples - with examples of Data Image Activities.
4. Modeling
This shortcut starts Coach with CMA exemplary projects for Modeling. The following CMA
projects are available:
1. Introduction to Modeling - with tutorial Activities to learn how to create, modify and
execute models in Graphical, Equation and Text mode.
2. Biology Models - with examples of Modeling Activities for Biology.
3. Chemistry Models - with examples of Modeling Activities for Chemistry.
4. Physics Models - with examples of Modeling Activities for Physics.
5. Animations
This shortcut starts Coach with CMA exemplary projects for Activities with Animations. The
following projects are available:
1. Introduction to Animations - with tutorial Activities to learn how to create, modify and
execute animations.
2. Examples of Animations - with Coach Activities offering open environments for different
interfaces allowing to design and program control systems.
All Activities of these projects are started in the Activity user level.
8
Utilities
RCX Control -
this shortcut starts the program to upload the firmware for the LEGO
Dacta RCX.
ULAB View this shortcut starts the program which displays an image of ULAB’s screen
on the computer’s screen.
Firmware Update - this shortcut starts the program to update internal software (firmware) of
CMA interfaces.
The included CMA Coach Activities are exemplary activities delivered by CMA and are placed
in C:\Program Files\CMA\Coach6\Full\CMA Coach Projects folder. These Activities can not be
overwritten by users. Users can store their materials in a User Projects location given during the
installation or in any other folder where the user has rights to save.
All exemplary activities are described in Coach Workbook which can be found on the Coach 6
CD (Workbook. PDF) or can be downloaded at:
www.cma.science.uva.nl/english/resources/softwareCoach6.html.
4. Content of this manual
This manual describes the use and all the features of the Coach 6 environment.
Sections from I to VIII are for student users (and Authors) and describe possibilities of all
student functions. Sections IX and X are for Authors, like teachers or curriculum developers, and
describe all advanced features available only for Authors.
General information
- gives some general information on Coach 6 installation and this manual
FOR STUDENTS
I.
User interface
- describes the structure of the Coach environment
II.
Diagrams and tables
- describes the options of diagram/table panes
III.
Measurement
- describes the features and functions of Measurement Activities
IV.
Control
- describes the features and functions of Control Activities
V.
Data Video
- describes the features and functions of Data Video Activities
VI.
Modeling
- describes the features and functions of Modeling Activities
VII.
Animations
- describes the features and functions of Animation pane
VIII.
Processing and analysis
- describes data processing and analysis options available in Coach
9
IX.
Coach Language
- provides detailed information about Coach Language, programming language which
can be used in Measurement, Control and Modeling Activities.
FOR AUTHORS
X.
Authoring environment
- gives detailed information about Author features
XI.
Coach Utility programs
- describes Coach Utility programs: RCX Control, ULAB Update and ULAB View.
Appendix I. - gives technical information about the interface panels supported in Coach 6
Appendix II. - lists Coach Shortcuts
Appendix III. - describes how to convert Coach 5 Activities and Results
The Advanced label indicates that the information is meant for Advanced users
only which are Senior student users.
The TIPS label indicates tips which help you use the software more effectively or
to maneuver you around problems or limitations.
Note:
provides information that is generally useful.
10
FOR STUDENTS
I. User Interface
Table of Contents
1. STARTING COACH ............................................................................................................................................... 12
1.1. Main toolbar............................................................................................................................................... 12
1.2. The Open dialog ......................................................................................................................................... 13
1.3. Hardware settings ...................................................................................................................................... 14
1.4. Login........................................................................................................................................................... 15
1.5. Help ............................................................................................................................................................ 15
2. COACH ACTIVITIES ............................................................................................................................................. 15
2.1. Opening an Activity .................................................................................................................................... 16
2.2. Coach Activity screen ................................................................................................................................. 16
2.3. Activity toolbar ........................................................................................................................................... 17
3. COACH APPLICATION WINDOWS AND PANES........................................................................................................ 19
3.1. Coach application windows........................................................................................................................ 19
3.2. Coach panes. .............................................................................................................................................. 19
3.3. Using Coach panes .................................................................................................................................... 24
3.4. Print or copy pane content ......................................................................................................................... 25
3.5. Add, remove or edit Coach panes............................................................................................................... 25
3.6. Exchanging Coach Information with other Windows applications ............................................................ 27
4. MANAGING RESULTS .......................................................................................................................................... 28
11
1. Starting Coach
To start via the Windows Start menu
Click on the Windows Start button, move to Programs, then to CMA Coach 6 and next click
on one of the Coach 6 program icons. Coach shows the Main toolbar (and in Author mode the
main menu). Use the Open button to open an Activity/Result. Coach runs each Activity in the
user level specified in the Activity Options of each Activity. For the Author mode, a password is
required.
To start via double-clicking an Activity/Result file
(*.cma), a Coach Result file
(*.cmr) or a Windows
Double-click a Coach Activity file
shortcut to such file. Coach directly opens the Activity or Result in the user level specified in its
Activity Options.
To start via double-clicking a Coach project
or Coach project file (cmaproject.cms). Coach
Double-click on a Coach project shortcut
starts the project where the project file resides, with the specified startup conditions.
To exit Coach
Click the Exit Coach button in the upper left corner of the Main toolbar or click the Close
button in the upper right corner of the Program window.
1.1. Main Toolbar
After opening Coach (via Windows Start menu) the Main toolbar is shown with the following
buttons:
Button Action
Exit Coach
Open…
New…
Install Hardware Drivers …
Login…
Help…
12
1.2. The Open dialog
The Open dialog lists the Windows folders, Coach project folders and Coach files in the selected
location. It allows to browse through the folders and open Coach files of the following types:
• Coach Activities - *.cma files
• Coach Results - *.cmr files
• Coach 5 Activities - *.cac files
• Coach 5 Results - *.jrs files.
The largest part of this dialog is a standard Windows dialog. The Favorites button on the right
side of the toolbar and the bottom part of the dialog are Coach 6 enhancements.
Figure 1. The Coach Open dialog.
With the field Files of type one can select which kind of files will be listed in the dialog box.
The setting of this option is remembered throughout the current Coach session.
The summary of the current Coach project is displayed under Description. When Show project
image is selected the title picture of the current project is shown.
The Favorites button
The Favorites button opens the menu on the right and
gives access to your favorite Coach locations. You can add
your own folders to this list.
In the top of the menu are always links to the CMA Coach
projects location and, for network installations, the school
projects location and to the current folder. This list is stored
for all users of the computer.
Figure 2. The menu of the
Favorites button.
13
To add a folder to the favorite locations list
• Open the File Open dialog.
• Browse to the location which should be added to the list of favorite locations.
• Click the Favorites button.
• Select the Add Current option.
The current folder will be added to the user list part of the menu.
To remove a folder from the favorite locations list
• Open the File Open dialog.
• Click the Favorites button.
• Select the Remove Locations… option. A dialog opens which lists all the user entries in the
Favorites.
• Select the entry which should be removed and press OK.
Note: Multiple locations can be selected by using mouse clicks in combination with <Ctrl> or <Shift>.
1.3. Hardware settings
The Install Hardware Drivers option allows installing/removing device drivers or changing the
device settings (e.g. a port number that an interface is connected to). By default all drivers are
installed.
To open the Hardware Drivers dialog
•
Click the Install Hardware Drivers
button.
Figure 3. Hardware Drivers dialog.
To modify the settings of a previously installed driver
• Under Installed, click a driver to view or modify its settings. The settings are displayed
under Settings.
• Click OK to confirm, or Cancel to leave the Hardware Drivers dialog without making any
changes.
-
In Windows look for Control Panel > System > Device Manager > Ports to see which
ports are available.
See the installation instructions of the specific hardware interface for further information.
14
To add or remove a driver
• Under the header Available, select the driver(s) you want to install.
• Click Add if you want to install the driver(s).
• Click Remove if you want to uninstall the driver(s).
• Click OK to confirm, or Cancel to leave the Hardware Drivers dialog without making any
changes.
Note: Multiple drivers can be selected by using mouse clicks in combination with <Ctrl> or <Shift>.
1.4. Login
Coach 6 has three user levels: Author, Senior Student and Junior Student. The Student user level
is stored in each Activity. When starting Coach, by default the user level specified in the Activity
is followed. To start Coach in Senior-student mode or in Author mode use the Login button in
the Main toolbar.
To set the User level
•
•
•
Click the Login
button.
In the User level drop-down list select Senior student or
Author. The default is Default activity user level. In
Senior-student mode, all activities open as Senior student and
the user level setting in the Activity is ignored.
The Author mode is protected with a password key. Type in
the correct Author key to enter Author mode.
Figure 4. The Login dialog.
1.5. Help
You can start the Student help by clicking the
button. Specific help can be found by selecting
Help from the appearing Tool menu (by right clicking a part of the screen or via the Tool menu
button in a pane).
2. Coach Activities
Activities (*.cma files) are Coach documents created by Authors. The Activities consist of lesson
materials (experiments) for students. Student users open Activities to work in, but cannot
overwrite them. Instead they can save the results of their work in Results (*.cmr files). Activities
and Results can be stored in “ordinary” Windows folders or in Coach projects.
A Coach project is set of related Activities (Results) and/or other Coach projects (or shortcuts to
projects). It is a folder enriched with the Coach project file (cmaproject.cms file) which contains
a project description, a project title picture and project settings (i.e. information about how
Coach should start when it is started via the project file). The name of a Coach project is equal to
the name of its containing folder.
Coach 6 project folders can be recognized easily, as the icon of a Coach project folder has a red
‘C’ in the yellow folder
.5
5
On network drives, this specific folder icon may not be visible. Then Coach projects are also shown with the
ordinary Windows folder icon.
15
Figure 5. A Coach project can consists of only other Coach projects (left) or Coach Activities and Results (right).
Coach projects (or shortcuts to projects) can be stored in any location (also inside other Projects).
There are two special locations for Coach Projects:
- the CMA Projects folder (default: C:\Program Files\CMA\Coach6\Full.EN\CMA Coach
Projects) with the content delivered by CMA ; and
- the School projects folder, only for network installations, which is selected during the
installation of Coach 6. This location is optional. If Coach is installed on a network and a
suitable network location is selected to house this folder, this will be the Coach project
location for a whole school.
2.1. Opening an Activity
To open an Activity
• Press the Open button.
• Browse in the dialog to the desired project and Activity (or Result).
• Click Open.
By default the dialog shows Coach 6 files only. With the files of type drop-down list, the user
can set the filter to show Coach 5 files. In this way Coach 5 Activities/Results can be opened.
Upon saving them in Coach 6 they will be converted to *.cma/*.cmr files respectively.
2.2. Coach Activity screen
The Coach Activity screen consists of:
1. Title bar - contains the name of the current folder and Activity/Result.
2. Menu (sometimes) - contains menus for working in Coach.
3. Activity toolbar - contains buttons, the list of all buttons is given in the next section.
4. Coach panes – contain various kinds of information available via the yellow Information
buttons. Descriptions of all panes are given in 3. Coach panes and windows.
5. Application windows - contain the panel, the control program, the model or the videoclip.
16
6.
Status bar – besides the Coach 6 version and owner’s name, the Status bar contains also
information on the user level (left corner) and the type of document which is open: Activity
or Result.
Figure 6. Coach Activity screen.
2.3. Activity Toolbar
The Activity Toolbar does not always show all its buttons. It depends on the kind of Activity and
the user mode.
Button Action
Exit Activity, return to Main level
Open… an Activity/Result
Save as… - to save an Activity/Result
New… - to create a new Activity
Print the whole Coach screen
Show/Hide Panel window
Show/Hide Program window
17
Show/Hide Modeling window
Show/Hide Data-Video window
Open Settings
Start any run: measurement, control program, model calculation or video
measurement
Stop any run
Start a manual measurement
Stop a manual measurement
Replay the current run
Meter: to display a meter in a pane; to edit meter items
Value: to display a value in a pane; to edit value items
Diagram: to display a diagram in a pane; to edit diagram items
Table: to display a table in a pane; to edit table items
Animation: to display an animation in a pane; to edit animation items
Text: to display an author text in a pane; to edit diagram items
Picture: to display an image in a pane; to edit image items
Video: to display a video in a pane; to edit video items
Webpage: to display a webpage in a pane; to edit web items
Student Text: to display student text in a pane; to edit diagram items
Help…
18
All (yellow) buttons which allow selecting pane content which can be displayed in Coach panes
(Meter, Value, Diagram, Table, Animation, Text, Picture, Video, Webpage and Student text) are
enriched with an arrow . Clicking this arrow displays a list of all items available in the Activity
and the shortcut option Add new to directly create a new item.
3. Coach application windows and panes
3.1. Coach application windows
Depending on a Coach Activity type, Measurement, Control, Modeling or Data Video, Coach
displays one or two blue application windows:
• the Panel window to connect sensor and actuator icons (Measurement),
• the Program window for programs to control devices and systems (Measurement, Control),
• the Model window, for dynamical models (Modeling), and
• the Data-Video window for video-based measurements (Data Video).
These application windows are described in details respectively in the Measurement, Control,
Modeling and Data Video sections of this book.
The application windows can be toggled on/off with the application buttons on the Main toolbar.
By default the application windows are undocked but they can be docked in the Coach panes.
To dock/undock an application window
• Press the <Shift>-key. While keeping this key pressed start to drag an application window.
The window changes its shape into the transparent rectangle.
• When the mouse cursor in the transparent rectangle is located over the desired pane release
the mouse button.
• To undock the application window select its Tool menu option Undocked.
Note: Undocked application windows do not have the Tool button. Right click an undocked application
window to open its Tool menu.
3.2. Coach panes
Meters, Values, Diagrams, Tables, Texts, Pictures, Videos, Web Pages and Student texts can be
displayed in Coach panes.
Panes are always a part of Coach screen
and can not be undocked. The user can
create more or less panes if needed by
dragging borders from the borders of the
Coach screen. The pane size can be
changed by dragging the pane borders. If
dragged towards the borders of the Coach
screen, the pane disappears. Each pane can
be maximized to fill the whole screen by
using its Maximize button.
Each pane has its own Tool menu available
via the Tool menu button or via right
clicking the pane.
19
Figure 7. Coach panes with different information.
Coach panes with data information (in order of yellow buttons):
• Meters display the actual values of a selected connection (e.g. a sensor value, a model
variable value, a formula value etc.) on an analog meter.
• Values display the actual values of a selected connection (e.g. a sensor value, a model
variable value, a formula value etc.) in large digits.
• Diagrams are graphical representations of data of selected connections (e.g. a sensor value,
a model variable value, a formula value etc.). Closely related to tables.
• Tables display data in tabular columns. Closely related to diagrams.
• Animations are visualizations with animated objects which positions and sizes are
controlled by model variables, program variables or sensors values.
Meters
Measured values, variables values or values resulting from
calculated formulas can be presented on analog scaled meters. A
standard Meter is created automatically by Coach based on sensor
or variable properties.6 Any change of a standard meter makes it a
user-defined meter (the suffix ‘(Standard)’ is removed from the
meter’s name).
All visible elements of the Meter, its display, measured quantity
and its unit, can be manually relocated in the Meter pane by
clicking an element and dragging it to another location in the
Figure 8. A standard Meter of
pane.
Note: Help lines will appear to assist you to place the elements neatly
with respect to each other.
6
CMA Voltage sensor 0210i.
For Text model and Program variables the selection of variables for standard meters must be done by
the users via the Tool menu option Variables….
20
The Meter pane offers a simple editor to create
new or to modify existing (Standard) meters.
The Edit a Meter dialog can be opened:
• via the yellow Meter button (see & 3.5.
Add, remove or edit Coach panes)
or
• via the Tool menu option Edit…
or
• by double-clicking in the Meter pane.
Name: both new and standard meters get their
name automatically. This name can be edited.
Connection: a meter is coupled to a data range
via a connection. A detailed description of
connections is given in section II. Diagrams
and Tables, 1.6. Data-range connection types.
Display type: the following types are available:
Vertical bar, Horizontal bar, Quarter circle
(90°), Half circle (180°), Full circle (360°).
Figure 9. The Edit a Meter dialog.
Quantity: the quantity name measured by a meter, by default shown on the meter.
Unit: the unit of the measured quantity, by default shown on the meter.
Display: always selected to be shown on the meter.
Scale: when on then the scale is shown on the meter.
For each of these options the fonts and colors can be set. When the yellow lock is closed
(default) then the same fonts and colors are used for all.
Min., Max.: allow to define the range of the meter’s scale. For standard meters these values are
read from the sensor or variable properties.
The options Empty, Full and Pointer define the meter’s colors.
Each meter has a colored background (default white) and on which a picture can be placed.
When a picture is used then the meter and its elements, like scale or quantity name are placed on
a top of it. The transparency of the background picture can be set by using the transparency
slider.
Note: Meters can be created only by Authors or Senior Student users.
- Use the Reset Layout button to reset the user-defined layout of the meter (i.e. the positions
of its elements) to a standard meter.
- Use the button Reset All to reset the user-defined meter into a standard meter.
21
Values
Measured values, variables values or values resulting from
calculated formulas can be presented in large digits called
Values.
Values are similar to Meters; the main difference is that
Meters display values on analog displays and Values on digital
displays.
A standard Value is created automatically by Coach based on
sensor or variable properties.7 Introducing any changes to
standard values make them user-defined values (the suffix
’(Standard)’ is removed from the value’s name).
All visible elements of the value: its digital display, measured
quantity and unit, can be manually relocated in the Value pane Figure 10. A standard Value for CMA
by clicking an element and dragging it to another location in Voltage sensor 0210i.
the pane.
Note: Help lines will appear to assist you to place the elements neatly with respect to each other.
The Value pane offers a simple editor to create
new or to modify existing (standard) meters.
The Edit a Value dialog can be opened:
• via the yellow Value button (see & 3.5.
Add, remove or edit Coach panes)
or
• via the Tool menu option Edit …
or
• by double-clicking in the Value pane
Most options of the Edit a Value dialog are
similar to the Edit a Meter dialog.
For digital values, the number of Digits and
Decimals used in the displayed values can be
defined.
Note: The number of digits includes the number of
decimals. This is to make sure that enough space is reserved.
Diagrams
Diagrams are described in detail in ‘II. Diagrams and Tables’.
Tables
Tables are described in detail in ‘II. Diagrams and Tables’.
Animations
Animations are described in detail in ‘VII. Animations’.
7
For Text model and Program variables the selection of variables for standard values is done via Tool
menu and option Variables….
22
Coach panes with multimedia information (in order of yellow buttons):
• Texts with activity explanations and instructions created by Authors. Student users can not
edit these texts.
• Images (BMP, PNG, GIF or JPG) e.g. to illustrate phenomena, experiments or equipment.
• Videos (AVI, MOV, MPG, WMV) e.g. to illustrate phenomena, experiments or equipment.
• Web pages e.g. with extra resources for students.
• Student text for student reports, answers to questions, etc.
Texts and Student texts
The Text and Student Text panes offer a simple
text editor for preparing texts. Texts can be
created only by Authors and can not be edited
or deleted by Student users. Students use
Student text.
Text pane has its own toolbar which appears
after clicking in the pane.8 The toolbar consists
of the following buttons:
•
to zoom in and out text;
•
to change the font style and text size;
•
to change the font color;
•
, ,
to apply respectively bold, italic
and underline font style;
•
,
to make text subscript or superscript;
•
to format text (align left, center, align right, justify);
•
to make a bullet list;
•
to make a numbered list;
•
,
to indent text respectively to the left and to the right;
•
to insert a symbol;
•
to insert an image;
to insert a link to other Coach text/student text, to Internet file or to a local file.
•
Web pages
The Web Page pane offers a simple browser
with its own buttons located in the pane toolbar:
•
to return to the last viewed page;
•
to view one of the last nine pages visited
in this session;
•
to return to the home page;
•
to stop loading the current Web page;
•
to refresh a Web page.
8
For Texts only in Author mode
23
3.3. Using Coach panes
It depends on the user mode whether it is allowed to make changes to what is displayed in a
pane, and if and which yellow content buttons are present in the Activity toolbar.
To move a content from a pane on the screen to another pane on the screen
• Drag the blue title bar of the pane from which you want to move the information. The cursor
changes its shape into the transparent rectangle.
• Place the mouse cursor over the desired pane to which you want to move the information
and release the mouse button.
Note: Also Application windows can be relocated in this way.
To place a content via a yellow button
• Click the arrow next to the desired button to see all available items.
Or
• Click the desired yellow button. A list opens with all available
items of that type.
• Select an item from the list.
• Click OK, (or click Close to cancel). The shape of the mouse Figure 11. Selecting a
diagram via the arrow next
cursor changes to indicate the information type you have chosen.
the yellow Diagram button.
• Click in a pane to display the item, or click <Esc> to cancel.
To place a content via an empty pane
• Right click in an empty pane, or press the Tool menu button.
• Select the desired content type from the Tool menu. A list opens with all available items.
• Select an item from the list.
• Click OK to display the item, or click Close or <Esc> to cancel.
-
-
In more advanced user modes, the lists contain additional buttons to add, remove or edit
information items (see & 3.5. Add, remove or edit Coach panes).
When a press on a yellow button does not lead to opening a list, the only item of that type is
already displayed, or the list is empty.
Lists of Diagram, Table, Meter or Value items are divided into User-defined items and
Standard items (created automatically by Coach).
A diagram, table, meter or value can be placed in different panes at the same time. In this case,
the settings for each window are remembered individually.
When your Activity has multiple texts or student texts you can easily browse through them via
the text Tool-menu (options Previous Text or Next Text) or via the shortcut keys
<Ctrl>+<PgUp> (Previous Text) and <Ctrl>+<PgDn> (Next Text). It is also possible to link
to other Coach texts.
When placing a video, video play buttons appear.
In some user modes it is possible to empty a pane by 'closing' it. By doing so, the information
is not lost, only currently not displayed on the screen. Via the procedures referred to above it
can be redisplayed.
24
3.4. Print or copy pane content
Pane content can be printed and copied to the clipboard e.g. for use in other applications.
To print
• Right click the pane to be printed or click its Tool menu button and select Print Window.
-
When printing a video, the current frame is printed.
You can also print the whole Coach screen by using the Print button or <Ctrl>+<P>.
To copy an information item to the clipboard
• Right click the pane to be copied or click its Tool menu button and select Clipboard Copy.
Models can be copied into the clipboard as texts or pictures.
• Paste the item in another Windows program (Word processor, text editor, drawing program,
spreadsheet, etc.), by using Paste there.
• Texts, tables, can also be copied to the clipboard using text edit options or keys (Cut
(<Ctrl>+<X>), Copy (<Ctrl>+<C>) and Paste (<Ctrl>+<V>)).
-
-
When copying a diagram to the clipboard its zoom information, scan information and
comments are copied along. A diagram is always exported as a picture.
When copying a table to the clipboard the selected part of the table will be copied including 2
header rows with the quantity and unit of the data ranges. When no selection is made, only the
visible part of the table is copied.
When copying a table with the Copy option (<Ctrl>+<C>), the header rows are not included.
3.5. Add, remove or edit Coach panes
Advanced users can modify the information items. Extra buttons allowing creating, editing or
removing items are available in the Select … dialogs which can be opened via clicking the
yellow button with the desired information type.
Meter/Value
New – to create a new meter/value and add it to
the diagram list.
Edit – to open the Edit a Meter/Edit a Value
dialog of the selected meter/value.
Delete – to delete the selected meter/value.
Diagram
New diagram – to create a new diagram and
add it to the diagram list.
Background graph – to create a diagram with
a background graph and add it to the diagram
list.
Edit – to open the Edit a Diagram dialog of
the selected diagram.
Delete – to delete the selected diagram.
Figure 12. Select a diagram dialog.
25
Table
New table – to create a new table and add it to the table list.
Import – to create a new table with imported data and add it to the table list.
Edit – to open the Edit a Table dialog for the selected table.
Delete – to delete the selected table.
Animation
New animation – to create a new animation and add it to the animation list.
Copy animation – to create a copy of the selected animation and add it to the animation list.
Edit title – to edit the title of the selected animation.
Delete – to delete the selected animation.
Text
Under this button texts from Authors are available. It is not possible for Student users (even
Senior students) to make any changes to this list. Student users should use Student Texts.
Picture
Add – to add a new picture to the list.
Edit title – to edit the title of the selected picture.
Delete – to delete the selected picture.
Video
Add Video – add a new video to the list.
Add Images – to create a new video from
a sequence of pictures and add it to the
list.
• Browse the disk to find your picture
sequence.
• Select the images from the list (by
using the <Ctrl> or the <Shift>).
Coach places the picture files in
alphabetical order. Recommended is to
rename the pictures of the sequence to
a name including a number, like
ball01, ball02, ball03, ball04, etc.
• Enter the number of frames per second
the pictures were taken (each image
represents a frame) or the time interval
between the picture.
Figure 13. Selecting pictures to create a video file.
• Select a video compressor (codec).
• In the Title field write a title for the resulting video.
• Click Open.
• Coach automatically creates a videoclip in the AVI format.
Edit title – to edit the item title.
Delete – to delete the selected video.
26
Web page
Add – to add a Web page to the list.
• Select internet link or local file.
• Enter the title.
• Enter a URL link (i.e. a Web page address) or a link to a local files.
Add current – to add the URL (i.e. a Web page address) of the current Web page opened in the
Web Page pane.
Edit – to edit a Web page address and title.
Delete – to delete the selected Web page.
Student text
New – to create a new text.
Import – to import a plain text or a rich text format document and add it to the list.
Edit title – to edit the text title.
Delete – to delete the selected text.
Warning: Deleting list items is irreversible. The only way to recover is to reopen the Activity
or Result (without saving!) and start again.
-
A shorter way to add information items is by using the Add new option which is available via
the list after a click on the arrow next to a yellow button.
List of items are ordered alphabetically, but numbers take precedence. If the items in a list
should have a pre-defined order, start the titles with a number (e.g. 1,…,9, or 01…99, etc.).
Apart from references to URLs, the Web-page list can contain references to all registered file
types i.e. the file types which have an association to a program (e.g. a reference to
MYFILE.DOC will open MYFILE.DOC in MS-Word).
3.6. Exchanging Coach Information with other Windows applications
Export from Coach
Direct export of information displayed in Coach panes is possible via the clipboard. In advanced
user modes, data can also be exported to files via a table.
Pasting text in Coach
Text from other applications (MS Word, ASCII files, Web pages) can be paste into Coach texts
(only for Authors) or Coach student texts.
• Copy the desired data to the clipboard.
• Right click the Student text pane and select Paste, or press <Ctrl>+<V>.
Pasting data in Coach
Use the procedure below to paste data from other applications (MS Excel, ASCII files, Web
pages) into Coach, from a table column to another column of the same table (i.e. within the same
Activity) and from a table to another table (within the same Activity).
• Copy the desired data to the clipboard.
• Create a new table.
• Right click the Table pane and select Text edit > Paste, or press <Ctrl>+<V>.
In the table the required number of columns of type Manual input is automatically created
27
•
-
and the data appear in the table. Via the table settings you can edit the table (e.g. the
quantity, unit and number of decimals).
It is not possible to paste a diagram directly into Coach.
Data in files with different formats can be imported in Coach via the table Tool-menu option
Import data.
Use the table Tool-menu option Display as a Diagram to create a diagram from the data.
4. Managing Results
A Coach Result is the result of student’s work in an Activity. It consists of all elements of the
Activity (like texts, pictures, videos, etc.) together with student changes and resulting data like
student notes, measurement data, calibrations, models, control programs. Working with Results
is similar to working with Activities.
To open a Result
• Press the Open button or the <F3>-key. Make sure the Files of type field shows Coach 6
Results.
• Browse to the desired Result. Click Open.
The File Open dialog for opening Results is the same as for opening Activities.
To save a Result
• Press the Save as… button or the <F2>-key.
• Enter the name of the Result. Click Save.
In advanced user modes it is also possible to open or save a Result via the File menu. The
procedure is basically the same as described above.
To delete a Result
• Click the Open button.
• Browse in the dialog to the desired Result. Delete the file.
To save Student text as a (Rich) Text File
Student texts can be saved to a separate file in RTF or TXT format.
• Right click the Student Text pane and select Save to File.
• Select a file type.
• Enter a file name.
• Click Save.
28
II. Diagrams and Tables
Table of Contents
1. DIAGRAMS AND TABLES IN COACH ..................................................................................................................... 30
1.1. Introduction ................................................................................................................................................ 30
1.2. Scanning data ............................................................................................................................................. 31
1.3. Erasing complete data runs ........................................................................................................................ 32
1.4. How to keep old runs active?...................................................................................................................... 32
1.5. Diagram/Table settings .............................................................................................................................. 32
1.6. Data-range connection types...................................................................................................................... 36
1.7. Create a formula......................................................................................................................................... 37
2. SPECIFIC DIAGRAM OPTIONS ................................................................................................................................ 38
2.1. Introduction ................................................................................................................................................ 39
2.2. Diagram style ............................................................................................................................................. 39
2.3. Zoom........................................................................................................................................................... 40
2.4. Sketch.......................................................................................................................................................... 41
2.5. Annotating the diagram .............................................................................................................................. 41
2.6. Background graph ...................................................................................................................................... 42
3. SPECIFIC TABLE OPTIONS ..................................................................................................................................... 44
3.1. Introduction ................................................................................................................................................ 44
3.2. Rows ........................................................................................................................................................... 44
3.3. Edit table cells ............................................................................................................................................ 45
3.4. Import data ................................................................................................................................................. 46
3.5. Export data ................................................................................................................................................. 48
29
1. Diagrams and tables in Coach
1.1. Introduction
Diagrams and tables are used to display measured or calculated data. They are synchronized and
share a number of settings (among which their name): irrespective where these settings are
changed, they are reflected both in the diagram and the table.
Figure 14. Data collected during an experiment of discharging a capacitor.
A standard diagram/table is created automatically by Coach:
1. Via a sensor/actuator on the panel, it is a diagram with the clock (time) along the horizontal
axis (data range C1) and the quantity of the sensor/actuator along the first vertical axis (data
range C2). For event-based measurements, the row index replaces time along the horizontal
axis.
2. Via Data Video Tool menu, it is a diagram with time along the horizontal axis (data range
C1) and video point positions along the vertical axis (data range C2, C3 …).
3. Via Model variable Tool menu (available after right clicking a variable symbol in the Model
window). It is a diagram with the independent variable along the horizontal axis (data range
C1) and the selected variable along the vertical axis (data range C2).
The standard table is the table corresponding to the standard diagram
Any change of a standard diagram/table makes it a user-defined diagram/table (the suffix
‘(Standard)’ is removed from the diagram/table’s name).
Figure 15. A standard diagram and table created via a Temperature sensor icon.
30
The lists of user-defined diagrams/tables and standard diagrams/tables are displayed in the Select
a Diagram/Select a table dialogs which are available after clicking the yellow button
Diagram/Table.
Figure 16. Lists of User-defined and Standard diagrams.
1.2. Scanning data
In a diagram the option Scan is used to read coordinates of points on graphs or of other points
in the diagram. A crosshairs in the diagram
marks the scanned point. The co-ordinates of
the point are displayed in a box in the upper
right corner of the Diagram pane.
In case the corresponding table is displayed, the
row with the nearest x co-ordinate is selected in
the table. In a table, values can be read directly
by using the scroll bar.
To scan points in a diagram
Figure 17. Scanning data in the graph.
• Click the diagram Tool menu button and
select Scan.
• Click a point of the graph and read its co-ordinates in the co-ordinate box.
• Move through the data points with the mouse or with the right and left arrow keys.
• Stop scanning by pressing <Esc> or by selecting Stop Scanning from the Tool menu.
When there are several graphs in the diagram, the crosshairs always sticks to the first data range
assigned to a vertical axis. The co-ordinates of all graphs are displayed, however.
- The box with co-ordinates can be moved to another position by dragging.
- By clicking on a point outside the graph, scan chooses the point of the graph which has the
same x co-ordinate. When using <Alt>+<click>, the point of the graph is chosen which is
closest (measured with a straight line) to the clicked point.
- Scanning is limited to the visible part of the diagram. Zoom out when co-ordinates of a
graph(s) in another part of the diagram need to be read.
31
- Use the <Ctrl>-key together with Scan to read the co-ordinates of any point in the diagram.
Use this option e.g. to read co-ordinates from sketched graphs, or to extrapolate an
intersection with a diagram axis.
- When the diagram is printed or copied to the clipboard, the scan information is included.
- If you want to store co-ordinates, you have to write them down, or type them in a Student text
pane. It is not possible in Coach to store the scanned co-ordinates automatically.
1.3. Erasing complete data runs
To erase all data in a diagram/table select the option Erase all Values from the diagram Tool
menu. All data from the linked diagram and table are erased. To erase data from previous runs in
a diagram select Delete Background Graphs > Previous Runs.
- By clicking <Shift> +
run.
(or <Shift>+<F9>) you erase all data on the screen and start a new
1.4. How to keep old runs active?
The default behavior of Coach is that when a measurement run is followed by another run, the
data of the previous run is overwritten, and its graph becomes gray (it is only displayed on the
screen). In this way maximal 4 previous data runs are displayed in the diagram. The option Copy
Column allows keeping previous runs active.
To copy column
• After a measurement run, right click the diagram or table.
• Select Copy Column.
• A submenu appears with all quantities in the diagram/table.
• Select the quantity which has to be copied.
The column containing the data is copied into the first empty column of the table with data-range
type manual input. During the next run, this data is repainted in the diagram. When the table is
full (8 columns), the option disappears from the Tool menu.
1.5. Diagram/Table settings
The diagram/table settings can be found in the Create/Edit Diagram/Table dialog.
To create a new (empty) diagram/table
• Click the yellow Diagram/Table button and click New or click the arrow next to the
Diagram/Table button and select Add New.
• The Create/Edit dialog opens for an empty diagram/table. Fill the diagram/table settings.
To edit a diagram/table
• Click the diagram/table Tool menu button and select Edit Diagram/Table.
Or
• Click the yellow Diagram/Table button or right-click an empty window and select Display
Diagram/Table. Select a diagram/table from the list.
• The Create/Edit dialog of the selected diagram/table opens. Edit the diagram/table settings.
• The diagram/table settings can also be opened directly via the shortcut <Ctrl>+ <Tool
button> (not in all user modes).
32
To add a graph to an existing diagram or a column to an existing table
• In the Create/Edit dialog of the diagram/table select a data range C1 .. C8 which connection
is Empty. In an existing diagram/table often C3 is the first empty data range.
• From the connection drop-down selection list, select a connection for the data range, i.e. a
variable or a formula.
• Enter or modify the settings for this data range (options are available depending on whether
you add the data to a diagram or a table), e.g. the quantity, unit, minimum, maximum,
number of decimals and the diagram style, or enter the formula.
• Click OK to confirm (the new data range appears automatically in the diagram/table), or
Cancel to leave the Edit dialog without changes.
To remove a graph from an existing diagram or a column from an existing table
• In the Create/Edit dialog of the diagram/table select a data range C1 ... C8 which
connection you want to delete.
• As a new connection select Empty.
• Click OK to confirm (the data is erased from the diagram/table), or Cancel to leave the Edit
dialog without changes.
The Create/Edit dialogs
The options described in this section are not available in all user modes.
The Create/Edit dialogs for diagrams and tables have two sections; the upper section Diagram or
Table which contains the name and a few general settings, and a lower section Column which
contains the settings for each data range. There are only a few small differences between these
dialogs:
- For diagrams: horizontal and vertical axes can be assigned to data ranges; for each data range
along a vertical axis, the way it is displayed can be specified and there are options to make the
grid visible and to keep the scale of horizontal axis and first vertical axis the same.
- For tables: there are options to show row numbers and column letters and no axes nor styles
can be assigned to data ranges.
Note: In some user modes it is not possible to change pre-defined data ranges.
Figure 18. Create/Edit a Diagram dialog (left) and Create/Edit a Table dialog (right).
33
Name
A standard diagram/table gets its name automatically, the suffix ‘(Standard)’ is added to the
diagram/table’s name). This name can be edited.
The name of a linked diagram and table stay the same, so when editing the diagram's name, the
table's name changes along, and vice versa.
Show grid (diagrams only)
When marked the grid is displayed in the diagram. Default the grid is showed.
Identical axes ratio (diagrams only)
When marked, the units along the horizontal and vertical axis in the diagram use the same
number of screen pixels. For example with Identical axis ratio marked, a circle will be
displayed as a real circular shape on the screen (rather than an ellipse).
Show row index and Show column letters (tables only)
When marked, the row index (the row number of the data point in the table) respectively the
column letters (C1, C2, etc.) are displayed in the table. By default, Row index = on and Column
letters = off.
Font (tables only)
By clicking this button the Fonts dialog opens allowing the fonts used in the table.
Data range
Each diagram/table has eight data sets called data ranges (the columns of a table) labeled C1 ..
C8. Click one of the data ranges to select it. The settings of the selected data range are displayed
in the lower part of the dialog.
Connection
Via the connection a data set is coupled to a data range, e.g. data from the clock or a connected
sensor or actuator, manually entered data, or a formula. To couple data to a data range, first
select it (it is highlighted) then make a selection from the connection drop-down selection list.
Axis (diagrams only)
Horizontal
First
Vertical
The selected data range will be displayed along the x-axis. In a standard
diagram/table, C1 (the clock, i.e. time) is assigned to this axis. Only one data
range can be assigned to the horizontal axis of a diagram: by selecting another
data range for the horizontal axis, the previous one will be automatically set to
Invisible.
The selected data range will be displayed along the first y-axis (left side).
Second
Vertical
The selected data range will be displayed along the second y-axis (right side). The
scale of this axis is completely independent of the first vertical axis and will also
be re-scaled automatically independent of the first vertical axis.
When a result of a processing action is added to a diagram, it is assigned to the
next empty column and to the second vertical axis.
Invisible
The selected data range will not be displayed. This option is useful for example
when the data are only used as source for a formula, but do not have to be
displayed in the diagram/table itself.
34
Invisible (tables only)
Similar as for a diagram axis the selected data range will not be displayed.
Quantity
The quantity of the data in the active data range. The quantity name should be unique in the
diagram or table. The quantity name is also used as a variable name in formulas.
Unit
The unit of the data in the active data range.
Decimals
A local diagram/table setting for the active data range. This number of decimals is displayed
along the axes of the diagram, for the values of the data range in the table and in the co-ordinate
box when scanning the diagram.
Min. (diagrams only)
The minimum value along the specified axis in the diagram for the active data range. For a
standard sensor/actuator diagram, the minimum value is read from the Sensor properties or
Actuator properties.
Max. (diagrams only)
The maximum value along the specified axis in the diagram for the active data range. For a
standard sensor/actuator diagram, the minimum value is read from the Sensor properties or
Actuator properties.
Note: The duration of a measurement is only determined by the measurement settings, not by the
maximum of the time axis in the diagram settings.
Color (diagrams only)
The color applies to the markers and line style used for this graph. The color is also used for the
name of the corresponding quantity and unit along diagram axes.
• Select a color from the drop-down list.
Marker (diagrams only)
A marker is used to mark the individual data points.
• Select a marker (none , cross, small dot, big dot) from the drop-down list.
• If Marker = Small dot and Connection type=Line, the small dot is not visible (the dots are
overlapped by the line). The same may apply to other markers when the line width is set to a
thicker line.
Type (diagrams only)
The type specifies if and how individual data points are connected.
• Select a type (none, line, histogram) from the drop-down list.
• When Connection type = Line, all data point are connected by straight lines.
When Connection type = Histogram, all data points are connected to the horizontal axis by a
vertical bar.
Line width (diagrams only)
• Select a line width (5 grades of thickness) from the drop-down list.
• The setting of line width does not display when Connection type = None.
35
1.6. Data-range connection types
The connection type can be found in the Create/Edit dialog of a diagram or table. It specifies
the type of data assigned to a data range (corresponding to a diagram axis or a table column).
The following connection types can be chosen:
Empty
A data range without connection (the default setting). When
the connection of a data range is reset to empty, data is
erased from the diagram/table. Clock data, data from panel
inputs and outputs and variables data will still be available
for selection in other data ranges. However, calculated data
(from formulas) and manual-input data are lost when their
connection is reset to empty in the diagram/table where
they were defined.
Figure 19. The list of connection
Manual input
Select this connection type for manual measurements. Then types for a data range in Measurement
Activity.
Coach prompts to type the quantity values for all data
ranges with a manual-input connection each time the Manual Measurement button is pressed.
The manual-input connection type should also be chosen to allow data to be directly typed in the
cells of a column. Further, data ranges with imported data automatically are set to manual input.
Manual-input data ranges are not erased during next runs, but are redisplayed instead (with the
same data). This feature can be used to keep data of previous runs active (see 1.4. How to keep
old runs active?).
Formula
This connection type is used to assign a formula to a data range. In a formula, data assigned to
other data ranges of the same diagram/table can be used as variables. Data ranges with formulas
are automatically recalculated. So during a new run, the newly calculated values will appear in
real-time.
Row Index
The row index is the row number of the data point in a table.
Equidistant data
This connection type is used to automatically generate a number of equidistant points in the
given range.
Clock
The clock is the connection type which represents time data. It is usually connected to data range
C1 along the horizontal axis in a standard diagram or to data range C1 of a standard table.
Time interval
The time interval gives the difference in clock values of two successive data points. This works
in backwards form: the time interval value is assigned to the last point of the two so its first point
remains undefined.
Panel inputs and outputs
These connections depend on the inputs and outputs of the used interface panel. All available
inputs and outputs are listed either with the connected sensors/actuators or as (Nothing
connected).
36
For example Analog In 1: Light sensor represents the data measured through the light sensor
connected to input 1 of the interface.
Variables (from a model or a control program)
These variables appear in the list automatically as soon as
they are defined in the graphical or equations model. For
the text model and the control program only variables
defined in the List of Variables table are displayed. To
define and add a new variable as a data-range connection Figure 20. The list of connection types for
a data range in Modeling Activity.
use the Add variable… option described below.
Add variable (for a text models and a control program only)
This option allows defining variables for display under data-range connections for Values,
Meters, Diagrams and Tables. Selecting this item invokes the Add variable dialog in which a
variable used in a program or in a text model can be selected. Then its unit, minimum value,
maximum value and the number of decimals can be defined in the List of Variables table.
1.7. Create a formula
A formula can be used to do calculations on data in diagrams or tables. You can start the Wizard
to assist you to create the formula or type a formula yourself.
To create a formula
• Right click the Diagram/Table pane and select Edit.
• Select an empty data range C1 ... C8.
• Set the connection to Formula.
• Click the Formula Wizard button. Depending on the user mode, you will enter the Formula
Wizard dialog (see below), or the Formula Editor dialog.
Or
• Type the formula in the Formula field (for experienced users).
• Enter a suitable name for the Quantity and specify the Unit.
- Existing formulas can also be selected as a data range connection in other diagrams/tables.
- Formulas are automatically evaluated. So in a next run, the values of the formula appear
automatically in the diagram/table.
- In a formula, you can only select the quantities which are assigned to the data ranges of the
same diagram or table. If you need to include a quantity in the formula, which is not yet
available in the list, first assign this quantity to a data range.
- If only the result of the formula should be shown in the diagram, set the other data ranges to
invisible.
Formula Wizard (Junior student)
• Create the formula by selecting quantities from the list.
• Select Number when you need to enter a number in your
formula.
• Select OK to close the Formula Wizard.
Figure 21. The Formula Wizard.
37
Formula editor (Senior student)
To create a formula with the Formula Editor
• Create the formula by selecting variables,
operations, functions, and typing numbers.
• The variables column shows only variables
used in data ranges.
• For mathematical operations which use
more than one parameter (e.g. Filter(;)), it is
necessary to move the cursor to the position
of the next parameter.
• Select the constants from the database with
predefined constants by using the
Constants button.
- For inexperienced users, it is recommended
to use the Formula Editor rather than free
typing.
- Advanced formulas are evaluated automaFigure 22. The Formula Editor.
tically, and are calculated in real-time during
measurements. For example: a position is
measured against time, via a formula with the derivative, the velocity is prepared in the
Diagram. During the measurement, both the position and the velocity are displayed in realtime.
Notes:
-
Some of the mathematical formulas are placed automatically in the diagram/table settings as a result
of a processing operation (derivative, integral, or smoothing) in a diagram. They also can be entered
manually.
-
Coach does not allow nesting these formulas.
Coach offers a database with predefined
constants which can be used during creating
formulas. It consists of the following fields:
Symbol, Value, Unit and Quantity and opens
after clicking the Constants button in the
Formula editor.
To use constant in the Formula Editor
• Click the Constants button.
• Select a symbol of a constant and click the
Select button.
• A constant value is placed in the formula at
the cursor position.
Figure 23. Database with predefined constants.
38
2. Specific diagram options
2.1. Introduction
A diagram is used to graphically display data.
A diagram can contain several graphs. Usually
the graphs are distinguished by means of a
color.
Most options described below can be reached
via the diagram Tool menu. Several options
appear only when there are data points
available.
2.2. Diagram style
Figure 24. A measurement graph in the diagram.
The diagram style determines how the
graphs in a diagram will be displayed.
Each graph has a unique style. To open
the Diagram Style dialog select the Tool
menu option Diagram Style. You can
change the settings for the grid, colors,
markers and connection types.
Figure 25. The Diagram Style dialog.
Show grid
The grid setting applies to the diagram as a whole.
• Mark/Unmark Show grid to switch the grid on/off.
The settings in the Column section apply to individual graphs. Each graph is linked to a data
range (C1 .. C8). When there are two or more graphs in the diagram:
• Click the data range (C1 .. C8) for the graph to change its style attributes.
Color
The color applies to the markers and line style used for this graph. The color is also used for the
name of the corresponding quantity and unit along diagram axes.
• Select a color from the drop-down list.
Marker
A marker is used to mark the individual data points.
• Select a marker (none , cross, small dot, big dot) from the drop-down list.
• If Marker = Small dot and Connection type=Line, the small dot is not visible (the dots are
overlapped by the line). The same may apply to other markers when the line width is set to a
thicker line.
Type
The type specifies if and how individual data points are connected.
• Select a type (none, line, histogram) from the drop-down list.
• When Connection type = Line, all data point are connected by straight lines.
When Connection type = Histogram, all data points are connected to the horizontal axis by a
vertical bar.
39
Line width
• Select a line width (5 grades of thickness) from the drop-down list.
• The setting of line width does not display when Connection type = None.
-
-
The style of a background graph can also be edited. As soon as the diagram contains a
background graph, the Diagram Style dialog has an extra pane for the style settings of the
background graph.
The style of the graphs can also be edited in the Create/Edit Diagram dialog (not possible in
all user modes).
If no graphs appear in the diagram, check whether both Marker and Connection type are set
to None. With this setting, the particular graph will be invisible.
The defaults Marker = None and Connection type = Line are chosen for reasons of visibility
only. The best way to display data from computerized measurement process is to select a
Marker and setting Connection type = None, but when a measurement consist of many points,
there may be confusion which point follows which. The connection with lines neutralizes this
confusion.
Examples of diagram styles
Marker=None
Connection type=Line
Marker=None
Connection type=Line (thicker line width)
Marker=Cross
Connection type=Line
Marker=Big dot
Connection type=Line
Marker=Big dot
Connection type=None
Marker=Big dot
Connection type=Histogram
2.3. Zoom
By zooming in an area of the diagram will be
enlarged, e.g. for closer inspection.
To zoom in/out
• Move the cursor over the diagram, until
shape changes into a magnifying glass.
• Drag an area to zoom in. The area will be
enlarged to fill the whole diagram.
• Click the Zoom-out button
to return to
the previous zoom state.
Figure 26. A zoomed diagram with scroll arrows.
40
•
-
Click the Zoom-to-fit button , or select the Zoom to Fit option to re-scale the horizontal
and vertical axes to optimally display all graphs.
The shortcut <Ctrl>+ only zooms automatically in the vertical direction.
The shortcut <Shift> + immediately restores the diagram to its original state.
When the diagram is zoomed in then scroll arrows appear along the diagram axes. By pressing
an arrow button, the diagram scrolls in the direction of the arrow. This way you can view other
parts of the diagram with the same magnification.
2.4. Sketch
With the Sketch option you can draw a graph in
a diagram pane. This option can be used:
- to draw prediction of a measurement graph.
After the run, the shape of the predicted
graph can be compared with the measured
graph.
- to draw a graph which can be converted to
real data and used for example as input data
for an auxiliary variable in Modeling.
To sketch a graph
Figure 27. Drawing a sketch graph.
• Via the Tool menu select Sketch.
• Draw a smooth curve by dragging to the right (erase by dragging to the left) or click several
points to draw a point-to-point graph.
• Stop sketching by pressing <Esc> or by selecting the Tool menu option Stop Sketching.
• To erase a sketch select the Erase Sketch option.
-
Switching on the grid may help to draw more accurately.
Double-click a point in the sketched graph to erase the part of the graph beyond this point.
To convert a sketch to table
• Via the Tool menu select Convert Sketch to Table. The shape of the cursor changes into a
small table.
• Click in a pane to display the table or click <Esc> to cancel.
The number of data points in the created table depends on the way the sketch graph was made:
- for the point-to-point curve the number of points is equal to the number of clicked points,
- for the smoothed curve the number of points depends on the sketching speed, the slower you
sketch the more points you get.
2.5. Annotating the diagram
It is possible to place descriptive labels –annotations- in a diagram. They can be used to label
individual graphs or to point out interesting features.
Annotations are displayed in the diagram but also appear when the diagram is printed or copied
to the clipboard.
41
To add an annotation
• Select the Tool option Add an
Annotation…
• Type in text.
• If desired click the Font button to change
the text font and its color.
• Select Framed to place the annotation in
a frame (default = no frame).
• Click OK to confirm or Cancel to return
to the original diagram.
• Drag the annotation to the desired
position of the diagram (make sure the
mouse cursor has the shape of a hand).
• When desired, repeat this procedure to
create more annotations.
Figure 28. Annotations in different colors are used to
describe the various measurement graphs.
To edit/delete an annotation
• Right click an annotation (make sure the mouse cursor has the shape of a hand).
• Select Edit or Delete Annotation.
2.6. Background graph
A background graph is used to visually compare already collected data with data in an Activity
(i.e. in hypothesis testing in Modeling). Contrary to regular graphs, the data of a background
graph is not available: the graph is displayed as a picture in the diagram only. It can be shifted
horizontally, however. Importing graphs with data must be done via a table.
To import a background graph in a diagram
A background graph is created from data stored in a Result on disk.
• Select Import Background Graph… or press the yellow Diagram button and click the
Background Graph button (in this case a new diagram is created which only contains a
background graph).
• Open a Result file. The Import Background Graph dialog opens.
The Import Background Graph dialog
The Import Background Graph dialog makes it possible to specify settings for the import
process. This dialog has three sections.
The Original data section gives information about the chosen Result file:
The file name;
The number of rows;
The number of data ranges (columns);
For the selected data range: the quantity, unit, minimum and maximum of the data in that
data range.
• Use this section to inspect what data is available in the Result file.
42
In the Horizontal axis section the data range
from the Result which has to correspond to the
quantity along the horizontal axis of the
diagram can be selected.
• Select a data range from the drop-down-list
under Column.
• When desired, enter the quantity and unit
in the Label field.
In the Vertical axis section the data range from
the Result which has to correspond to the
quantity along the vertical axis of the diagram
can be selected.
• Select a data range from the drop-down-list
under Column.
• When desired, enter the quantity and unit
Figure 29. The Import Background Graph dialog.
in the Label field.
• Select whether the data should be displayed along the left First vertical or right Second
vertical axis.
• Specify the background graph style settings (color, marker, type and line width).
• Click OK.
To shift the background graph
You can shift the background graph to facilitate
comparison with calculated or measured graphs.
This feature is used mostly in hypothesis testing
in Modeling.
• Select Shift Background Graph.
• Drag the graph to the left or the right with
the mouse or with the arrow keys for pixel
steps. Use <Shift>-<arrow-keys> for
larger steps.
• It is possible to zoom the diagram during
the shifting process, by pressing the <Shift>
key.
Figure 30. Shifting the Background Graph.
• Select Stop Shifting Background Graph.
• To delete the background graph select Delete Background Graph > Imported.
Note: Background graphs are included in determining the zoom factor after pressing the Zoom-to-fit
button.
43
3. Specific table options
3.1. Introduction
A table is used to display data points
numerically in columns.
On starting a measurement a table is filled with
values. When doing a new run, the existing data
is overwritten by the new data. A table can
maximally contain eight columns (data ranges)
and 500,000 rows with data.
It is possible to change fonts and its color used
in the table via its Tool menu option Change
Font….
Most options described below can be reached
via the table Tool menu. Several options appear
only when there are data points available in the
Activity.
Figure 31. The measurement data in the table.
3.2. Rows
The option Rows in the table Tool menu gives a submenu with various options applying to table
rows. Not all options described here are available in all user modes. With most of these options it
is handy to select the desired rows in the table prior to the rows operation.
Sort
This option rearranges all rows in a table according to the sorted
quantity in ascending or descending order. Sorting is useful when
the quantity along the x-axis of a diagram is not a continuously
increasing or decreasing series of values. It is also useful in
manually-triggered measurements.
• Select the Tool menu option Rows > Sort (in some user
Figure 32. The Sort Rows dialog.
modes only Sort).
• Type the number of the column (1 .. 8) which contains the
quantity to be sorted. The column in which the cursor was located is pre-selected.
• Select the sort order: Ascending or Descending.
Notes:
-
The sorting process of a column with a formula can take some time to complete.
-
Other diagrams/tables which also use the quantity being sorted are rearranged accordingly.
Example
If Connection type in the diagram style is set to Line, the points in the diagram are connected
point-to-point. When the values along the horizontal axis are not in increasing order, this setting
will result in a messy diagram. Use the Sort option to remedy this problem.
44
As an example take the
function y = x².
In diagram A, this function has
been drawn with its x-coordinates in random order.
In diagram B, this function has
been drawn after sorting its x
co-ordinates in ascending
order.
Insert
This option inserts a number of empty rows at the row in which the cursor is located.
• Click the row at which to insert empty rows or make a selection of rows at the point to insert
empty rows.
• Select the Tool menu option Rows > Insert.
• Specify the first and the last row index; for the selection the first and last row indexes are
taken automatically. When necessary change the first or last row index.
• Click OK. The selected rows are shifted down and the specified number of new rows is
inserted at the selection (point).
Delete
This option deletes a number of rows at the row in which the cursor is located.
• Click the row at which to delete rows or make a selection of rows.
• Select the Tool menu option Rows > Delete.
• Select Odd rows, Even rows or User-defined rows. After selecting the first two options the
rows are directly removed from the table. After selecting User-defined rows:
- Specify the first and the last row indexes; for the selection the first and last row indexes
are taken automatically. When necessary change the first or last row index.
- If desired, specify the Step value for the rows to delete. The step value indicates the
number of rows which will be skipped during removal (see example below).
- Mark either Delete rows (the selected rows are deleted), or Keep rows (the not-selected
rows are deleted).
- Click OK. The specified rows are deleted.
Examples:
- With Step = 1 and Delete rows marked (the default settings), all selected rows will be
deleted.
- With Step = 1 and Keep rows marked, all not-selected rows will be deleted.
- With Step = 2 and Delete rows, all odd rows will be deleted from the selection.
With Keep rows the even rows will be deleted.
- With Step = 3 and Delete rows the first of each three rows in the selection will be deleted.
With Keep rows the second and third of each three rows will be deleted. Etc.
3.3. Edit table cells
To edit a value in a single cell
• Click a cell in the table. Type a value. Press <Enter>, or press <Tab>, or click in another
cell to confirm. The old value will be overwritten.
Or
45
•
•
•
Double-click a cell or press <Enter> to display the cell value with all its decimals and
change the value. Press <Enter>, or press <Tab>, press one of the arrow keys or click in
another cell to confirm. The old value will be overwritten.
Undo the last change with <Esc> before confirming, and with <Ctrl>+<Z> after confirming.
To erase a value in a cell click a cell in the table, or make a selection of cells and press
<Del>. The contents of the cell(s) will be emptied.
3.4. Import data
With the Import Data option data from external files (Coach files, Text files, and DIF files) and
data from Texas Instruments Graphical Calculators (TI 83 and TI83Plus) can be imported. Data
can be imported in a new table, or can be added to an existing table.
To import data in a new table
• Click the yellow Table button.
• Click Import Table.
• Select the source from which data will be imported.
- For Coach Result data the Open Result dialog appears. Select a Result.
- For IP-Coach 4 data first select a *.dt0 file and then proceed with the Import data dialog.
- For Text files and DIF files first specify a file structure and then proceed with the Import
data dialog.
- For TI calculators connect the TI calculator to the computer and then proceed with Import
data dialog.
See below for a detailed description of importing the various data sources.
• Place the table in a pane.
To add imported data to an existing table
• Select the Toole menu option Import data.
• Select the source from which data will be imported. See below for a description of importing
the various data sources.
The Define Text File Structure dialog
This dialog makes it possible to specify parameters for the import process for text files. It has
three sections:
Figure 33. The Define Text File Structure dialog.
46
•
•
•
•
In the File settings section, specify the decimal separator, text qualifier and thousands
separator. Use None when the item does not apply.
The Row range and meaning section gives the possibility to specify which rows to import
(e.g. you can omit the rows which do not contain numbers) and how the first row(s) will be
interpreted. It is possible that the original file uses the first one or two rows as a header
containing the quantity and unit of the column. Check the options as desired.
In the Column delimiters section specify the column delimiter, i.e. the symbol which
separates the values of the various data ranges in the file.
Press OK to confirm your settings. The Import dialog opens. Proceed as described below.
The Define DIF File Structure dialog
This dialog makes it possible to specify parameters for importing DIF files. The displayed
settings are adapted as much as possible from information in the selected file. It has two sections:
Figure 34. The Define DIF Structure dialog.
•
•
•
In the File settings section, specify the decimal separator and thousands separator. Use
None when the item does not apply.
In the Row range and meaning section specify how the first row(s) will be interpreted. It is
possible that the original file uses the first one or two rows as a header containing e.g. the
quantity and unit of the column. Check the options as desired.
Press OK to confirm your settings. The Import dialog opens. Proceed as described below.
The Import Data dialog
This dialog makes it possible to specify
parameters of the import process. The dialog
has three sections.
The Original data section gives information
about the original file:
- the file name;
- the number of rows;
- the number of columns;
- click the column to display information
about: quantity, unit, minimum and
maximum.
• In the Import as section select the table
column (C1 .. C8) where the column of the
original file (specified in the Original data
section) should be imported. By default the
first empty column is selected.
• If you do not want to import a column,
select None.
47
Figure 35. Import Data dialog.
•
•
•
•
•
•
•
If necessary edit the suggested quantity, unit and number of decimals.
Repeat these steps for all columns of the original file.
In the Import range section specify the row indices (one setting for all columns) to be
imported.
When necessary change the first and last row index.
If desired, specify the Step value for the rows to be imported. The Step value indicates the
number of rows which will be skipped during import.
Mark either Import selected (the selected rows are imported), or Import inverse (the notselected rows are imported).
Click OK. The specified columns are imported with the specified number of rows.
Examples:
- With Step = 1 and Import selected marked (the default settings), all selected rows will be
imported.
- With Step = 1 and Import inverse marked, all not-selected rows will be imported.
- With Step = 2 and Import selected, all odd rows will be imported. With Import inverse the
even rows will be imported.
- With Step = 3 and Import selected the first of each three rows in the selection will be
imported. With Import inverse the second and third of each three rows will be imported. Etc.
Import data from TI calculators
For importing data from a TI calculator (TI-83 or
TI-83P) TI USB Graph Link cable is needed.
• Connect one end of the TI Graph Link cable to
the PC USB port.
• Connect the other end of the cable to the port
at the bottom of the calculator.
When Coach is not able to communicate with
the connected calculator check your cable
Figure 36. TI Silver USB Graph Link cable.
connections and check the selected calculator
type.9
• Import data. The Import Data dialog is similar to the standard Import Data dialog. The only
difference is that in the Original data section information about the data stored in the
calculator is given: instead of columns C1, C2 .. data lists L1, L2 … are displayed.
3.5. Export data
With the option Export data Coach data can be written in other file formats or exported to a TI
calculator. This option always exports all values of the table (independent of a selection).
To export to Text or DIF format
• Select the Tool menu option Export data.
• Select Text or DIF file.
• Specify parameters of the export process in the Define Text File Structure or Define DIF
File Structure. These dialogs are very similar to the dialogs used for importing data.
9
A TI-83 calculator should be installed and the corrected type of the calculator (TI-83 or TI-83P) should
be selected. Click the Install Hardware Drivers button in the Main toolbar to check these settings.
48
•
Please notice that for ∗.TXT files all kinds of delimiters can be chosen (usually Tabs are
used) and for ∗.CSV (Comma-Separated Values) files, the comma should be chosen.
Save the file.
Note: Do not select a comma as separator when the comma is also used as decimal separator. The
Result is a file which will not be interpreted correctly by the other program. (If necessary check
your decimal separator in the Regional settings in Windows' Control Panel).
Often it is much simpler to export data via Copy and Paste. Use these options also when you
want to export a selection of the Table:
- First make a selection, copy it to the Clipboard and paste it in another program (e.g. Notepad,
another Text editor, etc.). Save the file in that Program.
- A second way is to delete the non-selected rows from the Table and select Export data as
above.
To export to TI calculator
• Connect one end of the TI Graph Link cable to the PC USB port.
• Connect the other end of the cable to the port at the bottom of the calculator.
When Coach is not able to communicate with the connected calculator check your cable
connections and check the selected calculator type.2
• Right click the Table pane or press its Tool menu button.
• Select Export data.
• Select TI Calculator.
• Specify parameters of the export process in
the Export Data dialog. The dialog has
three sections.
The Original data section gives
information about the original file:
the table name;
the number of rows;
the number of columns;
click the column to display information
about: Quantity, Unit, Minimum and
Figure 37. Export Data dialog.
Maximum.
In the Export to TI calculator section select the List (L1, L2 .. ) where the column of the
original file (specified under 'Original data') should be imported. By default the first list L1
is selected.
• If you do not want to import a column, select (None).
• If necessary edit the suggested Quantity and Unit.
• Repeat these steps for all columns of the original file.
• Click OK. The specified columns will be imported.
If a TI calculator has not enough memory for exported data then the warning is given.
49
50
III. Measurement
Table of Contents
1. INTRODUCTION.................................................................................................................................................... 52
2. THE PANEL WINDOW ........................................................................................................................................... 52
3. COMMUNICATION BETWEEN COMPUTER AND INTERFACE .................................................................................... 53
4. SENSORS ............................................................................................................................................................. 55
4.1. Sensor Icons................................................................................................................................................ 55
4.2. Voltmeter and counter icons....................................................................................................................... 56
4.3. The sensor palette....................................................................................................................................... 56
4.4. Sensor properties........................................................................................................................................ 59
5. CALIBRATION ...................................................................................................................................................... 62
5.1. Simple linear calibration ............................................................................................................................ 62
5.2. Advanced calibration.................................................................................................................................. 62
6. THE MEASUREMENT SETTINGS ............................................................................................................................ 66
6.1. Time-based measurement ........................................................................................................................... 66
6.2. Event-based measurement .......................................................................................................................... 69
6.3. Manual measurement ................................................................................................................................. 70
7. MEASURING ........................................................................................................................................................ 72
8. ADDITIONAL ACTIVITY OPTIONS FOR MEASUREMENT ......................................................................................... 75
51
1. Introduction
Measurement activities are used to collect data from sensors e.g. for temperature, light intensity,
sound level, pH, etc. and to display, analyze and process the measurements. A sensor, connected
to an interface, measures a physical quantity and transforms it into an output voltage, which is
read by an interface. The interface, connected to computer, converts an analog voltage signal into
a digital signal that is transferred and interpreted by the computer.
Coach collects measurement data according to the measurement settings after pressing the green
Start button. Although Coach supports many ways of measuring, most Activities use time-based
measurement in which measurements are stored at regular time intervals according to the
sampling frequency. Other methods of measuring are event-based measurement, in which
measurements are taken each time a pulse (event) is received on an interface input (usually a
counter). And in manually-triggered measurement a single measurement is taken every time the
user presses a button. This method also allows to type in data via the keyboard.
Starting from version 6.3 Coach is also able to do measurements of time interval and frequency.
This is accomplished by means of special ‘converted’ sensor icons: next to regular sensors,
Coach can convert sensors to measure pulses and time-intervals or to do all kinds of counting.
These settings are described in & 4.3. Such converted sensors can be combined with all three
measurement methods.
During the measurement, data can be presented in graphs, tables, meters or displayed as digital
values. Measurement data can also be used as input for animations.
2. The Panel window
The screen image of the used interface panel is located in the Panel window. Click the Panel
Window
button to open the Panel window. Click this icon again to close the window.
The screen image of the interface panel has inputs for sensors just like the connectors on the real
interface. Some of interfaces like CoachLab or CoachLab II/II+ can be used in control systems.
Panels of these interfaces have also outputs to connect actuators like motors, lamps, and buzzers
(see chapter IV. Control).
Figure 38. CoachLab II/II+ panel with a Temperature sensor and a 12V Motor actuator.
52
At the sides of the panel two palettes for icons may be displayed: the sensor palette (left side)
and the actuator palette (right side). You can drag and drop sensor icons on inputs and actuator
icons on outputs of the panel. For measurement most of the time only sensor icons are available.
Sensor icons placed on inputs of the active panel display the actual values measured by the real
sensors. Actuator icons placed on outputs of the active panel display states of connected
actuators.
3. Communication between computer and interface
For existing Measurement Activities an interface panel is already chosen by an Activity Author.
The interface is initialized during opening of an Activity/Result. When Coach is not able to
communicate with connected interface then the communication error message is displayed.
Figure 39. The communication error dialog.
This can happen when:
- the Activity/Result is developed for another interface than the one currently using;
- there is no interface connected to the computer;
- there is no communication between interface and computer.
The communication error dialog has three or four buttons.
Abort - The Activity/Result will not open.
Retry – Coach tries to activate the interface again.
Ignore – The Activity/Result opens and the interface will be inactive (i.e. measurement and
control are not possible). No values and states are shown on sensor and actuator icons.
Select Other – (This button is not always available). A list of alternative interface panels for
this Activity/Result opens. Select the interface panel which is connected to your computer.
Check whether the name of the connected interface corresponds with the name of the panel
Coach tries to initialize.
- If the name of the connected interface does not correspond to the name of the panel, press the
button Select Other (if available). If the button Select Other is missing (i.e. no alternative
interface panels have been defined by the Author of the Activity) press Ignore. Change the
panel inside an Activity.
- If the name of the connected interface corresponds to the name of the panel, there may be a
communication problem. Reset the interface and press Retry. If the communication is still not
restored check the driver settings of the interface (e.g. is the right COM port).
The communication between the interface may be lost also during working in an Activity e.g.
when the sensor values do not change at all for a longer period of time (normally, the sensor
values fluctuate a little bit because of noise, unless the number of decimals is set to low values)
or if nothing happens when you press the green Start button. In such situation the interface panel
has to be reset.
53
To reset the panel
• Right click the panel and select Reset Hardware.
+
• If this does not help, first hard reset the interface (for CoachLab II/II , disconnect and
reconnect the power supply) and the try Reset Hardware again.
• If this does not help, close and open the Activity again.
It is also possible to change an interface panel used in an Activity by selecting an alternative
panel or change the panel in the Activity options.
To select an alternative panel
• Right click the panel and select
Alternative Panel. If this option is
not available, alternative panels have
not been set by the Author of this
Activity.
• Select a panel from the menu list.
The list of alternative panels is
limited to the installed panels.
-
It may be that the new panel does not
support all sensors or actuators, which
Figure 40. Selecting an Alternative panel.
are predefined in the Activity. Coach
will announce this and upon confirmation will remove not supported sensor icons and/or
actuator icons from their palette.
To change a panel
• Go to menu option Options >
Activity Options.
• Select another panel from the dropdown list.
The connected sensor and actuator icons
will be re-connected automatically to their
equivalent position on the new panel
provided they are supported by the new
panel.
Figure 41. Select another panel in the Activity options.
- Changing the panel may have serious implications for the existing results. It is recommended
to save your results prior to changing the panel.
- Selecting No panel option is useful only when you want to change the Activity type to
Modeling or Data Video.
54
4. Sensors
4.1. Sensor Icons
A sensor icon is a small picture representing a sensor.
Information about a sensor is displayed in the yellow tool tip
when the mouse cursor is placed over the sensor icon. The tool
tip displays the sensor’s name, article number, brand and the
measurement range e.g. Temperature sensor (016) (CMA) (-18 ..
110°C).
In an Activity sensor icons can be located on the sensor palette or
on panel inputs. If a sensor icon on the panel can not be moved to
a different input or to the sensor palette, it may be locked or Figure 42. Sensor icons on the
sensor palette.
detected (orange icons). If this is the case, the mouse cursor stays
an arrow when moved over the icon. Detected sensor icons are used for sensors automatically
recognized by an interface for example by CMA ULAB or CoachLab II+. If the icon can be
moved, the mouse cursor turns into a ‘hand’.
When the user tries to replace a detected sensor icon by dragging a sensor icon from the palette
then the question Replace the currently connected sensor? appears. Clicking Yes replaces the
detected sensor icon by the normal sensor icon.
The operations below cannot be performed in all user modes.
To place a sensor icon on the panel
Drag an icon from the sensor palette to an input of the panel. Make sure your real sensor is
connected to the same input of the interface as its icon is on the panel. When the sensor icon
jumps away, that sensor cannot be connected to the particular input of the panel.
To replace a sensor icon on the panel
Drag an icon from the sensor palette to an input with an icon. Coach will replace the existing
sensor icon with the new one. Diagrams, tables, meters and values are automatically adapted.
To move a sensor icon the panel
Drag the sensor icon on the panel to another input. Diagrams, tables, meters and values are
automatically adapted.
+
Note: On CMA ULAB, CoachLab II/II and €Lab it is not possible to move a counter icon from one input
to another. To accomplish this, first place it back on the sensor palette (this happens
automatically when moving it from its position and releasing it). Then place it on the new input.
To remove a sensor icon from the panel
Remove a sensor icon by dragging it away from the panel. Then release the mouse. Coach
automatically places the icon neatly back in its palette position.
55
4.2. Voltmeter and counter icons
There are two sensor icon types which do not correspond to real sensors: Voltmeter and Counter
icons.
The Voltmeter icons measure any voltage on a panel input. These icons simply display the
voltage (un-calibrated signal) of any connected sensor to the input. There are icons with two
ranges: 0 .. 5V and –10 .. 10V.
Note: When using CMA Adapter 0519, only voltages between 0 and 5 V can be measured.
The Counter icons count the signal from any connected sensor to the input. A counter
can be reset to zero with a little '0'-button on its icon.
In order to count a signal, the sensor should generate an oscillatory signal or pulses. Usually the
pulses are counted incrementally, however with a small option in the measurement settings the
number of pulses in each individual interval can also be obtained by means of a Delta formula.
The resulting counts per interval can be converted to a frequency by means of the formula 1/n.
For some interfaces it is possible to define when a signal will be regarded as a pulse.
To specify threshold settings
• Right click a counter icon on the panel and select Set Threshold.
• Enter the Threshold value. This is the value the signal has to pass to
be counted.
• Select the direction Up, Down or Both. This is the direction which
the signal should pass to be counted as a pulse.
• The total range of the sensor is displayed.
• Click OK to confirm.
Figure 43. Set threshold
of a counter.
4.3. Using a sensor as counter, 1-bit digital sensor, frequency
or time-interval meter (starting from version 6.3)
With the CoachLab II/II+, €Lab and ULAB interfaces it is
possible to convert a sensor on an analog input of the Panel
to function as a counter, a 1-bit digital meter, a frequency
meter or a time-interval meter.
You can convert a sensor icon on the panel via its Tool
menu. Both detected sensors and sensor icons from the
library can be converted.
Converted sensor icons can be recognized: their interior is
colored lilac (its border color still indicates if it is selected
from the library (green) or detected (orange)). Moreover,
the counter, frequency meter and time-interval meter have a
set-to-zero button, while the 1-bit digital sensor displays a
state name for each of its two states. Also the tooltip Figure 44. Use as option in the tool menu
description of the sensor icon has a suffix ‘as counter’, ‘as of a sensor icon on the panel.
frequency meter’ etc. The input is internally monitored at
10 kHz which puts a limit on the maximum frequency (5 kHz) or count rate (5000 counts/s).
Such converted sensors can be a. o. very useful as pulse source for Event-based measurements
(see & 6.2. Event-based measurement).
56
Use as Counter
In order to count a signal, the sensor should generate pulses (an
oscillating signal). Each time the threshold value is passed in the
indicated direction, the counter value is increased by 1. It is also
possible to select direction ‘both’. Then 2 pulses will be detected
each period: when the signal passes the threshold upwards and
when it passes the threshold downwards.
To use an analog sensor as a counter
• Right click a sensor icon on the panel and mark Use as >
Counter.
• Enter the Conversion settings. Enter the Threshold value
in calibrated units. This is the value the signal has to pass to
be counted. The total range of the sensor is displayed.
• Select the direction Up, Down or Both. This is the direction Figure 45. Defining an analog
sensor as a counter.
which the signal should pass to be counted as a pulse.
• In the Counter setup section enter the properties for this
counter: the Maximum number of expected pulses (defines the vertical axis in a diagram),
the Quantity, the Unit and the number of Decimals.
In this section also the signal of the counter can be calibrated quickly. To shift the zero point
of the counter mark the Shift option and specify the shift value. To make this calibration
cyclic mark the Periodic option (e.g. when rotation is measured) and specify the period
value.
• Click OK to confirm.
Use as Digital sensor (1 bit)
A 1-bit digital sensor only assumes two values: 0 and 1. The threshold value distinguishes
between these states. If the analog values are above the threshold, the 1-bit digital sensor has the
value 1 (state ‘On’), if the values are below the threshold, the 1-bit digital sensor will have the
value 0 (state ‘Off’). The names of the states are also displayed, and the names can be edited.
This can be useful for measurements with a photogate. The sensor simply displays when an
object is between the photogate and when it is not. It is also useful in combination with control
programs.
To use an analog sensor as a digital sensor (1-bit)
• Right click a sensor icon on the panel and mark Use as > 1bit digital sensor.
• Enter the Conversion settings. Enter the Threshold value
in calibrated units. This is the value the signal has to pass to
flip into its other state. The total range of the sensor is
displayed.
• In the Sensor definition section, enter the properties for the
1-bit digital sensor: the Quantity and the strings for the state
names.
Figure 46. Defining an analog
sensor as a 1-bit digital sensor.
• Click OK to confirm.
57
Use as Frequency meter
In order to measure the frequency of a signal, the sensor should
generate pulses (an oscillating signal). As of the limit of 10 kHz it
is theoretically not possible to measure frequencies higher than
5000 Hz, but in practice this value may be as low as 3000 Hz.
To use an analog sensor as a Frequency meter
• Right click a sensor icon on the panel and mark Use as >
Frequency meter.
• Enter the Conversion settings. Enter the Threshold value in
calibrated units. This is the value the signal has to pass to flip
into its other state. The total range of the sensor is displayed.
Figure 47. Defining an analog
• In the Sensor definition section, enter the properties for the sensor as a frequency meter.
frequency sensor: the Minimum, Maximum, Quantity and
Unit and the number of Decimals.
• Click OK to confirm.
Use as Time-interval meter
A period meter is used to measure time intervals. All kinds of
time intervals can be measured a. o. start-stop measurement,
timing how long a light gate is covered, or how long it is open or
both and measuring periods in periodic signals. For CoachLab II+
five different time interval types, and three for the other
interfaces which support sensor conversion.
To use an analog sensor as a Time-interval meter
• Right click a sensor icon on the panel and mark Use as >
Time-interval meter.
• Enter the Conversion settings. Enter the Threshold value in
calibrated units. This is the value the signal has to pass to flip
into its other state. The total range of the sensor is displayed.
• Select the Interval type. There are five different interval
types indicated by names and pictures in the drop-down list,
but not all types are available for all interfaces. CoachLab II+
supports all five types. If less types are supported, then only
these are shown. The types are:
- T Up: time intervals between successive up flanks are
measured.
- T Down: time intervals between successive down flanks
are measured.
- High: the periods the signal is high are measured.
- Low: the periods the signal is low are measured.
- High & Low: both the time intervals that the signal is
high and low are measured alternately.
• In the Sensor definition section, enter the properties for the
Time-interval meter: the Minimum, Maximum, Quantity,
Unit and Number of Decimals.
• Click OK to confirm.
58
Figure 48. Defining an analog
sensor as a Time-interval meter.
Figure 49. The five possible time
interval types for a time-interval
meter. Which types are available
depends on the interface.
Notes:
+
- The number of allowed converted sensors depends on the hardware. €Lab and CoachLab II support 2
converted sensors, while ULAB supports up to 4. If you want to define another sensor as counter while
the maximum number of converted sensors is in use, first reset one to analog sensor (see next point).
- To stop using an analog sensor as a converted sensor right click the converted sensor icon and mark
the option Use as > Analog.
4.4. The sensor palette
The sensor icons can be added to the sensor palette by selecting them from Coach Libraries or by
defining new sensors. A sensor icon is available only in one sensor palette position: if you need
more icons of the same sensor, these will be stacked in the same position.
To add/remove sensor icons to the sensor palette
• Right click an empty location in the sensor palette and select Select from Library (change
between CMA Library or User Library if necessary and possible).
• Choose a sensor from the list. If desired change the Number of icons.
• Click OK. The sensor icon is placed on the sensor palette.
• To increase the number of icons of the same sensor right click a sensor icon on the sensor
palette and select Add. Type the number and click OK.
• To replace a sensor icon by an alternative sensor right click a sensor icon and select
Alternative Sensor. A list opens with sensors of the same family. Select the desired
alternative sensor. Coach will replace the sensor by the alternative and automatically adapt
diagrams and tables.
• To remove a sensor icon(s) from the sensor palette right click a sensor icon and select
Delete One to delete a single icon, or Delete All to delete all icons of this type (also the
icons placed on the panel will be removed, including existing data).
To define a new sensor icon
• Right click an empty location on the sensor palette and select Create New.
• Specify the sensor properties.
Sensor icons are defined locally in the Activity or in the CMA Sensor Libraries. To make the
new defined sensors available to all users of the Coach system these new sensors should be
stored in the User Library.
4.5. Sensor properties
Sensor properties consist of all information regarding a sensor and its icon.
To open sensor properties
• Right click a sensor icon and select Edit Properties. Or
• Right click an empty position in the sensor palette and select Create New.
The Sensor Properties dialog displays the following information:
59
Name
Gives the full name of the sensor.
For self-defined sensors enter a new
name in the Name field, which
appears after selecting from the
drop-down list Self-defined sensor.
Brand (Advanced)
The brand of a sensor like CMA or
Self-made. There may be several
temperature sensors of different
brands. Make sure you select the
icon that exactly corresponds to the
sensors you use.
Note: The list of sensors can be sorted
alphabetically on sensor name or on
sensor brand.
Family
Family of sensors to which the
sensor belongs: sensors from the
same family are each others
alternative sensor.
Figure 50. The Sensor Properties dialog.
Note that the Signal type section is inactive when this dialog is
invoked via a sensor icon on the panel.
Short name
When the sensor is on the sensor palette then the short name of the sensor is displayed on the
icon. When a sensor icon is placed on the panel, the (current) signal value is displayed on the
icon, while the sensor's short name marks its (empty) position in the palette.
Kind (Advanced)
There are four different kinds to be selected.
General - almost all sensors belong to this category.
LEGO Yellow - only for yellow LEGO DACTA sensors.
LEGO Yellow - only for blue LEGO DACTA sensors.
Sonar - for ultrasonic sensors.
Note: The field Kind is only available if the Sensor properties are accessed when all sensor icons of this
type are in the Sensor Palette (and none on the Panel).
Icon
The picture which is used on the sensor icon.
The Scaling and Display options Min, Max, Quantity, Unit, Decimals defines the sensor icon's
scale settings and are used when the sensor's signal is displayed in a diagram.
Each sensor icon has its own standard meter to display its signal. With the option Display type
you can select the standard display of the meter.
In the Signal type section the suitable signal type for the sensor is set. This section is active only
if the sensor properties were accessed via an icon on the sensor palette. Coach supports four
different signal types.
60
Analog:
Used for sensors which measure analog (i.e. continuously varying)
quantities (majority of sensor.
Up-counter:
Used for sensors which count pulses. Up-counters are not able to detect a
direction: all pulses are added to each other. This signal type is used e.g.
for counting (GM sensor; smart pulley independent of the direction of
rotation) or for event-based measurements. What is considered as a pulse
depends on the setting of the threshold.
Up/Down Counter: Used for sensors which count pulses. Up/down-counters detect a direction:
depending on the direction, pulses are added or subtracted. This type of
sensor is very rare and is supported only by ULAB and CoachLab II+.
What is considered as a pulse depends on the setting of the threshold.
Digital:
+
This sensor type is very rare and only supported by CoachLab II . The
sensor's signal consists of a few discrete states depending on the selected
number of bits. (Bits = 1: 2 states; Bits = 2: 4 states, etc.)
•
Under Bits, select the number of bits.
•
Select the state.
•
Press the Edit button to enter the text for the state.
•
Repeat the above two steps to assign a text to all states.
•
Example for a push button: State = 1, Text = High
State = 0, Text = Low
Note: If no text is assigned to the states of a digital sensor, Coach displays the
bit number of the state.
The Input range option specifies which voltage range of a panel input is used by the sensor. The
most sensors use 0-5V range.
In the Default conversions section the signal averaging can be applied by checking Apply
averaging. If averaging is applied, then Coach monitors the signal at an oversampling frequency
of 10 kHz. During each sampling interval, Coach calculates the average of the recorded
minimum and maximum value (½(min+max)). This value will be assigned as the measured
value. If the sampling interval is longer than 10s, the average will be applied only over the last
10s of each sample interval.
The Calibration section defines the relation between the voltage values produced by a sensor (or
the values of a counter) and the values of the physical quantity measured. With this relation,
Coach is able to display the measurement data in the right quantity and unit.
None:
The sensor's signal is not calibrated and displayed as voltage signal.
Linear:
The calibration curve is determined by two calibration points (X0, Y0) and
(X1, Y1) (see & 5.1 Simple linear calibration).
Advanced:
By selecting this option you can modify and create advanced calibrations
(e.g. for non-linear sensors). Click the Calibration button to open the
Advanced Calibration dialog (see & 5.2 Advanced calibration).
Shift calibration:
If the value of the calibrated sensor is too high or too low, you can shift
the calibration line through a third point (often it is a zero point of the
61
measured value). The option Shift the calibration through works for
both Linear and Advanced calibrations.
After selecting the Shift the calibration through option Coach defines
the coordinates of the additional calibration point (X, Y). The form of the
calibration graph stays the same but it is forced through this third point.
By default Coach sets the actual sensor voltage value (or the counter
value) as the X coordinate and the zero value of the quantity measured as
Y coordinate of the third calibration point.
If the range of the sensor changes quite a bit, it may be necessary to adapt
its minimum and maximum values.
The option Shift the calibration can be used e.g. to
- quickly reset the equilibrium force of a mass on a spring connected to a force sensor to zero.
Then forces with respect to the equilibrium position can be measured.
- set the reading of a temperature sensor to zero at room temperature. Then temperature
differences can be measured.
- change the calibration of a position sensor from 0..240° to –120..120° (more useful for a
pendulum).
A faster way to shift the calibration through its zero point or to another value is to right click its
icon on the panel and to select Set to Zero or Set to Value. For the latter option the shift value
must be specified. Select Reset Calibration when you want to remove the shifting.
5. Calibration
5.1. Simple linear calibration
This simple calibration is used for sensors which signal varies linearly with the measured
quantity. Such simple calibration is sufficient for many sensors.
To perform linear calibration
1. Right click a sensor icon and select Edit Properties.
2. In the Calibration section select Linear.
3. When the icon of the sensor to be calibrated is connected to the active panel then the digital
voltmeter appears on the right side of the dialog. This voltmeter continuously displays the
actual sensor voltage or counter value.
4. Enter the coordinates of two calibration points: X0 is the voltage (or counter value)
corresponding to the quantity value Y0. X1 is the voltage (or counter value) corresponding to
the quantity value Y1.
5. A linear best fit (straight line) through the calibration points is calculated by the Leastsquares method. The calibration becomes more accurate when the calibration points are
farther apart from each other.
6. Click OK to finish calibration process and start using the calibration.
5.2. Advanced calibration
Advanced calibration allows to modify and create sensor calibrations e.g. for non-linear sensors.
To open the Advanced calibration dialog
1. Right click a sensor icon and select Edit Properties.
2. In the Calibration section select Advanced and click the Calibration button.
62
The Advanced Calibration dialog shows a calibration table with the calibration points, and a
calibration graph.
Figure 51. The Advanced Calibration dialog.
The following calibration methods are available in Coach:
Points:
During a calibration by points the actual sensor voltage value is measured or
typed and the value of the corresponding quantity is typed.
Function:
In a calibration by function (linear or quadratic and a number of mathematical
functions, like logarithm), the required calibration function coefficients are typed
in.
The sensor voltage (or the counter value) is displayed along the X-axis of the calibration graph
and the quantity that is being calibrated along the Y-axis.
X-range:
Xmin and Xmax determine the range of X-axis. In a calibration by points Xmin and
Xmax are automatically determined by Coach (the values cannot be changed). In
a calibration by function you should enter the values Xmin and Xmax yourself.
Periodic:
This option allows repeating the calibrated interval along the whole X-range.
Example: Left graph periodic is off, right graph periodic is on.
63
Cut on Y:
This option is selected the calibration curve will not be extrapolated beyond Ymin
and Ymax. Instead all Y-values below Ymin and above Ymax are kept constant at
Ymin and Ymax respectively.
Example: Left graph cut on Y is off, right graph cut on Y is on.
There are few ways of connecting the calibrations points. For the Function method only Linear,
Quadratic and Logarithmic function-fits are possible.
Point-to-point: The calibration points are connected by lines. The first line is extrapolated
towards Xmin and the last line is extrapolated towards Xmax.
Linear:
A linear best fit (straight line) through the calibration points is calculated by the
Least-squares method. This calibration line will be extrapolated to cover the
whole X-range.
Note: In case two calibration points are entered, the result of an advanced linear
calibration is the same as a linear two-point calibration directly entered in the Sensor
Properties dialog. A linear two-point calibration is also shown in the calibration
diagram.
Quadratic:
A quadratic best fit (parabola) through the calibration points is calculated by the
Least-squares method. This calibration parabola will be extrapolated to cover the
whole X-range.
Spline:
A smooth curve forced through all calibration points is calculated using a
polynomial approximation. The resulting curve may have a 'bumpy' character.
This calibration curve will be extrapolated to cover the whole X-range.
Note: This setting is used often for non-linear calibrations, to obtain a smooth
calibration curve. If the curve is too bumpy, try to correct the calibration point which
causes the bump.
Bezier:
A smooth curve is calculated through the first and the last calibration points, the
values in between only affect the curvature. The curve will not exactly follow
the calibration points and therefore will have a less 'bumpy' character than the
Spline curve. This calibration curve will be extrapolated to cover the whole Xrange.
Note: This setting is less often used than a spline function-fit.
Logarithmic: A best logarithmic fit (y = a + b ln(x)) through the calibration points is
calculated by the Least-squares method.
64
Some examples:
Point-to-point calibration
Linear calibration
Quadratic calibration
Spline calibration
Bezier calibration
To perform a calibration
1. Open the Advanced Calibration dialog.
2. Select the calibration method: Points or Function.
3. Under Range, enter the X-range (if available).
4. When desired select the options Periodic and/or Cut on Y. For the Cut on Y option specify
Ymin and Ymax.
5. Select the desired function-fit type.
6. Perform the calibration:
For the Points method:
- Make sure an experimental setup is available to do measurements. And have instruments
available to determine a reference value of the quantity (e.g. a thermometer, melting ice
and boiling water, etc.).
- The small voltmeter below the calibration table continuously displays the actual sensor
voltage measured on a panel input to which the sensor is connected. This happens only if
the sensor to be calibrated is connected to an input of the active panel and the Sensor
Properties dialog was opened by right clicking the sensor icon on the panel! Calibration
via a connected sensor is the most accurate calibration.
- If necessary wait for the voltage to stabilize.
65
- As soon as you press the Add Row button the last measured values appears in the
Voltage field. If Coach is running
without the active panel or the
Sensor Properties dialog was
opened via a sensor icon on the
sensor palette then the voltage
value will not appear. In this case
this value has to be typed in.
- Click the Value field and type the
corresponding value of the
quantity.
Figure 52. The Method tab of time-based measurement.
- Click OK to add the calibration
point to the table and the diagram.
- Repeat the above steps until sufficient calibration points have been obtained.
For the Function method:
- Type the function coefficients in the Coefficients fields.
- The calibration graph appears in the diagram.
7. To delete a calibration point (row) click Delete Row. Click Yes to confirm that you want to
delete the marked calibration point. The calibration point is removed from the table.
8. To delete all calibration points (all rows) click Delete All. Click Yes to confirm that you
want to delete all calibration points.
9. Click the Test button to perform a calibration test. During the test Coach shows the actual
voltage (counter value) and the calibrated quantity value.
10. Click OK to finish calibration process and start using the calibration.
6. The measurement settings
In the Measurement Settings dialog you can specify how Coach will measure. Basically there are
three different measurement methods: time-based, event-based and manual measurement. By
using special ‘converted’ sensor icons, one can extend Coach’s measurement capabilities with
counting, time-interval and frequency measurements (see & 4.3).
To open the Measurement Settings dialog
• Click the Measurement Settings button.
• Select the measurement type: Time-based, Event-based or Manual.
• It depends on the chosen measurement type and on the user mode you are working in which
tabs and which options are available.
• Specify the settings. See detailed description below.
6.1. Time-based measurement
In this mode, measurements are taken at regular time intervals (time is the independent variable;
the measured quantities are the dependent variables). Most measurements are of this type. Use
this measurement type also to do automated counter intervals.
To specify settings for a time-based measurement
1. In the tab sheet Method:
• Enter the Measuring time, type in the duration of the measurement and select the unit
from the drop-down list (default 10 s).
66
• Enter the frequency of the measurement. Type in the sampling rate and select the unit
from the drop-down list (default 50 per s).
• The Number of samples is automatically calculated from the settings of the fields above.
It is also possible to enter the desired number of measurements. In this case the
measuring time will be adapted.
Note: The actual measured number of samples is usually the shown number plus 1, because of
the measurement at time t=0.
2.
• A message Trigger is disabled/enabled shows if triggering is enabled.
• If a counter is connected to the panel, the More button reveals a pane with the Reset
counter to zero each sample interval option. If this option is checked, the counter will
be reset each sample time interval (specified by the frequency). This option (default off)
is not available for off-line measurements.
If you want to trigger the
measurement click the Triggering tab
and mark the Enable triggering
option. The trigger settings options
become active. With these settings
you can specify a signal condition
from
which
the
computer
automatically starts a measurement.
• Select the Trigger channel. This
•
•
•
channel will be checked for the
Figure 53. The Triggering tab of time-based measurement.
trigger
conditions.
Coach
automatically selects the lowest channel to which a sensor icon is connected.
Enter the Trigger level. When the signal passes this level the measurement is triggered.
The sensor range is displayed behind the field.
Select the Direction in which the signal should pass the trigger level to trigger the
measurement. Choices are Up (passing the level from smaller values to larger values);
Down (passing the level from larger values to smaller values) or Both (both directions
will trigger the measurement). The trigger conditions are indicated by a solid up or down
arrow displayed on the diagram axis of the trigger channel. In case the direction is both,
a double-pointed arrow will be displayed at the trigger level with the middle of the
arrow at the indicated level.
Specify Pre-trigger time. This is the time interval for which data is shown prior to the
trigger moment. The range is displayed behind the field.
Notes:
- When using the CBL/CBL2 datalogger with short measurement times (< 1 s) it is strongly
recommended to use trigger settings. Otherwise the datalogger reduces its measurement
frequency by half to monitor whether its Start button is pressed.
- For the CBL, CBL 2, CBR and LabPro dataloggers in on-line measurement mode, the
Trigger settings are not available.
67
3. If you want to repeat your
measurement click the Advanced tab
and mark the Repeat option. This tab
is not available for off-line
measurements.
• Select Total number of runs and
enter how many times the
measurement should be repeated
or select Continuously if the
measurement will be continued
Figure 54. The Advanced tab of time-based measurement.
until the red Stop button will be
used.
• Select the Delay option if you want to specify a delay time between the repeat cycles.
After each measurement run, Coach waits the delay time before starting a new
measurement run. With this setting it is possible to measure 10 minutes each hour (delay
= 50 minutes).
Notes:
-
The maximum number of points in Coach 6 is 500,000.
-
When a repeat is used, the resulting dataset is not entirely equidistant in time as it is
computer dependent how long it takes to process the resending of the measurement settings
to the interface.
Examples of time-based measurements
- Measure 100 values during 10 seconds (i.e. a sample frequency of 10 Hz) from a temperature
sensor.
- Measure 1 hour with a sample frequency of 100 Hz.
- Measure 0.2 seconds with a sample frequency of 40,000Hz.
Examples when to use trigger settings
- The phenomenon you wish to measure lasts very short.
- You wish to measure someone's reaction time. Then the computer should start measuring
unbiased at for instance at a sound or light signal.
- Comparing different runs of an experiment and keeping the start conditions the same. E.g.
when measuring the motion of a pendulum with different masses: via trigger settings all runs
will start at the same point of the pendulums motion thus making comparing the influence of
the mass on the pendulum's motion more easy. Or cooling down hot water, without and with
isolation. To compare the runs genuinely, they should start at the same temperature.
- When you want to start a measurement under specific conditions (e.g. when it becomes dark)
and you are not able to be near the computer at that moment.
Examples when to use the pre-trigger time
- Some signals can not be triggered at their zero level. For instance it is useless to trigger a
sound at a sound level of zero, as every sound will trigger the measurement, or a voltmeter at
zero as the noise will trigger the measurement. In these cases use a higher trigger level.
However, if you are interested in the behavior of the signal from its zero level (which lies in
the past of the trigger moment), you can make it visible via the pre-trigger-time option.
- The falling magnet experiment also makes use of the pre-trigger time. The generated voltage
curve depends on which pole of the magnet falls first through the coil. The pre-trigger time
68
reduces the chance of a half visible graph (so you do not have to remember which pole of the
magnet has to fall first). The total measuring time should be about twice the falling time of the
magnet through the coil.
Examples of time-based measurements using converted sensors
- Measure 1 hour the number of counts in 1 minute intervals (counter, duration = 1 hour;
measurement frequency = 60 per hour).
- Measuring frequency. Use a sound sensor converted to frequency meter. Set the measurement
frequency (much) lower than the frequencies to be measured. In this way e.g. the Doppler
effect can be measured.
- Measure frequency of light sources or tuning forks (for this it is not always necessary to really
do a measurement; standby mode can be used, to read the frequencies as they usually are
constant). But with a time-based measurement it is possible to directly measure e.g. frequency
sweeps (Doppler effect), or different tones of a recorder or other musical instrument.
- The 1-bit digital conversion can be useful a. o. in time-based measurement with a program.
6.2. Event-based measurement
Event-based measurement is a method where measurements are taken each time an event (pulse)
is received on a counter input. The pulse is the independent variable, the time and other
measured quantities are the dependent variables.
Event-based measurements require an interface with a counter input. When a panel without
counter possibilities is used, it is impossible to select event-based measurements.
To specify settings for an event-based measurement
1. In the tab Method:
• Enter the Number of samples
which will be measured. This
number also determines when an
event-based measurement stops.
• Select the Event source - the
channel which delivers the pulses.
By default the lowest channel is
chosen which has a counter
connected to it. If no counter is
connected then the lowest channel
which has an analog sensor
connected is chosen.
• The Threshold option is only
active if the event source is an
analog channel; the default
Figure 55. The tab Method for event-based measurement.
threshold is 50% of the calibrated
scale. If the source is already an analog sensor as counter or a digital sensor then the
threshold and direction will be displayed in these (inactive) fields. The sensor’s unit and
range is displayed behind this field.
• If Direction=Both, then up and down flanks are taken alternatively, which, in case of a
falling drop through a light gate, would lead to two pulses per drop instead of one. The
default values depend on the type of event source. In case of:
69
an analog sensor: a default threshold is taken at half of the full scale and direction is
up.
- an analog sensor defined as a counter: the threshold and direction fields will display
the values from the use-as-a-counter sub-menu. It is no longer possible to restore the
sensor as it is the event-source channel.
- a digital sensor, the default threshold is set at the state which approximates 50% of the
state values and direction is up.
The More button reveals a pane with the following advanced options:
• When t=0 at first event is then t = 0 is assigned to the first pulse. Otherwise, time starts
running when the Start button is pressed, regardless of the detection of a pulse.
• When Stop measurement after is checked then not only the number of events, but also
the duration of the measurement serves as a stop condition. Besides, this value is also
taken as the length of the time axis. If the option is off, a default time-axis of 10 s is used.
• The Use every option is designed for the case too many pulses are generated. E.g. if the
user selects Measure only every 5th event, then only out of every five events results in a
measurement.
If you want to repeat your
measurement click the Advanced tab
and mark the Repeat option. This tab
is not available for off-line
measurements.
• Select Total number of runs and
enter how many times the
measurement should be repeated
or select Continuously if the
measurement will be continued
until the red Stop button will be Figure 56. The Advanced tab of event-based measurement.
used.
• Select the Delay option if you want to specify a delay time between the repeat cycles.
After each measurement run, Coach waits the delay time before starting a new
measurement run.
-
2.
3.
Examples of event-based measurements
- Titration: the falling droplets generate pulses, the pH is measured (light gate);
- Smart pulley: the spokes of the wheel generate pulses, the distance and/or time is measured
(light gate);
- Measurements of radioactive decay. The decay events generate pulses, the time is measured
(GM sensor);
- Measure when a rabbit visits its manger. The rabbit (which must walk through a light gate to
reach its manger) generates pulses, the time is measured (light gate);
- Physiology. Measure the heart rate per minute. The heart beat generates pulses, the time is
measured (heart-beat sensor);
- Stroboscopic light. Each light flash generates a pulse; the time is measured (light sensor).
Examples of event-based measurements using converted sensors
- Measuring time intervals of a falling ladder with equidistant holes. Use a light sensor
converted to period meter. Adjust the threshold to a suitable value and set the interval type to
70
T up or T down (depending on the threshold settings of the sensor). Set the number of points
to the number of holes in the ladder.
- Measuring the speed of a cart on a track (or a rebounding cart). Mount a rectangular piece of
cardboard on the cart. Use a light sensor converted to period meter to measure the passage
time of the cardboard. Select the desired Interval type (e.g. Low). Set the number of points, or
stop the measurement by pressing the red stop button.
- Time intervals can also be measured by a sensor converted to 1-bit digital in combination with
the ‘Time interval’ connection in a table column.
- Calculate the heart frequency by directly measuring the time interval between the heartbeats
and converting them via a reciprocal formula (1/x) to a frequency.
6.3. Manual measurement
Manual measurement includes the following type of measurements:
1) Measurement with sensors – the sensor readings are taken when the Manual Start button is
pressed.
2) Measurement with keyboard input - the values of one or more quantities are typed when the
Manual Start button is pressed.
3) Measurements with sensors and keyboard input (combination of 1 and 2) – the sensor
readings are taken and the values of one or more quantities are typed when the Manual Start
button is pressed.
4) Measurement with a counter - pulses can be counted during a certain time interval after
Manual Start button is pressed.
To specify settings for a manual measurement
1. In the tab Method:
• Enter the Number of samples
which will be measured. This
number also determines when a
manual measurement stops.
• When the First point at start
button is checked then the press
on the Manual Start button will
become the first measured point
(default=on). If unchecked, no
measurement will be taken upon
pressing the green button, but
only on pressing the Manual
measurement button.
2. The More button reveals a pane with
the following advanced options:
Figure 57. The tab Method for manual measurement.
• When a counter is used then the
With counters option should be checked. Two more options become available.
• Manual start and stop - both the start and stop of the counting interval is determined by
a press on a button. Start by the green Manual Start button and stop by red Manual Stop
button.
• Manual start, stop after a certain time interval - each time the green Manual Start
button is pressed, counting is done during the indicated time interval. Enter the time
interval and select the time unit.
71
3.
• When t=0 at first event is checked then t = 0 is assigned to the first pulse. Otherwise,
time starts running when the green button is pressed, regardless of the detection of a
pulse.
If you want to use the keyboard input
during the measurement and create
the diagram of all connected to the
panel sensors and quantities which
values are typed in during the
measurement click the Diagram tab
and check the Create a diagram of
manual data option. This will define
the keyboard inputs and create the
diagram of all connected to the panel
sensors and quantities which values
Figure 58. The tab Diagram for manual measurement.
are typed in during the measurement.
In the created Manual diagram the index is displayed along the horizontal axis and other
quantities along the vertical axis. There is only one unique Manual diagram available in the
Activity.
• Select the number of columns (quantities) for the keyboard input (maximal 4).
• Specify Quantity, Unit and number of Decimals for each column. Upon clicking OK,
the cursor changes its shape into the small diagram icon and the Manual diagram can be
placed in one of panes.
Examples of manually triggered measurements with counters:
- Investigating the relation between radiation level and distance from the radiation source:
measuring the number of counts with a GM-sensor during a fixed time interval for different
distances to the radiation source.
- Measuring the mean background radiation by measuring several series of counts during a fixed
time interval.
- Measuring half-life time.
7. Measuring
Measurement is executed according to the given measurement settings.
To execute on-line measurement (time- and event-based)
For on-line measurements, an interface has to be connected to the computer during the
measurement and data are stored directly in the computer.
• Click the green Start button or press <F9> to start the measurement process.
• In most cases, Coach automatically stores the measurement data from the connected sensors
according to the specified measurement settings. If triggering is enabled then the
measurement is started automatically when the trigger conditions are met.
• The measurement is stopped when the specified measurement time has been reached. If you
want to interrupt the measurements process, click the red Stop button or press <Esc>.
To execute manual measurement
• Click the green Start button or press <F9> to start the measurement process.
72
•
•
•
•
•
The green Manual Start button appears in the Activity toolbar. Press this button or press
<F8> to collect a single measurement.
When a keyboard input is specified then the value
of one or more quantities have to be typed in.
When a counter is used, pulses can be counted
during a certain time interval after a button press.
The measurement is stopped when the specified
Figure 59. Keyboard input for manual
number of samples was collected.
If you want to interrupt the measurements measurement.
process, click the red Stop button or press <Esc>.
To execute off-line measurement
For off-line measurements, a datalogger does not have to be connected to the computer during
the measurement. The data are stored in the datalogger and have to be transferred to Coach
afterwards. In the Activities for off-line measurements the Activity toolbar shows two extra
buttons: the Send Settings button and the Get Data button.
• Click the Send Settings button to send the experiment settings to the datalogger.
• Now you can disconnect the datalogger from the computer and perform your measurement.
When the measurement is finished reconnect the datalogger to the computer.
• Click the Get Data button to retrieve the experiment data from the datalogger.
- Once a measurement is finished, you can replay it by pressing the Replay button.
- The combination <Shift> + (<Shift>+<F9>) erases the current measurement run and starts
a new one.
- The combination <Shift> +
erases the current measurement data and loads new data from
the datalogger.
8. Synchronized measurement and video capture
In Measurement Activities it is possible to capture video during the course of a measurement. In
this way the measurement results of an experiment can be illustrated by video images in realtime. The capturing is done in a Video pane available through the yellow Video button. Before
you start capture in Coach your camera should be plugged in and turned on. If Coach does not
detect the connected camera then the option Capture is disabled. For more information about
capturing see V. Data Video, 4. Video capture.
8.1. Synchronized capture
The video capture can be synchronized with the measurement i.e., it starts automatically when
the green Start button is pressed, and stops when the measurement is finished or the Stop button
is pressed.
To execute a measurement with synchronized video capture
• Right click the Video pane and select the Capture option.
• Right click the Video-Capturing window and mark the Synchronized Capture option (on
by default). Notice that the Record button is disabled.
• If needed specify the capture settings.
- The maximal capturing time is disabled. This time depends on the selected type of
measurement and is set automatically.
73
-
For slow measurements (measurement frequency of 1 per second or lower) it is possible
to select the Frame rate follow measurement option. Then the frame rate of the
captured video will be the same as the measurement frequency.
• Click the green Start button or press <F9> to start the measurement/capture process.
• Coach measures/captures according to the specified measurement settings and capture
settings (but the capture time is neglected). If triggering is enabled then the capture starts at
the moment of clicking the Start button and the measurement starts when the trigger
conditions are met.
• To interrupt the measurement/capture process, click the red Stop button or press <Esc>.
• The measurement/capture stops when the measurement process is finished. Then the VideoCapturing window is automatically closed and the recorded file with the name Registered
video is placed in the Video pane. Depends on the video size this process may take a few
moments.
There is can be only one Registered video in an Activity. When a new video is captured then the
previously recorded video file is overwritten. The registered video is added to the list of
available activity videos.
For Registered video the blue and green markers are added to the frame bar of the Video pane.
The left Begin and the right End blue markers indicate the moments when the video starts and
ends. The green marker indicates the moment the first measurement sample is taken. Usually the
video recording starts a little bit earlier than the measurement; the green marker is placed after
the Begin marker. The position of the green marker is set automatically by Coach but it can
happen (especially for slower computers) that the green marker is not positioned correctly; there
is a time difference between its position and the moment of collecting the first measurement
sample. In such situation the position of the green marker can be corrected manually by moving
the marker to another location or by defining a time interval between the beginning of the video
and the moment of collecting the first measurement sample via the Adjust Synchronization…
option available in the Tool menu of the Video pane.
8.2. Non-synchronized capture
When the Synchronized Capture option is not marked then the measurement and capture
process are started separately.
To execute a measurement with non-synchronized video capture
• Right click the Video pane and select the Capture option.
• Right click the Video-Capturing window and deselect Synchronized Capture.
• Specify the capture settings. For slow measurements (measurement frequency of 1 per
second or lower) it is possible to select the Frame rate follow measurement option. Then
the frame rate of the captured video is the same as the measurement frequency.
• Click the Record button to start the capture and click the green Start button or press <F9>
to start the measurement. Coach measures according to the specified measurement settings
and records according to the specified capture settings.
• After video recording has been finished use the Use Recorded Video option to transfer the
captured video to the Video pane.
The Begin and the End blue markers are placed in the frame controller of the Video pane at the
frames where the measurement was started and stopped. If these moments fall out side the frame
controller range then the markers are placed at their outmost positions.
74
9. Replay a measurement
After a measurement is completed, it is possible to replay it. The replay can be done in real-time
(default), but it is also possible to speed it up or down. The Replay button becomes active after a
measurement is finished. The replay of the measurement can be synchronized with a video
located in a Video pane.
To replay a measurement
• Click the Replay button available in the Activity
toolbar.
• Set the replay speed (default real-time) or specify the
time interval in which the measurement should be
replayed.
• Click the Start button.
Figure 60. The Start replay dialog.
To replay a measurement synchronized with video
• Click the yellow Video button and select the desired video.
• Place the video in one of the panes.
• Right click the Video pane and mark the Synchronized Replay option. By default this
option is marked for measurements with synchronized video capture.
• To synchronize the measurement
with the selected videoclip click the
Adjust Synchronization option and
specify the time interval between the
beginning of the video and the
moment of the first measurement
sample is collected. Mark the after
Figure 61. The Adjust synchronization dialog.
video starts option if your video
starts the given time interval after the measurement is started or mark the before the video
starts option if the video starts the given time interval before the measurement.
When the after the video starts option is marked the green marker appears in the frame
controller and can be used for adjusting manually the moment of collecting the first
measurement sample.
• Replay the measurement as described above. During the replay the video starts at the
position of the blue Begin marker.
Note: When the Synchronized Replay option is marked then during scanning in the diagram/table (via
the Scan option) Coach shows the corresponding video frames of the Registered video.
10. Additional activity options for Measurement Activities
To open the Activity Options dialog go to the menu option Options > Activity Options… The
following additional options settings are available for Measurement Activities.
Off-line
This setting allows off-line measurement with a datalogger like CMA ULAB or TI CBL2. The
datalogger is not necessarily connected to the computer during the measurement process. This
option is active only if the current panel is able to do off-line measurements. After closing the
Activity Options dialog Send Settings and Get Data buttons are added to the Activity toolbar.
75
With a Program
This setting is used for Measurement and Control (!) Activities in which only signals from
sensors/actuators (not program variables) are stored in diagrams/tables while a program is used
to control. The program execution is determined by the measuring time but when the program
stops earlier than the given measuring time then the measurement stops with it. The sensor and
actuator signals are evaluated according to the measurement frequency. The advantage of this
setting is that the signals are evaluated independent of the program speed.
Example: A temperature control system, of which the temperature is displayed in a diagram.
Note: If Program variables should be available for display in diagrams/tables, use Control with a
Program. In that case, the control program will also determine the rate at which the
measurements are being taken.
Advanced
Specify the unit for angles used in the Activity (e.g. in formulas).
Note: Changing the angle unit when data or formulas are present in the Activity may lead to faulty
results as Coach does not convert angles to the new unit.
76
IV. Control
Table of Contents
1. INTRODUCTION.................................................................................................................................................... 78
2. ACTUATORS ........................................................................................................................................................ 78
2.1. Actuator icons............................................................................................................................................. 78
2.2. Manual control of actuators ....................................................................................................................... 79
2.3. The actuator palette.................................................................................................................................... 79
2.4. Actuator properties..................................................................................................................................... 80
3. THE PROGRAM WINDOW...................................................................................................................................... 82
4. CREATING PROGRAMS ......................................................................................................................................... 82
4.1. Creating programs via buttons................................................................................................................... 82
4.2. Creating programs via commands.............................................................................................................. 83
4.3. Advanced programming ............................................................................................................................. 83
4.4. Creating own commands ............................................................................................................................ 84
5. EDITING A PROGRAM ........................................................................................................................................... 85
6. EXECUTING A PROGRAM...................................................................................................................................... 86
6.1. On-line program execution......................................................................................................................... 86
6.2. Off-line program execution ........................................................................................................................ 87
7. ADDITIONAL ACTIVITY OPTIONS FOR CONTROL .................................................................................................. 87
77
1. Introduction
The control environment of Coach is used to use and create programs to control systems, like,
for example, an automated temperature control (thermostat) or a robot-arm.
The kernel of a control system is a control model with sensors (e.g. a temperature sensor) and
actuators (e.g. a motor, fan, or heating element) which are connected to the inputs respectively
outputs of the interface. Through the interface, Coach gets information from connected sensors
(the temperature) and controls the connected actuators by switching suitable outputs on or off.
Actuators can be controlled manually (this is often the first stage in developing an automated
control system), or automatically via a control program.
A program is a sequence of instructions in Coach Language. With a program:
- Coach can perform control tasks automatically (such a program is often called a control
program). A control program is often based on sensor values: e.g. if the temperature is too
high, switch on the fan; if the temperature is too low, switch off the fan and switch on the
heating element, etc.
- Coach can control measurements or manipulate measurement data: e.g. convert voltage
signals from a sound sensor to decibels (something which cannot be done via a calibration), or
create beeps at random to which the user must react as quickly as possible by pressing a
button.
A program can be developed in various ways (also depending on the user mode):
• with programming buttons;
• by selecting commands from the command list. This can be a pre-defined command list
(made specifically for a certain control model), called a Micro-world, or via the full Coach
Language command list with all possible commands for the used interface. In more
advanced user modes, the command list can be extended with own commands made by the
user.
• by freely typing commands from Coach Language in the Editor area.
2. Actuators
2.1. Actuator icons
An actuator icon is a small picture representing a sensor. Information
about an actuator icon is displayed in the yellow tool tip when the mouse
cursor is placed over the actuator icon. The tool tip displays the
actuator’s name, brand and the number of bits the actuator uses (i.e. a
measure for the number of different states the actuator can have).
Example: Lamp (12V) (062) (CMA) (1).
In an Activity actuator icons can be located on the actuator palette or on
panel outputs. If an actuator icon on the panel can not be moved to a
different output or to the sensor palette, it may be locked. If this is the
case, the mouse cursor stays an arrow when moved over the icon. If the
icon can be moved, the mouse cursor turns into a ‘hand’.
78
Figure 62. Actuator
icons on the actuator
palette.
To place an actuator icon on the panel
Drag the icon from the actuator palette to an output of the panel. When the actuator icon jumps
away, the actuator cannot be connected to the particular output. Make sure your real actuator is
connected to the same input of the interface as its icon is on the panel.
To replace an actuator icon on the panel
Drag an icon from the actuator palette to an output with an icon. Coach will replace the existing
actuator icon with the new one. Diagrams, tables and values are automatically adapted.
To move an actuator icon on the panel
Drag the actuator icon to another output. Diagrams, tables and values are automatically adapted.
To remove an actuator icon from the panel
Remove an actuator icon by dragging it from the panel. Coach automatically places the icon
neatly back in its palette position.
2.2. Manual control of actuators
With manual control you can turn outputs with connected actuator icons on and off via the panel
on the screen. While designing a program, this mode offers a convenient way to check the effects
of certain connections and actions.
To manually control an actuator
• Click the LED next to any output to toggle between on or off.
• If you drag the mouse away from the LED while switching the output on, the
output remains on until you click it again.
• The LED indicates the state of the output: e.g. on or off.
Note: In case of a 2-bit actuator (with 4 states) on an interface which supports 2-bit actuators (e.g.
CoachLab II/II+), the LEDs indicate up to four states of the output by means of different colors
(e.g. off, green, orange, red).
For the CoachLab II/II+ interface it is also possible to set the output power of the connected
actuator (e.g. to adjust the speed of a motor or the brightness of a bulb).
To control an actuator power
• Click arrows at the right side of the actuator icon to increase or decrease the power.
• The height of the red bar indicates the level of the output.
2.3. The actuator palette
The actuator icons can be added to the actuator palette by selecting them from Coach Libraries
or by defining new actuators. An actuator icon is available only in one actuator palette position:
if you need more icons of the same sensor, these will be stacked in the same position.
To add/remove sensor icons to the sensor palette
• Right click an empty location in the actuator palette and select Select from Library (change
between CMA Library or User Library if necessary and possible).
• Choose an actuator from the list. If desired change the Number of icons.
• Click OK. The actuator icon is placed on the actuator palette.
79
•
•
•
To increase the number of icons of the same actuator right click an actuator icon on the
actuator palette and select Add. Type the number and click OK.
To replace an actuator icon by an alternative actuator right click an actuator icon and select
Alternative Actuators… . A list opens with actuators of the same family. Select the desired
alternative actuator. Coach will replace the actuator by the alternative and automatically
adapt diagrams and tables.
To remove an actuator icon(s) from the actuator palette right click an actuator icon and
select Delete One to delete a single icon, or Delete All to delete all icons of this type (also
the icons placed on the panel will be removed, including existing data).
To define a new sensor icon
• Right click an empty location on the sensor palette and select Create New.
• Specify the sensor properties.
2.4. Actuator properties
The Actuator Properties dialog displays all information regarding an actuator icon in Coach. This
dialog does not always show all its sections (depending on the user mode).
To open the Actuator properties dialog
• Right click an actuator icon and select Edit Properties,
or
• Right click an empty position in the actuator palette and select Create New.
Name
Gives the full name of the sensor. For self-defined sensors enter a new name in the Name field,
which appears after selecting from the drop-down list Self-defined sensor.
Brand
The brand of a sensor like CMA or Self-made.
Family
The family of actuators to which the
actuator icon belongs. Actuators
from the same family are each
others alternative actuator.
Short name
When the actuator is on the actuator
palette then the short name of the
actuator is displayed on the icon.
When an actuator icon is placed on
the panel, the specified text is
displayed on the icon, while the
actuator's short name marks its
(empty) position in the palette.
Figure 63. The Actuator Properties dialog.
Kind
There are four different kinds to be selected.
General: almost all actuators belong to this category.
Black:
only for black LEGO DACTA actuators.
80
Special 1:
Special 2:
never used (reserved for future actuator types).
never used (reserved for future actuator types).
Note: The field Kind is only available if the actuator properties are accessed when all actuator icons of
this type are in the actuator palette (and none on the panel).
Icon
The picture which is used on the actuator icon.
In the Signal type section the suitable signal type for the actuator is set. This section is active
only if the actuator properties were accessed via an icon on the sensor palette and all actuator
icons of this type were located on the actuator palette. Coach supports two signal types.
Digital:
Used for most actuators. The actuator's signal consists of a few discrete states
depending on the selected number of bits. When Number of bits is set to 1 then
the actuator has 2 states, when Number of bits is set to 2, the actuator has 4
states, etc. Select the number of bits that is required to express all possible states
of the actuator icon.
Step motors:
Used for step motors. A step motor rotates a given number of steps in a given
direction. It can be set to a certain position very accurately (as the number of
steps corresponding to one turn is very high). Select the type that corresponds to
your step motor.
− 2 bits (states) - The outputs control the step motor in the following order: 01
11 10
− 2 bits (dir step) - One output controls the direction of rotation, the other the
number of steps.
− 4 bits - The outputs control the step motor in the following order: 0011 0010
0110 0100 1100 1000 1001
− 4 bits (fast) The outputs control the step motor in the following order: 0001
0010 0100 1000
Note: The number of bits of the actuator and the number of bits of the output (which differs per
interface) determine how many outputs the actuator icon occupies. However, you do not have to
worry about this as Coach does not allow connecting more actuator icons than possible.
The Display section defines the actuator icon's display.
Range:
This option allows selecting the voltage range of the actuator. This range should
correspond to the range of the real actuator.
Power slider: When the option Power slider is marked a power slider appears on the actuator
icon. The use of power sliders is only supported by CoachLab II/II+.
Note: The outputs of CoachLab II/II+ do not have any power when no actuator icon is
connected to them.
By using the Edit button the display text of each actuator state can be edited.
- Select the state.
- Press the Edit button to enter the text for the state.
Example for a motor (2 bit):
State = 0, Text = ‘Off’
State = 1, Text = ‘Left’
State = 2, Text = ‘Right’
State = 3, Text = ‘Off’ (not used)
81
3. The Program window
The Program window is the place for creating programs. Click the Program Window button
to open the Program window. Click this icon again to close the window.
The Program window can consists up to three areas:
- the Programming Buttons area, where programming buttons are located,
- the Program Editor area, where the lines of the program appear,
- the Command List area, with the list of programming commands.
In most cases only one or two areas of the Program window are available, depending on the
choices of the Author of the Activity.
Programming Buttons
Program Editor area
Command List
Figure 64. The Program window.
4. Creating programs
4.1. Creating programs via buttons
Programming buttons are buttons with pre-defined actions. The button’s action
is explained in a yellow tool tip which appears when pointing the mouse cursor
over the button. Often also the picture on the button gives an idea about its
action.
With the programming buttons a model connected to an interface can be
manually controlled. By clicking the buttons, certain actions are performed (e.g.
a motor turns the given number of steps to the right) and Coach writes a
program in the background. This program can be visible in the Program Editor
82
Figure 65. The
programming buttons.
area but it does not have to. By executing the program, via pressing the Start button, Coach
repeats the recorded actions.
To create a program via the programming buttons
• Use the programming buttons in the Program window to control the control model:
- Some buttons require only a simple mouse click, like Stop.
- Other buttons, like Turn-left, must be pressed for a while, because the computer needs
to measure also how long the button was pressed.
• When you are ready, click the green Start button and the computer will repeat your recorded
actions.
• If you are not satisfied with the result, you can erase it (even when the program itself is not
visible) by right clicking the Program window and selecting Erase Program from the menu.
4.2. Creating programs via commands
The command list contains a series of programming commands. It can
contain only a few pre-defined commands (micro-world) tuned to a particular
control model or a complete list with Coach Language commands.
Programming via commands helps to write correct programs.
To create a program via the commands
• In the Program window click a command from the command list at the
right side.
• If a new list appears the command is not yet finished:
-
•
•
Select an additional command (e.g. an output).
Figure 66. The limited
Repeat this step until the command is finished.
command list.
Click -BACK-, or press <Esc> in the command list if you want to
return to the previous step (without making a selection).
- Some lists may be used to enter several items (e.g. several outputs).
These lists have a command Ready. Click Ready when you are
finished selecting from this list.
If an number entry box appears the command needs a value:
- Type the value (e.g. a number of seconds) and press <Enter>.
- If you want to return to the previous step, first press <Esc>, and then
click -BACK-, or press <Esc> once more.
The command is placed in the program. Coach indents the commands
automatically according to general program conventions. If the
indentation is lost due to program editing, click a program line, and press
<Tab> or <Shift>+<Tab> to restore the right indentation yourself.
4.3. Advanced programming
Experienced users can program freely by choosing commands from the
complete command list of Coach Language or by typing commands directly
in the Program Editor (Senior students only).
In the last case, Coach does not guide you any longer in writing commands
correctly (according to the syntax of Coach-Language), until the program is Figure 67. The Coach
executed. Then Coach will show an error message and place the cursor at Language commands.
the point where the error is.
83
4.4. Creating own commands
Users can create their own commands and add them to the command list. These commands are
created from the commands available in the command list (including other own commands) and
are indicated with a blue color.
To create an own command
1. To create your own command and insert it at a specific position in the command list:
• Right click the command in the command list after which your own command should
appear and select Insert (after).
• In the Add new Main-menu Item dialog, select New Command.
• Type the name of the new command10.
2. To create your own command and insert it at the end of the command list:
• Right click the Program window and select Own Commands…
• In the Own Commands window click the New Command button.
• Enter a name of the new command1 and click OK.
The own-command editor opens. It has a grey
background to indicate that you are
creating/editing an own command. The
commands appear in red.
• Create your own command by selecting
commands from the list.
• When you are ready, right click in the
program area.
• Select Back to Main Program to return to
the Program window. The created own
command appears in blue.
Figure 68. The Own-Command editor.
To edit an own command
• Right click the own command in the command list and select Edit Own Command.
Or:
• Right click the Program window and select Own Commands….
• Select a command from the list and click Edit.
• Modify the commands. Use the same procedure as editing a program.
• When you are ready, right click the program area and select Back to Main Program.
To delete an own command
• Right click the own command in the command list and select Delete Own Command.
Or:
• Right click the Program window and select Own Commands….
• Select a command from the list and click Delete.
Note: It is not possible to delete an own command while it is used in the main program. First clear the
lines in where the own command appears (by selecting the line and pressing <Del>) or erase the
main program.
10
It is not allowed to use spaces and reserved words of Coach Language
84
To rename an own command
• Right click the own command in the command list and select Rename Own Command.
• Type the new name and press OK.
Or:
• Right click the Program window and select Own Commands….
• Select a command from the list and click Rename.
To print an own command
• Right click the Program window and select Own Commands…
• Select the command and click Edit.
• Again right click the Program window and select Print Own Command.
To insert an own command in the command list
An own command can appear more than once in the command list.
1) In case of an existing command:
• Right click the command list and select Insert (after).
• Check Command Exists Already and select an own command from the drop-down list.
2) In case of a new own command:
• Right click the command list and select Insert (after).
• Check New Command and enter the name.
• Create your own command by selecting commands from the list, like described above.
• When you are ready, right click in the editor of the Program window and select Back to
Main Program.
5. Editing a program
In Junior user modes, editing a program can be done only by whole lines at once. In Senior
student mode, it is also possible to type commands directly in the Program editor.
To insert an empty line
• Click the line above which you need an empty line and press <Ins>. An empty line will be
inserted. You can select a new command.
To replace a line
• Click the line and press <Enter>. The command on the line is removed.
• Select a new command.
To delete a selection
• Make a selection (in some user modes whole lines only) and press <Del>.
To move a selection of program lines
• Make a selection (in some user modes whole lines only).
• Right click the selection and select Text Edit > Cut (or press <Ctrl>+<X>).
• Right click the line above which you want to paste the cut lines and select Text Edit > Paste
(or press <Ctrl>+<V>).
85
To copy a selection of program lines
• Make a selection (in some user modes whole lines only).
• Right click the selection and select Text Edit > Copy (or press <Ctrl>+<C>).
• Right click the line above which you want to paste the copied lines and select Text Edit >
Paste (or press <Ctrl>+<V>).
To copy the whole program to the clipboard
• Right click the program and select Clipboard Copy.
• Use the Paste command in another Windows application (e.g. a word processor) to paste the
text of the program.
To erase the whole program
• Right click the program and select Erase Main Program.
Notes:
-
Press <Tab> or <Shift>+<Tab> to restore the right indentation of the program commands.
-
With <Ctrl>+<Z> (or Text Edit > Undo) you can undo (and redo) the last change.
-
With <Ctrl>+<A> you select the whole Program.
To import a program from another Coach Activity/Result
• Right click in the editor area of the Program window and select Import program….
Or:
• Click File > Import Program … and select an Activity or Result and click OK.
Note: The current program and its Command list are overwritten by the new one. So save your work
before importing a program in this way, or your work will be lost.
To print a program
• Right click the editor area of the Program window.
• Select Print Main Program.
6. Executing a program
When a program exists, you can execute it on-line with an interface connected to the computer
(e.g. CMA CoachLab II or LEGO Dacta Interface B). For an interface such as LEGO Dacta
RCX, which has its own memory and processor, it is possible to download a program into the
interface memory and execute it when the interface is not connected to the computer.
6.1. On-line program execution
During on-line program execution the computer carries out all instructions in the program. This
can be done slow in the Monitor mode or fast.
To execute a program in the Monitor mode
• Mark the Monitor option in the Tool menu of the Program window (default this option is
on).
• Click the green Start button to start program execution. The Monitor window opens. In this
window the execution of programs can be followed line-by-line.
• Adjust the execution speed with the slider (this can be done also during execution).
86
•
•
•
With the 1-button in the Monitor bar
you can execute a single line of the
program window to carefully monitor
what the commands of the program
are doing.
Click the green Start button in the
Monitor bar to start line-by-line
program execution.
Click the red Stop button in the
Activity toolbar or keep <Esc>
pressed
to
interrupt
program
execution.
Figure 69. Executing a program in the Monitor mode.
To execute a program fast
• Turn the option Monitor off.
• Click the green Start button to start program execution.
• The program is executed in the background and the Program window is not visible. This is a
lot faster than execution in the Monitor.
• Click the red Stop button or keep <Esc> pressed to interrupt program execution.
6.2. Off-line program execution
In the Activities for off-line control the Activity toolbar shows two extra buttons: the Send
Settings button and the Get Data button.
To download program to an interface
• Create a program in a Coach Activity.
• Click the Send Settings button to download the program and the experiment settings (for
measurements off-line with program) into an interface.
• After downloading is finished, the interface is ready to be taken to another place to execute
the program.
To upload the measurement data to Coach
• Re-establish the connection between the interface and Coach.
• Click the Get Data button to upload the measurement result.
7. Additional activity options for Control
To open the Activity Options dialog go to the menu option Options > Activity Options… The
following additional options settings are available for Control Activities.
Off-line
This setting allows downloading programs and uploading the measurement results into an
interface like LEGO Dacta RCX. This option is active only if the current panel is able to do offline control.
After closing the Activity Options dialog the Send Settings and Get Data buttons are added to
the buttons of the Activity toolbar.
87
Without a Program
This setting is used for Activities in which actuators are controlled manually. Neither the
Program button nor the Start button is available in this Activity type.
With a Program
This setting is used when the control program has to determine the way measurements are being
taken and when a program is used to do calculations on measured signals. All program variables
appear in the data-range connection automatically and can be chosen in diagrams and tables.
However, the values are stored in memory (and appear in the diagrams/tables) only when the
standard Coach Language procedure SaveData is used in the program. The disadvantage of this
setting is that the sensitivity to signal changes depends strongly on the execution speed of the
program.
Note: If you need to store sensor and actuators signals in diagrams or tables use the settings
Measurement with Program.
Advanced
Specify the unit for angles used in the Activity (e.g. in formulas).
Note: Changing the angle unit when data or formulas are present in the Activity may lead to faulty
results as Coach does not convert angles to the new unit.
88
V. Data Video
Table of Contents
1. INTRODUCTION..................................................................................................................................................... 90
2. DATA-VIDEO WINDOW ......................................................................................................................................... 91
2.1. Controlling a video...................................................................................................................................... 91
2.2. Tool menu .................................................................................................................................................... 92
3. OPENING A VIDEO/IMAGE ..................................................................................................................................... 92
3.1. Opening or closing a videoclip.................................................................................................................... 92
3.2. Opening or closing an image....................................................................................................................... 92
4. CAPTURE VIDEO ................................................................................................................................................... 93
4.1. Before you start capturing........................................................................................................................... 93
4.2. Capturing..................................................................................................................................................... 93
5. EDITING VIDEO ..................................................................................................................................................... 96
5.1. Removing the begin/end part of a videoclip ................................................................................................ 96
5.2. Adjusting video ............................................................................................................................................ 96
5.3. Annotating a video....................................................................................................................................... 97
5.4. Perspective correction................................................................................................................................. 97
6. EXPORTING A VIDEO/IMAGE FILE.......................................................................................................................... 99
7. PREPARING A VIDEO/IMAGE FOR MEASUREMENT................................................................................................ 101
7.1. Scaling video/image................................................................................................................................... 101
7.2. Defining video points................................................................................................................................. 104
7.3. Selecting frames......................................................................................................................................... 104
8. DATA VIDEO MEASUREMENT............................................................................................................................. 105
8.1. Video measurement ................................................................................................................................... 105
8.2. Image measurement................................................................................................................................... 108
8.3. Replaying a video measurement ................................................................................................................ 109
8.4. Scanning .................................................................................................................................................... 109
8.5. Editing video points ................................................................................................................................... 109
9. DIAGRAMS AND TABLES ..................................................................................................................................... 111
10. ADDITIONAL SETTINGS ..................................................................................................................................... 112
89
1. Introduction
Coach 6 Data Video makes possible to analyze motion of real objects and events which happen
outside the classroom. The events can be rather ordinary, every day events such as bicycle rides,
soccer kicks, basketball shots, amusement-park rides, or more unusual like car crashes or jumps
on the Moon.
The video measurements in Coach can be performed on digital videoclips (format: AVI, MOV or
MPG), or on single images (format: BMP, GIF or JPG).
During the video measurements position and time data are collected in the selected video frames
manually by clicking or automatically by tracking a moving object e.g. a ball, a head. The video
points collected this way can serve to calculate the locations of other points e.g. the center of
mass.
During measurements on a single image, position data, or position and time data for stroboscopic
images, are collected by clicking points of interest in an image.
The video/image data can be displayed in a diagram or table and can be used for further analysis
and processing.
Digital videoclips for use in Data Video can be found on the Internet or you can make your own
clips. Coach provides possibilities for capturing and editing videoclips from digital sources, such
as web cams. Editing options include:
- adjust brightness and contrast
- rotate and flip
- place text annotations
- perform perspective correction.
Edited video files can be exported as video files in AVI format11; edited images can be exported
in different formats (BMP, GIF or JPG).
Useful video sites with video collections:
1. Rochester Institute of Technology, Dept. of Physics, Live Photo project
http://livephoto.rit.edu
2. Making Movies for Video-Based Motion Analysis by Patrick J. Cooney:
http://muweb.millersville.edu/~pjcooney/making-movies/
3. VideoPoint Resource Library: http://www.lsw.com/videopoint/vprl/
4. Site of Physics Education Department of the University of Munich: http://www.physik.unimuenchen.de/didaktik/Computer/DAVID/video.htm
5. Physics Site of North Carolina School of Science and Mathematics:
http://courses.ncssm.edu/physics/video.htm
6. Site of Physics Department of New Hampshire Community Technical College:
http://webphysics.nhctc.edu/vidshell/vidshell.html.
7. World in Motion Site: http://members.aol.com/raacc/wim.html
11
Different video and audio compressors are available.
90
2. Data-Video window
The Data-Video window is the place for video measurements. Click the Data Video Window
button to open the Data-Video window, click this button again to close the window. The DataVideo window consists of the videoclip/image and the video control bar.
By using the option Show > Auto Fit the video screen can be maximized in the Data-Video
window. By using the Maximize button of the Data-Video window the video screen can be
maximized for more accurate measurements or better display to an audience.
2.1. Controlling a video
The video control bar is located at the bottom of the Data-Video window and is displayed only
when a videoclip is opened.
This video control bar consists of the control buttons and the frame controller. The frame
controller, which looks like a railroad of which the ties (small vertical bars) are the video frames,
by default shows all frames. Selected frames are black and non-selected frames gray. Every
frame has a number, which is shown, at the right side of the frame controller. The magnifying
glass serves to zoom in the frames in the frame controller in case the videoclip has many frames.
For playback of the videoclip the following control buttons are available:
Start to play a videoclip.
Stop to play a videoclip.
Go to the first frame of a videoclip.
Go to the previous frame of a videoclip.
Go to the next frame of a videoclip.
Go to the last frame of a videoclip.
The Slider button on the frame controller indicates the current frame.
The Zoom button can be used to zoom in/out the selected part of the frame controller.
You can jump to an arbitrary position in the videoclip by clicking a frame on the frame controller
or by dragging the slider button. The selected video frame appears in the video screen and the
frame number is shown at the right side of the frame controller. You can use the cursor keys to
step through the selected frames and <Ctrl>+<cursor keys> to step through all frames.
To select a sequence of frames
• Click the first frame which should be selected,
• while keeping the <Shift> pressed use the cursor keys to make a selection, or
• while keeping the <Shift> pressed click the last frame of the selection.
The frame selection can be zoomed in by using the Zoom button.
Useful shortcut keys
<Ins> – selects the current frame or a selection of frames for measurement;
<Del> – de-selects the current frame or a selection of frames;
91
<Backspace> - removes only data associated with the selected frame or a selection of frames.
Note: On slower computers “large” videoclips may play slower than in real time. On faster computers
videos should play correctly provided no perspective correction is used.
2.2. Tool menu
The Data-Video Tool menu is available after clicking the Tool menu
button in the Data-Video window (only when the Data-Video window is
docked) or by right clicking the Data-Video window.
The Tool menu for image measurements has less menu options than the
menu available for the video measurement.
3. Opening a video/image
3.1. Opening or closing a videoclip
A videoclip for measurement should be opened in the Data-Video window.
Coach supports the following digital video formats:
- ∗.AVI – Abbreviation for Audio Video Interleaved, the most common
digital format for Windows.
- ∗.MOV – QuickTime format, standard for Macintosh computers but can
be played on Windows computers. 12
- ∗.MPEG – Abbreviation for Motion Pictures Expert Group, standard
for compression of moving images.
To open/close a video
• Select the Tool menu option Open > Video… and select a title from the list.
• If the list is empty or if the desired videoclip is not in the list, add a videoclip to the list by
clicking one of the buttons Add video or Add images.
− Via Add video a video file (AVI, MOV, MPEG) can be selected. It will be added to the
list of videos available in the Activity.
− Via Add images a sequence of images (BMP, GIF, JPG) can be selected. It will be added
as a videoclip to the list of videoclips available in the Activity. Coach converts the
selected sequence of images to a videoclip (AVI format) based on the given frame rate
and the selected Video Compressor (see 6. Exporting video/image file).
• Click OK.
• The first video frame appears in the Data-Video window. Notice that all frames in the frame
controller are selected by default (i.e. all frames are black).
• To close the video select the Close option.
3.2. Opening or closing an image
An image for measurement can be opened in the Data-Video window. Coach supports the
following image formats:
- ∗.BMP– Windows or OS/2 bitmap
- ∗.GIF – Graphic Interchange Format, a format which is widely used on Internet
12
The MOV files can not be used under Windows 98. To be able to play the MOV files in Coach the
Quick Time player should be installed on the computer
92
-
∗.JPG – Abbreviation for Joint Photographic Experts Group. The standard format for
compression of images. JPGs are 16-bit color images of reasonable small size.
To open/close an image
• Select the Tool menu option Open > Single Image…
• Select an image from the list.
• If the list is empty or if the desired image is not in the list, add an image to the list by
clicking the Add button.
• Click OK.
• The image appears in the Data-Video window. Notice that there is no frame controller.
• To close the image select the Close option.
4. Capture video
4.1. Before you start capturing
Video capture is one of the most system-intensive tasks you can demand of a personal computer.
Good results depend on the performance and capacity of all components of your system that
have to transport frames from a video-capture device to the processor and hard disk. Frames will
be dropped from the captured clip if one of these components cannot handle the workload.
Make sure your system is optimized by reviewing and following the guidelines set by the
manufacturers of your video-capture device and hard drive.
Hardware
To capture your own video materials you need:
1. an analog video camera to shoot the videos and a video-capture card to digitize it, or
2. a video-capture card to capture clips from popular movies or other sources (e.g. video tapes),
or
3. a digital camera (a digital video camera, a digital photo camera or a web cam).
In the first two cases you have analog video materials which must be converted to digital video
before it can be used in Coach. A video capture card enables you to digitize a video signal from
any standard analog source and save it to a digital video format.
Digital cameras (the third case) allow to record digital video material. You can use such cameras
and capture your own videos directly in Coach.
Testing your capture device
Use the software and the instructions that came with the camera to make sure the connection is
working and you can preview and capture video using the software that came with your camera.
If that software does not work, capturing in Coach will not work, either.
Before you start capture in Coach your camera should be plugged in and turned on. When Coach
does not “see” the connected camera then the Capture option is not available (remains gray).
4.2. Capturing
Coach enables users to capture video from digital sources connected to the PC. The captured
video will be converted to AVI format.
93
Video capture is possible both in the Data-Video window and in the Video pane but not in both
windows at the same time.
To open the Capturing window
in the Data-Video window:
• Select the option Capture in the Tool
menu of the Data-Video window,
Or:
• Select the option Open > Video… in the
Tool menu and select a video capture
device from the video list.
in the Video pane:
• Select the option Capture in the Tool
menu of the Video pane,
Or:
• Click the yellow Display video icon and
select a video capture device from the
video list.
The Capturing window includes:
• a video preview area, which displays
the currently recording video, and
• control buttons for recording video.
Preview area
Record button
Stop button
Figure 70. The Capturing window.
The Capturing window has its own Tool menu which allows to:
- close the Capturing window;
- display capture information;
- specify capture settings;
- switch between live image of a camera and playback of a recorded file.
After a video has been recorded it can be played back by using the Show
> Playback option.
Capture settings
To configure the way Coach will capture, use the Capture Settings
option for the most used settings and the Advanced Settings for all
advanced settings.
To define capture settings
• Right click the Capturing window and
select the option Capture Settings.
• The Capture Settings dialog opens.
• Define the following settings:
Max. time
This option specifies the maximal time of
Figure 71. The Capture Settings dialog.
94
capturing. The capture will stop when the time has elapsed. Alternatively, you can click the Stop
button or use <ESC> key to terminate capture before that time expires.
Resolution
This option specifies the height and width of the videoclip, in pixels. A larger frame size lets you
see more detail but requires (far) more processing. The lowest frame size that is acceptable in
most situations is 240x180 pixels (for Coach the best size is 320x240 pixels).
Frame rate
This option allows setting the frame rate of the captured video.
Preview during capture
By checking this option you can turn on/off the preview area which shows the live image of the
recorded video.
Advanced settings
Via the button Advanced Settings
more advanced video capture
settings can be done like selecting
the used Video codec13 and the
Color depth14 and setting the Audio
settings (Audio source, Audio
modes and Audio codec).15
You can also configure your camera
settings by double-clicking camera
drivers available under Driver
Figure 72. The Advanced Settings dialog.
settings. Note that these settings may
differ depending on what camera you are using (see your camera documentation for detailed
information about the camera settings.)
Recording a video
Use the Record button to start recording a video. The capture will stop automatically when the
maximal time has elapsed. Alternatively, you can click the Stop button or press the <Esc>-key
to terminate capturing before the time expires.
By checking the Capture information option information
about the recorded videoclip will be shown.
You can view the recorded video by using the option Show >
Playback.
The recorded video file is a temporary file (with default name
rec####.avi), and is replaced by a new file each time a new
recoding is started. To use the recorded video in Coach select
the option Use Recorded Video. The recorded video will be
transferred to the Data-Video window/Video pane and is added to the list of videos available in
the Activity/Result. The recorded video is embedded in the saved Activity/Result file.
13
Compressor/Decompressor
The color depth is the number of colors each pixel of the video screen can have. This is measured in bits. So an 8bit color depth offers 256 colors, a 24-bit color depth offers 16.7 million colors. Higher bit depths create larger
files, as each pixel uses more bits to store color information.
15
Coach displays the list of Video and Audio Codecs installed on your computer.
14
95
Exporting the recorded videoclip
The recorded videoclip can be saved as a separate video file on disk or a removable media with
the option Export video. The results of your edits (see next chapter) will be saved into the
exported video. (See also 6. Exporting a video/image file).
5. Editing video
5.1. Removing the begin/end part of
a videoclip
To remove several frames from the
beginning and/or end of a movie the blue
triangle markers must be used.
• Slide the left Begin and the right End
blue markers, located on the frame
controller, to the desired begin and
end of the videoclip. All frames
outside the blue triangles will be
automatically deselected and cannot
be selected any longer.
• The edited video can be previewed by
clicking the Play button.
Figure 73. The blue markers indicate the begin and end of
the videoclip.
5.2. Adjusting video
To adjust a videoclip/image use the Tool menu option Adjust… option. In the Adjust dialog you
can:
• change the video brightness,
• change the video contrast,
• rotate the video,
• flip the video horizontally and
vertically,
• deinterlace the video.
The Rotation slider has three kinds
of adjustments:
1. Raw - drag the thumb of the
Figure 74. The Adjust dialog.
slider to rotate the image as
needed. This can be done quickly but not very precisely.
2. Fine - click on the slider outside the thumb but not on the arrow buttons. This will advance
the slider by 1 degree. Hold down the mouse to achieve continuous rotation by 1 degree.
3. Very fine - click on the arrows at the ends of the slider. This will advance the slider by 0.1
degree.
Videos recorded by digital cameras and showed on a computer screen may look blurred or
stripped especially in scenes where there's horizontal movement. This is because such cameras
record with doubled frame rate pictures with half the height of the screen e.g. in a video of 25
frames per second 50 pictures per second are recorded. Then internally every 2 consecutive
96
pictures, one with odd lines and one with even lines, are mixed into one frame. This mixing is
called interlacing. In other words: a single video frame consists of two captures of two different
moments in time.
By checking the Deinterlace option the quality of the recorded video can be improved by
combining the two interlaced pictures into one single frame. The method used in Coach is based
on the motion estimation algorithm taken from MPEG techniques. It attempts to find the moved
objects and restore the frames without losing any original information.
All the video adjustments are applied in real-time on the video file, without writing a new file.
These adjustments are stored in the Coach Activity. By using the Export Video option the
modified file can be saved as a separate video file.
Use the Reset button to reset all settings to original settings.
5.3. Annotating a video
To place text labels on frame(s) of a videoclip/image use the option Annotation.
To add an annotation
• Right click the Data-Video window and select the option Annotation….
• Type in the text.
• If desired click the Font button to change the font and its color.
• Check Framed to place the annotation in a frame.
• Check Shown on all frames to place the annotation in all video frames. When this option is
not checked the annotation appears only in the current frame.
• Click OK.
• Drag the annotation to the desired position (make sure the mouse cursor has the shape of a
hand).
• If needed, repeat this procedure to create more annotations.
• To edit or delete an annotation right click an annotation (make sure the mouse cursor has the
shape of a hand) and select Edit or Delete.
• By using the option Export Video the modified file can be saved as a video file.
5.4. Perspective correction
What is perspective correction
The left image at the right shows a
photograph of two external walls of a
building. The rectangular features of the
building, such as the windows, do not
appear as rectangles in the photograph,
the photograph shows perspective
distortion. The plane geometry has
undergone a transformation that distorts
Euclidean properties such as length,
angles and parallelism.
The right image shows the perspective
corrected front of the building, where
the plane geometry is that which would
97
be seen if the original photograph of the plane of interest had been taken with the camera frontoparallel to the wall.
Rectification of planes in digital images is part of the discipline that is known as computer
vision. Projective geometry lays the mathematical foundation under this discipline. For example,
the map between the world plane and the perspective image is a plane projective transformation
(2D homography). Correcting perspective distortion is a matter of determining the eight degrees
of freedom of the homography. The rectifying homography is computed from scene geometric
information, specifically parallelism, angles between lines, and ratios of length along lines in
different direction. A full description of the mathematics of image rectification of planes can be
found in many textbooks on computer vision.
Perspective correction in Coach
Image rectification of planes is useful before collecting data in digital images and videoclips
where an object moves in a (imaginary) plane.
The perspective distortion of a plane can be corrected in Coach by using the option Perspective
Correction.
As an example the shape of the Clifton Suspension Bridge is used. In reality, the piers of the
bridge are parallel to each other; but this is not the case in the photograph of the bridge. The
image transformation that restores this property is determined by mapping 4 points – in this case
the 2 bottom and 2 top points of the piers - with a projective transformation to the corners of a
rectangle in a new image. The plane formed by the piers and the left side of the road is rectified
to a fronto-parallel view. Then the bridge cable is almost in this plane and a more realistic
measurement can be done.
Figure 75. Applying perspective correction; left: the original image, right: the corrected image.
To perform perspective correction
• Right click the Data-Video window and check the Perspective Correction option.
• A red perspective rectangle appears on the video screen.
• Map four corners of the red perspective rectangle. Every time a corner of the perspective
rectangle is moved the video screen/image is distorted. After mapping all four points the
distorted figure is transformed into the corrected rectangle.
- To move perspective points: place the cursor over a point (the cursor changes into a
closed hand) and drag the point to a desired location.
98
- To move the perspective rectangle (translate the “view”): place the cursor inside the
perspective rectangle (the cursor changes into open hand) and drag the rectangle to a
desired location.
- To resize the rectangle: place the cursor along a side line, cursor changes into a resize
arrow, and move the line to a desired location.
- Use <Ctrl>+<Z> to undo your last step.
- Use the Reset option, to reset all changes and set the video into its original format.
By using the option Export Video the modified file can be saved as a video file.
Note: Applying perspective correction may slow down the video playing speed because the calculations
are done in real-time.
6. Exporting a video/image file
Videos and images are embedded and stored in the Coach Activity/Result. To be able to save a
video/image file as a separate file on a disk the Export Video… or the Export Image…option
should be used.
To export a video file
• Right click the Data-Video window and select Export Video….
• The Save as dialog opens.
• Type in a file name.
• Specify the video file settings.
- When the file was not edited in
Coach and the Define AVI
compression option is not
checked then the file is saved in
its original format e.g. an Mpeg
file opened and not edited in
Coach will be exported in its
original Mpeg format.
- When the file was not edited in
Coach and the Define AVI
compression option is checked
the file is saved in AVI format.
Before saving in AVI format, you
may change the video compressor
(and audio compressor if your
videoclip includes audio).
- When the file was edited in Coach
then it is not possible to save it in
its original format anymore, it is
Figure 76. Exporting a video file.
always saved in AVI format. In
such case the Define AVI compression option is checked and disabled and the Include
adjustments and/or perspective correction option is checked and enabled.
• Click on the Save button to store the video on disk or
removable media. Depending on the video file size it
may take a few minutes. The Exporting Video File
dialog indicates the writing process.
99
Note:
Notice that not all video codecs may lead to a readable and playable video file, e.g. because
some codecs have some form of DRM (digital rights management) built in. Good results can be
expected from the following codecs: Microsoft MPEG4 V2 and Microsoft MPEG4 V1.
To export an image file
• Right click the Data-Video window and select Export Image….
• The Save as dialog opens.
• Type in a File name.
• Specify the file settings.
If you save a file without adjustments then a one-to-one copy of the original file (including
its creation date) is made. Otherwise the file is saved to the desired format BMP, JPG or
GIF16.
• Click on the Save button to store an image on disk or a removable medium.
Video Compression
Most personal computers are not able to handle full-quality video and therefore such video
should be compressed. There are two ways to compress a video file: using hardware codecs or
software codecs. Codecs (Compressor/Decompressors) compress videos to manageable sizes. Of
course, the goal is to compress the data with as little quality loss as possible.
• Hardware Codecs need special additional hardware to be recorded/played back.
• Software Codecs can be played back without special hardware.
If you are using a video-capture card, use the codec included with the card. You have to export
your videoclips with a software codec if you want to play back the captured video without
special hardware.
There are hundreds of audio and video codecs in use today, a few widely-used codecs are listed
below:
16
Codec
Notes
Cinepak
A very early losless codec developed by Radius Inc. Its greatest
strength is its extremely low CPU requirements. Slow compression
speed.
DivX
Compress video to a convenient size without losing any noticeable
quality and play the video on almost all devices.
Intel Indeo 3.2
Originally developed by Intel and similar to Cinepak, but it gives a
little higher image quality and is faster.
Indeo Video
Interactive 4.5
This is a very high-quality codec, it provides excellent image quality,
but requires a high-end Pentium for playback. The conversion speed is
slow. It is free distributable for DirectShow/AVI included in
QuickTime for Windows 3.
Microsoft H.261
A standard video-conferencing code and is optimized for low data rates
and low motion. It works best on videos in which there is little change
between frames. Does not give as good quality as H.263 and is CPU
intensive.
Notice that GIF format stores only 256 colors
100
Microsoft H.263
This codec is an advancement of the H.261. Similar features to H.261
but gives better image quality. Is built into QuickTime 3.
Microsoft
MPEG-4 V2
Gives very good quality and the file sizes are usually quite small.
Compatible with most machines running Windows 2000 and XP.
Default codec of Coach.
MJPEG
Stands for Motion JPEG. It is a lossy codec and gives good
compression, high quality image but middle file-sizes. It requires
significant CPU power. Large image and/or high frame rate videos
usually do not play smoothly. This codec is built in QuickTime 2.5.
WMV
Windows Media Video codec - Microsoft’s family of video codec
included in Windows Media Players.
DV Video
The standard DV (Digital Video) compression which offers high
quality images.
7. Preparing a video/image for measurement
7.1. Scaling video/image
Before you start the video/image analysis you need to calibrate the new video/image. You have
to define the scale, time calibration and co-ordinate system.
Scale
The Change Scale… option is used to specify which distance on the video/image corresponds to
which known real distance.
To scale a video
• Via the Tool menu select the Change Scale…
option.
The Scale Settings dialog appears on the screen
and the scale-ruler (red by default) and the origin
(yellow by default) appear on the video image. If
different scales in the horizontal and vertical
direction were chosen then two scale-rulers, a
horizontal ruler and a vertical ruler, appear.
• Drag the end points of each scale-ruler to match a
known distance on the video screen.
Often in videos created for measurement purposes
Figure 77. The Scale Settings dialog.
a known length can be found in one of the first
video frames.
• In the dialog box, type in the corresponding “real” length(s) of the ruler(s) (default 1 m).
• If desired, move the co-ordinate system by dragging its origin (yellow circle). You can also
rotate the co-ordinate system by dragging the yellow dot next to the origin.
• Click OK when you are ready.
101
In the majority of videos you can
use the default setting Same scale
in all directions. In this case the
same scale is assumed in all
directions. Select Different scale in
horizontal and vertical direction
if the scale is different in two
directions. (This setting applies e.g.
to compensate for perspective).
- You can change the co-ordinate
settings and scale settings at any
time, even after the measurement
is finished. In this case diagrams
and tables are updated
simultaneously.
Time calibration
Figure 78. Scaling a video.
The Time Calibration… option is
used to specify how fast the video was taken or to specify a stroboscopic frequency for
stroboscopic images.
To set the time calibration for video
• Via the Tool menu select the option Time Calibration….
• Usually the video frame rate (the number of frames per second) is included in the videoclip
and you can rely on the default value specified in the box. If this information is lacking or
appears to be incorrect, specify the video-recording speed. There are three ways to do it:
- by specifying frame rate – number of frames per unit;
- by specifying time between frames;
- by specifying absolute time – time associated with every frame (for example 0.03; 0.06;
0.09; 0.15; 0.20; 0.22; 0.24, 0.28, 0.31; 0.35 or when the time intervals between frames
are equal 01-10$0.0333 ).
Figure 79. The Time Calibration dialog.
•
Specify a zero point setting for time. Select one of the methods:
- use time from video;
- t = 0 at frame ? - enter a valid frame number for n;
- t = 0 at first selected frame;
102
•
- t = ? at first frame - enter time associated with the first frame; select a time unit from the
drop-down list.
Click OK to confirm.
To set the time calibration for a stroboscopic image
The Time calibration option offered for a single image is limited only to a calibration for a
stroboscopic image.
• Open a single image if needed.
• Via the Tool menu select the option Time Calibration….
• Check the Stroboscopic image option.
• Type in a stroboscopic frequency or stroboscopic time interval.
Figure 80. Time calibration for a stroboscopic image.
Co-ordinate system
The option Co-ordinate System… is used to specify settings of the co-ordinate system.
To specify features of the co-ordinate system
• Via the Tool menu select the option Co-ordinate System….
• Define origin of the co-ordinate system:
- select Same at all frames if the camera did not move during the recording of the
videoclip (i.e. a fixed co-ordinate system is assumed), or
- select First point clicked at each frame if the
camera moved during the recording of
videoclip or if you want to measure according
to a moving center of mass (moving coordinate system). In this case, the first point
clicked on each frame defines the origin of the
co-ordinate system. This option is not
available for a single image.
• Define x-axis direction. Select From left to right
if the horizontal axis direction is from left to
right, or select From right to left if the horizontal
axis direction is from right to left.
Figure 81. The Co-ordinate System dialog.
• Define y-axis direction. Select From bottom to
top if the vertical axis direction is from bottom to top, or select From top to bottom if the
vertical axis direction is from top to bottom.
• Specify the colors of the co-ordinate system, the ruler(s) and the protractor.
• Click OK to confirm.
103
7.2. Defining video points
Points for video
Video points are points collected on each selected video frame during the video measurement. It
is possible to collect up to 8 video points.
From a set of measured video points another point can be calculated for example the center-ofmass location. Such calculated point can be displayed directly in the video screen during a
measurement.
To define the number of points for video
• Select the Tool menu option Video
Points….
• Enter the Number of measured
points per frame.
• If needed enter the Number of
calculated points per frame.
When the chosen number is greater
than 0 the Calculated points section
appears in the window. Select
formulas to calculate X and Y coordinates of calculated point(s).
By default the Data range connections
Figure 82. Defining video points for the video measurement.
are Empty. Formulas appear in the
drop-down lists only if these formulas have been defined in diagrams or tables before.
All co-ordinates of measured video points can be used as variables in formulas to calculate
co-ordinates of calculated points.
If there are no formulas available in the drop-down lists of the X and Y co-ordinates of
calculated points, you first have to define these in the diagram or table, then select the option
Video Points… once more and select the formulas from the drop-down lists.
• Specify Names, Markers and Colors of measured and calculated video points. Every point
has its own name, marker and color. If you do not want to display a video point in the video
screen, hide it by checking its Hidden option.
Points for image
Video points are also points collected on an image. By default this number is 50.
To define the number of points for image
• Select the Tool menu option Video Points….
• Enter the Number of measured points.
• Specify Name, Marker and Color of the active (selected)
point and the Color of inactive points.
7.3. Selecting frames
After opening a videoclip, all frames are selected for the video measurement. Usually, only a
number of selected frames is needed. The Frames option allows making a selection of frames
which will be used for measurement.
104
Selecting frames for the measurement
• Select the Tool menu option Frames….
• The total number of frames available in the videoclip is
displayed in the upper part of the Frames dialog.
• Make a frame selection. Use one of the methods:
Use All Frames - the measurement is done on all video
frames; this is the default setting.
Individual frames
• Type in the list of frames you want to select, for
example:
- 10-20: selects frames from 10 to 20
- 1,5,10: selects frames 1, 5 and 10
- 10-20$2: selects every 2nd frame between 10 and
20.
From - this option allows defining a range of frames
selected with a given step.
Figure 83. Selecting frames for measurement.
• Type in the first and the last frame number of the
frame range; type in the step size. For example From 10 to 30 step size 3 - selects every
3rd frame in the frame range between 10 and 30.
Equally divided - this selection is done automatically by Coach. The frames are equal
distributed in the given frame range.
• Type in a number of frames to select and the frame range. For example Equally divided
10 frames between 1 and 30 - selects 10 frames between 1 and 30.
Additionally to the four available methods you can select frames manually. In this case
you have to click a frame on the frame controller and select it with <Ins>-key or deselect
it with the <Del>-key. Selected frames are black while deselected frames are gray.
Zoom in on Frames
• Type in the first and last frame number of the range that should be zoomed (i.e. displayed
fully over the whole frame controller).
8. Data Video Measurement
Data Video measurement means that position and time data are collected from a videoclip/
stroboscopic image or position data from an image. In this chapter it is assumed that video/image
is already opened in Coach and prepared for the measurement.
8.1. Video measurement
Coach offers two kinds of video measurements, manual and point tracking. During the manual
measurement the data are collected by clicking on a moving object on the successive video
frames. To avoid time-consuming, monotonous manual clicking the possibility to automatically
track a moving object is given. By checking the option Point Tracking the measurement is
automatically performed by Coach based on the given tracking settings.
Note: For angle measurements do not forget to set in the Activity Options proper angle units, degrees or
radians.
105
Manual measurement
• Start the measurement by clicking the
green Start button.
• Coach will automatically bring the
first selected video frame on the
screen.
• Move the cursor over the video screen
(the cursor changes its shape to a
viewfinder) to locate the video point,
for example a ball or the head of a
runner.
• Click to store the first video point.
Depending on the settings, three
things can happen:
1. If the videoclip advances to the
next frame, click the next point of
the object. (In this case you only Figure 84. In manual video measurement, a viewfinder
measure the position of one object mouse cursor is used to locate the moving object.
per frame).
2. If the first video point was set up to be the origin of the measurements for this frame, then
a co-ordinate system appears with its origin at the clicked point. Next click the video
point(s) to determine the position(s) of another object(s).
3. If nothing happens you have to click another video point. Repeat this step until the
videoclip advances to the next frame. In this case you measure more than one video point
per frame.
• If a diagram or table is available, the data will be displayed automatically.
• Repeat the procedure for each frame until you reach the last selected frame of the videoclip
or press the Stop button to interrupt the measurement.
• Once you have collected data from the video you can still update, delete or add points after
the measurement has been finished.
Point tracking
• Right click the Data-Video window and check the option Point Tracking.
• Coach automatically brings the first selected video frame on the screen. This frame is called
the tracking frame because it is the only frame on which the tracking area (a viewfinder
)
and search area (a rectangle of user-specified dimensions) are displayed.
This frame is red-colored to distinguish it in the frame controller.
The option Go to Tracking Frame in the Tool menu can also be used to jump directly to
the tracking frame.
• If needed specify the tracking settings (see description on the next page).
• Drag the tracking area – viewfinder over the moving object you want to measure, e.g. a
marker or an eye-catching point such as a white ball. If there are more points to be measured
per frame (or a moving co-ordinate system) then there are separate tracking areas for every
video point. It is important that this object stands out against the background of the video for
all frames you want to measure.
• Start the measurement by clicking the green Start button.
• The measurement is performed automatically through the selected frames according to the
given settings.
106
•
•
•
If a diagram or table is available, the data will be displayed automatically.
After the measurement is finished the tracking areas are displayed on all measured frames.
Turn point tracking off by deselecting the option Point Tracking.
Once you have collected data from the video you can still update, delete or add points after
the measurement has been finished.
Figure 85. Left: The tracking frame with the tracking area. Right: After the measurement is finished the tracking
area is displayed.
When point tracking fails, you can repeat your measurement only in a selection of frames where
tracking was not correct. First select the frames on which the tracking failed and remove data
associated with these frames by using the <Backspace>-key.
Now the first selected frame without associated data is chosen by Coach as the new tracking
frame. Relocate the tracking area or even change its settings and/or the dimensions of the search
area. Start the measurement again to continue point tracking from this frame on using the new
settings and measure all selected frames without data. It is also possible to measure the
remaining frames manually.
Tracking settings
The Tracking Settings… option is available in the Tool menu when point tracking mode is on.
Search area
Define the search area by specifying its Height, Width and Color. The default area is 64 x 64
pixels. You should limit the search area in order to reduce computing time or to avoid ambiguity.
Tracking area
Define a tracking area for each video
point by specifying its Name, Radius and
Color. The tracking area is bounded by a
circle with a given radius (default 5
pixels).
When point tracking is turned on, the
search and tracking areas are displayed by
default on the first selected frame which
Figure 86. The Point Tracking Settings dialog.
has no data associated with it. They are
always associated with the first selected frame and are not displayed on other frames.
107
Advantages and disadvantages of point tracking
Point tracking has a lot of advantages compared to manual video measurement. The main
advantages of point tracking are:
• When a manual video measurement takes more than 100 mouse clicks it becomes too much
work of monotonous and RSI-risky nature.
• Collection of data is done in much shorter time than ever could be achieved by manual
recording of data.
• Point tracking is an objective way of data collection. The accuracy of measurements is the
same for each frame of the videoclip.
But it does not mean the point tracking is not free of problems. Videoclips must match the
following requirements for successful point tracking:
• Tracked objects may not change much in size, shape, and color.
• Markers are preferable of circular shape (so that rotating objects can be tracked) and they
should have a color distinct from the background scene in the search area in order to
minimize errors in tracking.
Tracked points must stay within the search area as much as possible. If a tracked point
temporarily disappears within the search area and later reappears again, then there is no
guarantee that the point is always automatically found again. In this case the user must
reinitialize the point tracking and continue from the frame where the point reappears in the
videoclip or start over again with a larger search area.
8.2. Image measurement
• Start the measurement by clicking the green Start button.
• Move the cursor (it changes its shape to a viewfinder) to locate the video point.
• Click to store the first video point.
• Repeat for other video points.
• If a diagram or table is available, the data will be displayed automatically.
• Once you have collected data from the image you can still update, delete or add points after
the measurement has been finished.
Figure 87. Measurement on a picture (left) and a stroboscopic picture (right).
108
8.3. Replaying a video measurement
One of the greatest features of Data Video is the ability to replay the video scene and at the same
time watch the graphs in the diagram evolve. Click the Replay button to replay a measurement,
this button is available after a measurement is finished.
8.4. Scanning
In Data Video Activities, diagrams and tables are synchronized with the video points. Each point
in a diagram/table has a counterpart in the Data-Video window.
To scan
• Right click the Diagram window or click its Tool menu button and click the option Scan.
• When scanning (e.g. with mouse clicks or with the cursor keys) in the diagram, Coach
shows the corresponding video points in the Data-Video window. When a table is displayed,
the exact row of the table is also selected and displayed automatically. In this mode it is also
possible to update video points in the Data-Video window.
- If a calculated video point is defined in an Activity, this point is also displayed in the
video frame during the measurement (unless the calculated point is defined to be hidden).
- If the Origin is chosen as the First point clicked at each frame (in the Co-ordinate
settings dialog), then the first point clicked in each selected frame defines the origin of
the co-ordinate system and is not displayed.
8.5. Editing video points
After the Data-Video measurement is finished, there are a number of possibilities to modify the
data set.
Editing points in videos
To edit video points
If you are not satisfied with some of your marked video points you can come back to a frame
(point for image) and move a video point to another location. To update a measured video point:
• Click the frame on the frame controller in which the measured point must be corrected.
• Drag the video point to the desired location.
• The diagrams and tables update simultaneously.
To update the co-ordinate system
• Select the Tool menu option Change scale.
• If Origin = Same at all frames
- Drag the origin to the desired new position.
• If Origin = First point clicked at each frame
- Select the frame where you want to update the chosen origin.
- Drag the origin to the desired new position.
- If necessary, repeat the procedure for the origin of other frames.
• Click OK.
109
To delete video points
• Click a frame on the frame controller in which the measured point must be deleted.
• Use:
- <Del> to deselect a frame and delete a point. The deselected frame becomes gray in the
frame controller.
- <Backspace> to delete a point only, a frame remains selected.
• The diagrams and tables update simultaneously.
Video points can only be removed via the video Tool menu.
Note: When the tracking frame is deselected then the tracking areas will be moved to the new tracking
frame (next first selected frame without data).
To add extra video points
You can also add extra data points after your measurement is finished, e.g. when the selected
frames appear to be too far apart to follow the motion sufficiently accurate.
• Click an additional frame on the frame controller and manually select this frame by using
the <Ins>-key. The selected frame becomes black.
For manual measurement:
• Click the green Start button.
• The first selected extra frame automatically appears on the screen.
• Locate a new video point.
• Repeat this for all extra selected frames.
For point tracking:
• The first selected extra frame becomes the tracking frame.
• Relocate the tracking area which appears again on this frame.
• Click the green Start button.
• The measurement is automatically performed for all added frames only.
• The diagrams and tables are updated simultaneously.
It is also possible to delete data without deselecting the frames. This feature is useful when the
point tracking should be performed only on a part of a videoclip.
• Make a selection of frames on the frame controller.
• Use the <Backspace>-key to remove the data without deselecting the frame(s).
• Corresponding table rows are not removed but made empty. Now again the measurement
will be executed on the selected frames without the data.
Editing points in images
To edit video points
If you are not satisfied with some of your marked video points you can come back to a point and
move it to another location. To update a measured video point in an image:
• Click the point which must be corrected. This point becomes the active point and its color is
changed to the color which is specified for active points.
• Drag the point to the desired location.
• The diagrams and tables update simultaneously.
110
To update the co-ordinate system
• Select the Tool menu option Change Scale.
• Drag the origin to the desired new position.
• Click OK.
To delete video points
• Click the point which must be deleted. This point becomes the active point and its color is
changed to the color which is specified for active points.
• Use the <Del>-key to delete the point. The point disappears from the video screen and its
respective table row is deleted.
• The diagrams and tables update simultaneously.
• A point can also be removed by removing the corresponding row from the table.
To add extra video points
You can also add extra data points after your measurement is finished. Adding points between
certain data points may be useful in cases where you cannot sort data points afterwards.
• Insert an empty row in a table in the following way:
- Select the row which you would like to add.
- Right click in the Table pane and select Rows > Insert.
- Fill the number of the first row and the last row to add. If the first and last row has the
same number only one row with this number will be added. The other cells shift down.
- Click OK.
• Click the green Start button.
• Locate a new video point.
• Repeat this for all extra added rows. Rows will be filled in downward direction.
• The diagrams and tables are updated simultaneously.
9. Diagrams and tables
The video points can be displayed in a diagram or a table. The diagram or table can be setup
prior to starting a video measurement or after it. The advantage of preparing the video diagram
and table before the measurement is that the data are displayed during the measurement.
Standard diagram/table for video
A standard diagram/table for video is a diagram/table of which the points are synchronized with
the video points on frames of a videoclip.
• Right click the Data-Video window or click its Tool menu button.
• Select the option Display as a Diagram or Display as a Table.
• Click in a pane to place the standard diagram/table.
For the diagram: this will plot the horizontal (Px) and vertical (Py) Cartesian co-ordinates of
the video points versus time.
For the table: the time data and the horizontal (Px) and vertical (Py) Cartesian co-ordinates of
the video points are displayed respectively in data ranges C1, C2, and C3 of the video table.
Notes:
-
If more video points are measured per frame, then the co-ordinates (Px and Py) of all video points
are displayed in the video diagram and table during the measurement process.
-
If you want to display data differently in the diagram or table, then you can edit it.
111
-
By default the Cartesian co-ordinates of video points are displayed. It is possible to display the
polar co-ordinates of the video points: Pangle and Pdistance. In this case the connection of data ranges
in the diagram/table should be changed.
-
The unit with which angles are measured on the protractor can be radians or degrees, depending
on the pre-defined settings for the Activity in the activity options.
Standard diagram/table for image
A standard diagram/table for image is a diagram/table of which the points are synchronized with
the video points on an image.
• Right click the Data-Video window or click its Tool menu button.
• Select the option Display as a Diagram or Display as a Table.
• Click in a pane to place the standard diagram/table.
For the diagram:
- For a single image this will plot the horizontal (Px) versus vertical (Py) Cartesian coordinates of the video points.
- For stroboscopic image this will plot the horizontal (Px) and vertical (Py) Cartesian coordinates of the video points versus time.
For the table:
- For a single image the horizontal (Px) and vertical (Py) Cartesian co-ordinates of video
points are displayed in data ranges C2, C3 of the video table.
- For a stroboscopic the time data is displayed in data range C1 and the horizontal (Px) and
vertical (Py) Cartesian co-ordinates of video points are displayed in data ranges C2 and
C3 of the video table.
Notes:
-
Notice that the order of clicking is important for the image measurement.
-
If you want to display data in a different way in the diagram or table, then you can edit it.
-
By default the Cartesian co-ordinates of video points are displayed. It is possible to display the
polar co-ordinates of the video points: Pangle and Pdistance. In this case the connection of the data
ranges in the diagram/table should be changed.
-
The unit with which angles are measured on the protractor can be radians or degrees, depending
on the pre-defined settings for the Activity in the activity options.
10. Additional settings
The Data-Video window offers some additional Data-Video settings.
Select the Tool menu option Show. You have possibilities to mark/unmark the following
options:
Axes: a toggle to display the scale ruler(s) and the co-ordinate system in the Data-Video
window.
Ruler: to measure distances between any two points on the video image.
• Check the option Ruler. The horizontal ruler (red by default) appears on the video image.
• Drag the ruler's end points to the positions between which you want to measure the
distance. The distance is displayed next to the ruler.
112
Protractor: to measure angles on the video image.
• Check the option Protractor. The Protractor (yellow by default) appears on the video
image.
• Drag the protractor and its end points to match an angle between two points. The measured
angle is displayed next to the protractor.
Angle units can be radians (default) or degrees, depending on the setting in the Activity Options.
Trace: to display markers for measured video points in the video screen.
Auto fit: to enlarge the video image to its maximum size within the Data-Video window.
To choose a playing speed for the video:
• Select the option Playing speed… to display the Playing-speed dialog.
• Adjust the speed of playing with the slider:
• 1000% means that the video will be played 10 times faster than the default (100%) setting.
10% means that the video will be played 10 times slower than the default (100%) setting.
113
114
VI. Modeling
Table of Contents
VI. MODELING ........................................................................................................................ 115
1. INTRODUCTION.................................................................................................................................................. 116
1.1. Modeling in Coach 6 ................................................................................................................................ 116
1.2. Didactical considerations......................................................................................................................... 116
2. THE MODEL WINDOW ........................................................................................................................................ 118
3. THE GRAPHICAL MODE ..................................................................................................................................... 118
3.1. The Tool menus......................................................................................................................................... 118
3.2. Graphical variable symbols...................................................................................................................... 119
3.3. Formula editor.......................................................................................................................................... 123
3.4. Creating a graphical model...................................................................................................................... 123
3.6. Editing a graphical model ........................................................................................................................ 124
3.7. Converting a Graphical model into Equations and Text mode ................................................................ 125
3.8. Subsystems................................................................................................................................................ 126
4. EQUATIONS MODE ............................................................................................................................................. 126
4.1. Tool menu in Equations mode .................................................................................................................. 126
4.2. Variable equations.................................................................................................................................... 127
4.3. Creating an Equations model ................................................................................................................... 128
4.4. Editing an Equations model ..................................................................................................................... 128
4.5. Formula editor.......................................................................................................................................... 129
4.6. Converting an Equations model into a Graphical model or Text model .................................................. 129
5. TEXT MODE ....................................................................................................................................................... 129
5.1. Conditional and loop statements .............................................................................................................. 130
5.2. Tool menu in Text mode Equations mode................................................................................................. 130
5.3. Creating a Text model .............................................................................................................................. 131
5.3. Editing a Text model................................................................................................................................. 131
6. MODEL EXECUTION ........................................................................................................................................... 132
7. SIMULATIONS .................................................................................................................................................... 134
8. MANAGEMENT OF MODELS................................................................................................................................ 135
9. CONSTRUCTING MODELS IN COACH LANGUAGE ............................................................................................... 135
9.1. Coach Language....................................................................................................................................... 135
9.2. Numerical methods used by Coach........................................................................................................... 135
9.3. Execution of a Coach Language program................................................................................................ 135
115
1. Introduction
1.1. Modeling in Coach 6
Coach 6 Modeling is a part of Coach 6 that can be used to create and analyze models of
biological, chemical, physical, economical, social and ecological systems. It is a tool-like
program, in the sense that it provides the user with a powerful set of possibilities, but it does not
tell the user what to do with these possibilities.
Coach offers three modes of constructing and viewing models: the Graphical, Equations and
Text modes. The graphical mode of Coach 6 is similar to the System Dynamics Modeling
software (such as Stella or PowerSim) which is based on the stock and flow approach developed
by Prof. Jay. W. Forrester at MIT in the early 1960s. System dynamics is a methodology used to
understand how systems change over time. The central concepts of this methodology are to give
an understanding of the system’s structure, the interaction between its objects and the behavior it
can produce. Many of such systems can be built as models on a computer. Such models can be of
much greater complexity and carry out more simultaneous calculations than human mental
models.
Coach’s graphical mode provides a framework and easy-to-use graphical interface for creating
system dynamics models. Models are built with graphical elements: state variables (similar to the
stock concept), flows, auxiliary variables and constants. Discrete changes of state variables can
be provoked with events. Relationships between model variables are given by connectors.
The Equations and Text modes are text-based modes, which use a textual representation of the
mathematics hidden behind models.
The model differential equations can be solved by different numerical iteration methods. Coach
provides three iteration methods: Euler, Runge-Kutta 2 and Runge-Kutta 4.
System processes are determined by the rates of change, which in turn are represented by
differential equations.
Based on the structure and mathematical definitions from a Graphical model, Coach constructs
- an Equations model which consists of a sequence of differential equations, formulas for
calculation of auxiliary variables, set of initial values and constant values, or
17
- a Text model according to the rules of Coach Language
that consists of equations from
which the model variables are calculated according to the selected iteration method.
It is also possible to create and modify models directly in Equations and Text mode. In Equations
mode, the model equations are constructed by using icons for variables. In Text mode, a model is
built by entering equations which have to be structured according to the rules of Coach
Language.
1.2. Didactical considerations
Why to use modeling?
Modeling allows the creation of models of interesting and often complex realistic phenomena
and solving realistic problems which are quite difficult to solve analytically at the school level
17
Coach Language is the programming language of Coach 6 used in Control and Modeling Activities.
116
For example motion with air resistance, damped and forced oscillations, charging and
discharging capacitors, radioactive decay, etc.
Instead of an analytical solution at once, with modeling the evolution of a system is computed
step by step. It deals with a wide range of problems: mostly differential equations and models
based on the method of finite differences.
Solving differential equations demands rather advanced mathematics. By using numerical
models mathematical difficulties can be overcome and they are conceptually easier to
understand. Building such models is often rather simple and illuminating, and may bear little
relation to the mathematical difficulty of getting a solution. For example a simple growth model
is rather transparent, while the exponential function, which is the solution, would be considered
rather difficult. Similarly, an oscillator damped by various kinds of frictional forces presents
considerably mathematical difficulties, while rising only slowly in computational difficulty.
How to use modeling?
Generally speaking, there are three possible ways of using Modeling in the classroom:
1. Open an earlier prepared model, run it and discuss with the students how it works.
2. Start with a prepared model or with parts of a model and build up a new model, after
discussion, by revising or adding to what is already there.
3. Start with nothing, and build up the desired model from scratch, during discussion with the
class.
The first way is close to using Modeling as a simulation program, with this difference that the
model is visible and can be changed. The Simulate option is very helpful in this case.
The second way is useful in helping students to see how different problems relate to each other.
The third way is useful for example in modeling a phenomenon being studied in a student
investigation. Building models up gradually, from simple to more complex, can be most
awarding as students can take part of the actual development of the theory.
Bugs and debugging
Anyone who uses computers knows that errors of various kinds, 'bugs', can be made during a
modeling process. Some of them such as misspelling a variable name (leading to confusion with
a different variable) are little more than irritating, but some errors are more fundamental and
therefore more interesting. An example might be the choice of sign. 'Friction' with the wrong
sign will produce spontaneous acceleration and absurd results. It may even be worth introducing
such errors on purpose to see their effects.
Graphs
One of the hardest aspects of using Modeling is the appropriate choice of graph scales. There are
default values used for creating graphs which are not always optimal. Working out
approximately how large a variable may be is a valuable test of understanding. For example, if
one has an oscillator showing a displacement against time and wants to show velocity against
time, the magnitude of the velocity can be estimated from the slope already on the screen.
Hypothesis testing
One of the most valuable features of Modeling is hypothesis testing in which: model results are
compared to experimental data from measurement or video measurement. By modifying the
model a little bit or by changing the value of a parameter students can test their hypothesis and
construct links between the real experiment and the theoretical model.
117
2. The Model window
The Model window is the place for creating models of dynamic systems.
to open the Model window, click this button again to close
Click the Model Window button
it. The Model window has its own toolbar with the following buttons (not all buttons are always
present):
Select a new State variable (Graphical and Equations modes)
Select a new Process variable (Graphical and Equations mode)
Select a new Flow (Graphical mode)
Select a new Auxiliary variable (Graphical and Equations modes)
Select a new Constant (Graphical and Equations modes)
Select a new Connector (Graphical mode)
Select a new Event (Graphical and Equations modes)
Select the Independent Variable Properties dialog (Graphical and Equations modes)
Selection mode (Graphical mode)
Open Create/Edit an Annotation dialog (Graphical and Equations modes)
Zoom model structure to fit the Model window (Graphical mode)
Insert a Coach Language Command (Text mode)
Open the Graphical mode (Equations and Text modes)
Open the Equations mode (Graphical and Text modes)
Open the Text mode (Graphical and Equations modes)
There are three modes of creating/viewing models: Graphical (default),
Equations and Text modes. In Graphical mode the entire window is used for
the graphical structure of the model. In the Equations and Text modes the
Model window is divided into two parts: the left pane of the Model window
is used for the model equations; the right pane of the Model window is used
to specify the initial values of variables and constants.
The Modeling Tool menu is available after clicking the Tool menu button in
the Model window (only when the Model window is docked) or by right
clicking the Model window.
3. The Graphical mode
3.1. The Tool menus
Tool menus in Graphical mode appear after right
clicking in the Model window on:
- a variable symbol - the menu (left) with options
118
for editing and displaying a variable.
- a subsystem symbol - the menu (right) with options for editing a subsystem.
3.2. Graphical variable symbols
In Graphical mode the entire Model window is used for the graphical structure of the model. The
variables of a model are represented by graphical symbols. The relations between the variables
are indicated by connectors drawn between the symbols.
Each variable has its own properties dialog which is opened by double-clicking its variable
symbol in the Model window (an exception is the Independent variable, see the description
further). In this dialog the name information (name, unit and long description), the variable
definition (initial value, condition or formula) and the display properties (color, fonts, name label
position and decimals) can be defined.
State variable
State variables are used to represent variables that
change in time.
State variables can represent countable, physical
accumulations like amount of water in a bathtub, number of
trees in a forest, a country population, or can represent the
degree of non-physical accumulations such as knowledge or
fear. A State variable is determined by an initial value and
by the ingoing and outgoing flows. The sum of inflows is by
definition equal to the sum of outflows of the state variable
(the so-called principle of flow balance).
The initial value may be specified by a formula in which the
variables of incoming connectors may be used. The default
name of a variable is State_# (where # denotes a number).
Figure 88. State variable properties.
Process
A Process variable is used to specify flows connected to it in case the principle of flow
balance does not hold. A typical application is chemical kinetics of a reaction where
the stoichiometry is such that the number of reacting species differs from the number
of products for example the reaction A + B → C. The graphical model of such reaction
resembles the chemical notation of a reaction (mechanism), including the stoichiometry. In this
application, and in particular in a single reaction step, the process icon, that is, the Erlenmeyer
flask represents a reaction, flows going toward the process originate from reactants and flows
going away from the process point at products of the chemical reaction. Process variables make
it easy to extend investigations of chemical kinetics beyond the level of studying very simple,
monomolecular reactions or simple reaction mechanisms.
A process variable is defined by a formula. In the example of chemical kinetics, it stands for the
reaction rate of a chemical reaction step, which depends on the reaction rate coefficient, the
concentrations of reactants involved in the reaction step and their stoichiometric coefficients.
The listed In and Out Coefficients are added automatically to the process variable properties
window based on the flows going in and out of the process variable.
The stoichiometric coefficients In and Out determine the exact relationship between the ingoing
and outgoing flows connected to the process variable and the formula represented by the process
variable.
The stoichiometry of an elementary chemical reaction already determines the formulas for the
119
inflows and outflows so that there is no real need to use connectors from the process toward
these flows.
The default name of a process variable is Process_# (where # denotes a number).
Figure 89. The empty Process Properties dialog and the dialog with the defined process
and in and Out coefficients.
Flow
Flow variables are used to represent activities
that lead to change of state and process
variables.
Flows can represent water coming through a tap into a
bathtub, births and deaths in a population, concentration
changes of reactants, rate of change of object position etc.
For state variables: if the arrow of the flow has a direction
into a state variable then the flow contributes positively to
the change of this variable. If the arrow is out-going then
the flow contributes negatively to the change of this
variable.
For process variables: the In and Out stoichiometric
coefficients defined for a process variable determine the
formulas for flows connected to this process variable.
The default name of flow is Flow_# (where # denotes a
number).
By default a flow name is not displayed in the Model Figure 90. Flow Properties dialog.
window. Check the Show name option to display the name.
By checking the option Use condition, the additional fields for constructing a condition are
displayed.
120
Auxiliary variable
Auxiliary variables take in information (data) and transform it for use by another variable
in the model. For example, for the population model an auxiliary variable calculates the
growth rate.
An auxiliary variable is determined by a formula or by a data column from a table. The default
name of an auxiliary variable is Aux_# (where # denotes a number).
For defining an auxiliary variable by a formula
Data from tables can be used to define an
the Formula Editor is used. By checking the
auxiliary variable by data points.
option Use condition the additional fields for
constructing a condition are added.
Before the definition of an auxiliary variable by data can take place, a table with data points
should be present in the Activity/Result. Tables in Coach can consist of the following data types:
- graph data drawn by using the Sketch option, converted to a table by the Convert Sketch to
Table option.
- data typed in by using manual input connections.
- data imported from external files like Coach Results,
Text or Spreadsheet files.
To define an auxiliary variable by data
• In the Auxiliary Variable Properties dialog select the
Data option and click the Define button.
• Select a table from the Table drop-down-list.
• Select a data column from the drop-down-list behind
Connection in the Variable section. The quantity and
unit of the linked column are automatically displayed.
• Select a data column for the independent variable from
the drop-down-list under Connection in the Independent variable section. The quantity and unit of the
linked column are automatically displayed.
121
Figure 91. Defining an auxiliary variable
by data.
•
Click OK. The information about the linked connection (Table name: Column name) is
given as the definition of the variable.
The graphical symbol of an auxiliary variable defined by a data column is enriched with an extra
symbol □.
During the model run, values of the variable from the
column are interpolated.
Constant
Constants are variables which store constant
values.
The value for a constant can be typed in or selected from a
database with predefined physical constants. A constant
selected from the database is fully defined; its Name, Unit,
Description (Quantity) and Value are copied.
It is not possible to link any variable to a constant.
The default name of a constant variable is Const_# (where #
denotes a number).
Figure 92. Constant properties dialog.
Event
Events allow changes of state variables based on conditions. They cause discrete
changes in continuously varying systems.
An event definition is built from two parts: a trigger condition and actions. A trigger
condition is defined by entering a conditional equation. A list of actions is created by
using the buttons Add and Remove. The actions can be applied only to state variables.
An Event has a default name Event_# (where # denotes a number). By default an event name is
not displayed in the Model window. Check the Show name option to display the name.
Figure 93. The empty Event Properties dialog and the dialog with the defined trigger condition and action.
122
Independent variable
The Independent variable is the variable that
determines the steps for the change of the state
variable. By default it is time t with unit s. By
default the independent variable is hidden, its graphical
symbol is not shown in the Model window.
The Independent variable properties dialog opens by:
- clicking the Independent variable button in the toolbar
when the Independent variable symbol is not visible in
the Model window, or
- double-clicking the Independent variable symbol in the
Model window.
Check the option Symbol visible in the Model window if you want to display the graphical
symbol of the Independent variable in the Model window. Then you can connect the independent
variable to other variables.
Connector
Connectors create relations between variables of a graphical model. The variable at the
end of a connector, to which a connector’s arrow is attached, depends on the variable at the
start of the connector.
3.3. Formula editor
Formulas can be simple typed in directly in the definition fields. The Formula Editor is available
however, to assist the user in creating formulas and conditional statements. This Formula Editor
is similar to the editor available for creating formulas via the Create/Edit Diagram/Table dialogs.
The formulas should obey the rules of Coach Language.
3.4. Creating a graphical model
I. If necessary define the independent variable (by default time t).
II. Create the graphical structure of your model.
• Place all variable symbols in the Model window.
• State, Process, Auxiliary and Constant variables: click their symbol button on the
toolbar, the shape of the cursor changes into a small icon of this symbol, move the cursor
onto the Model window, position it and click.
• Flows: click the Flow button on the toolbar, the shape of the cursor changes into a small
flow icon, click a state or process variable (or a suitable empty beginning point in the
window), hold and drag the cursor to the state variable or process until it is selected, then
release the mouse.
- Use <Shift> + <click> to make corners (?).
- Use <Shift> + <Ctrl> to relocate a flow arrow.
• Rename your variables. All symbols have default names which are located under the
symbol (optional for flow and event symbols). To change a default name, select a name
and overtype it. You can also change the name anytime in the properties dialog.
• Draw connectors between the model variables: click the Connector button on the toolbar,
the shape of the cursor changes into a small connector icon, click a symbol from which
the connector has to start, hold and drag the cursor to a symbol where it has to end.
III. Enter formulas and initial values. The symbols with no defined initial values and formulas
show a question mark ‘?’.
• Double-click a symbol with ‘?’. Its properties dialog opens.
123
• Enter formulas for flows, events and auxiliary variables. The formulas can be typed in or
created with the Formula Editor.
• Enter initial values for state variables. Initial values can be typed in (value) or created
with the Formula Editor (formula).
• Enter values for the constants. A constant value can be typed in or selected from the
database with predefined constants.
IV. Define your model settings.
• Click the Settings button in the Activity toolbar.
• Define start and stop conditions.
• Choose the iteration method. By default the Euler method is selected.
V. Select a way of presenting your model data. Right click a variable symbol and select a
diagram, table or value or create your diagrams/ tables by clicking their yellow buttons
available in the Activity toolbar.
VI. Execute your model.
Figure 94. Example of a model in Graphical mode.
3.6. Editing a graphical model
To edit a symbol
• Double-click a symbol in the model structure. Edit the properties of the symbol.
To make a selection
• Click the Select icon in the toolbar.
• Click a symbol to select it. Use <Ctrl>+<click> to select more symbols.
Or
• Drag an area in the Model window to select the symbols inside.
124
To move a symbol
• Click the Select icon in the toolbar.
• Click a symbol to select it or make a selection of several symbols.
• Use the cursor keys to move the selection to another location in the Model window.
To copy a selection
• Make a selection of graphical elements.
• Right click the selection and select Edit > Copy (or <Ctrl>+<C>).
• Right click the Model window and select Edit > Paste (or <Ctrl>+<V>).
• Copied elements will be placed in the Model window. Noticed that the new symbols
automatically get new names.
To delete a symbol
• Click the Delete icon in the toolbar (the cursor changes into a pair of scissors), place the
cursor on a symbol and click it, or
• Select a symbol or make a selection of more symbols and press <Del>.
To erase a model
Right click in the Model window and select the option Erase model. Click Yes when the
question Do you want to erase model? appears. The whole model will be deleted.
Useful shortcuts
• With the menu option Undo or <Ctrl<+<Z> the last performed action is cancelled.
• With <Ctrl>+<A> the whole model is selected.
• By using the menu option Fonts…, the fonts of all selected variables can be changed at
once.
• <Shift> + cursor keys moves the canvas of the Model window.
•
3.7. Converting a Graphical model into Equations and Text mode
The created Graphical model is converted by Coach to:
• an Equations model by clicking the button Equations mode.
• a Text model by clicking the button Text mode.
Models can be viewed and modified in Equations and Text mode. Changes introduced in
Equations mode can be easily translated back to Graphical mode. However this is not the case
for Text mode. As long as text models
remain the same, it is possible to switch
between the Modeling modes. After a text
model was modified a warning message
appears after trying to change the mode.
After clicking Yes the modifications
added in Text mode will be removed.
125
3.8. Subsystems
Graphical subsystems allow closing a selected part of the model and showing it as
one single graphical element. Using subsystems simplifies the structure of complex
models.
To create a subsystem
• Drag an area in the Model window to make a
selection of the elements for your subsystem.
• Right click the selected area and select the option
Create Subsystem.
• A subsystem with default name Subsystem_#
(where # denotes a number) is created; the symbol
of a closed box appears in the Model window.
• To open the subsystem click the + sign in the
upper right corner of the closed subsystem
symbol. To close it again click the - sign.
By double-clicking a subsystem element, its properties Figure 95. The Subsystem Properties dialog.
window opens.
A subsystem can be removed by right clicking the closed or opened subsystem and selecting the
option Remove Subsystem. The elements of the subsystem will remain in the model.
A subsystem can be locked for users by using the lock symbol placed in the upper left corner of
the subsystem symbol. This can be done only in the Author mode of Coach. In the Senior or
Junior modes locked subsystems can not be opened or closed.
4. Equations mode
In Graphical mode the model is defined with mathematical equations “hidden” behind the
graphical symbols. In Equations mode these equations can be made visible.
It is also possible to create models directly in Equations mode; instead of graphical symbols
variable equations are constructed. Equations are created automatically after defining variables.
Variables are defined in a similar way as in Graphical mode by clicking a variable icon on the
Modeling toolbar and entering its properties. In Equations mode the Model window is divided
into two parts: the model equations (left pane) and the initial values (right pane).
4.1. Tool menu in Equations mode
Context Tool menus in Equations mode appear after right clicking in the
Model window:
- a variable equation - the menu (left) with options for
displaying and editing a variable;
- another location in the window - the menu (right)
with options for editing and viewing the model.
126
4.2. Variable equations
State variable equations depend on the notation selected in the model settings. There are two
notations available, the difference equation and differential equation notation.
The State variable is determined by its initial value and the net flow – the sum of ingoing and
outgoing flows which are created by using the Add inflow and Add outflow buttons.
The Process variable is determined by a formula and creates a fixed relationship between the
connected inflows through the corresponding coefficients (by default equal to 1).
Flow equations are added automatically to the model equations. Undefined flow equations
display a question mark ‘?’ and have to be defined by double clicking a flow equation and filling
in its properties.
State and flow variable equations
Difference equation notation
Differential equation notation
Process and flow equations
Auxiliary variable equation
Constant equation
Event equations
The Independent variable equation is not shown in the model. However, the independent variable
is shown (indirect) in the state variable equations. The independent variable can not be overtyped
in equations; it can be changed only in the Independent variable properties window which opens
after clicking the Independent variable icon in the toolbar.
In formulas, used to define variables, new variables (not used in the
model yet) can be introduced. When Coach detects such a new variable
then a new equation with two question marks is added to the model.
First the new variable should be identified in the Select Type dialog
which opens after double clicking of the unknown variable equation.
After selecting the variable type the corresponding Variable Properties
dialog opens and the variable definition can be made.
127
4.3. Creating an Equations model
1. If necessary define the independent variable (by default time t) in the Model window.
2. Create model equations by defining variables with the variable icons available in the toolbar.
• Click an appropriate symbol icon.
• Fill in the name and display properties. In the state variable dialog use the buttons Add
inflow and Add outflow to create flows.
• You do not need to fill in definitions directly; you can first create all variable equations.
The equations with no defined values and formulas display a question mark ‘?’.
• Enter initial values, formulas and constants.
3. Define your model settings.
• Click the Settings button in the
Activity toolbar.
• Define start and stop conditions.
• Define the iteration method. By
default the Euler method is
selected.
4. Select the way of presenting your
model data. Right click a variable
name and select a diagram, table,
value or create your diagrams/tables
by clicking the yellow buttons
available in the Activity toolbar.
5. Execute your model.
Figure 96. Example of an Equations model.
4.4. Editing an Equations model
To edit an equation
Double-click an equation to open its properties dialog or click an equation and move the cursor
to the field you want to edit. You can edit variable names, formulas and values of constants and
initial values.
To make a selection
• Click on the small graphical symbol to select an equation.
• Use <Ctrl>+<click> to select more equations.
To move an equation
• Select an equation.
• Move the equation to another location by using the keys <PgUp> and <PgDown>.
To copy equation(s)
• Make a selection of equations.
• Right click the selection and select Edit > Copy (or press <Ctrl>+<C>).
• Right click and select Edit > Paste (or press <Ctrl>+<V>). The equation lines are copied at
the end of the model equations.
128
To delete equation(s)
• Make a selection of equations.
• Delete equations by pressing <Del>.
To erase a model
Right click in the Model window and select the option Erase model. Click Yes when the
question Do you want to erase model? appears. The model will be deleted.
Useful shortcuts
• With the menu option Undo or <Ctrl>+<Z> the last performed action is cancelled.
• With <Ctrl>+<A> the whole model is selected.
• By using the menu option Fonts…, the fonts of all selected variables can be changed at
once.
• With the key combination <Ctrl> + <Shift> + cursor keys variables can be selected.
4.5. Formula editor
In Equations mode, the same formula editor as in Graphical mode is available. The only
difference is that the formula editor shows all variables which are used in the model.
4.6. Converting an Equations model into a Graphical model or Text model
The created Equations model can be converted by Coach to:
• A Graphical model by clicking the button Graphical mode.
• A Text model by clicking the button Text mode.
Equations models can be viewed and modified in both Graphical and Text mode.
Changes introduced in Graphical mode can be easy translated back into Equations mode.
However, this is not a case for Text mode. As long as text models remain the same, it is possible
to switch between the modeling modes. After a Text model was modified a warning message
appears after trying to change the mode. Changing the mode removes all modifications made in
Text mode.
5. Text mode
A Graphical or Equations model is
translated into a Text model after
selecting Text mode. Such a model is
constructed according to the Coach
Language rules; it is actually a program
that consists of equations for calculation
of the model variables according to the
selected iteration method. The number of
iterations for the model calculations is
given in the model settings.
This mode is very similar to the Text
mode of Coach 5.
Models can be built directly in Text mode
by entering model equations (left pane of
Figure 97. The text Model window.
129
the Model window) and initial values (right pane of the Model window).
After opening a Model window in Text mode, the Independent variable is already defined. The
default Independent variable is t (model equation t := t + dt), with the initial value t = 0 and step
size dt = 0.1. The iteration method can not be selected; the user has to program it. In the model
settings only the number of iterations can be set.
Models created directly in Text mode can not be viewed in Graphical or Equations mode.
5.1. Conditional and loop statements
The Coach Language Command icon opens the list of Coach Language
commands which can be used in Text mode. The commands can be selected
from the list and will be placed at the cursor position in the model. The
following conditional and loop statements are available:
• If Conditional expression Then Statements EndIf
• If Conditional expression Then Statements Else Statements EndIf
• Repeat Statements Until Conditional expression
• Redo Number Statement EndRedo
• While Conditional expression Do Statements EndDo
• Once Conditional expression Do Statements EndDo
Additionally, the Formula Editor option is added to the list of commands. In
this way the formula editor can be started at any place in the model.
5.2. Tool menu in Text mode Equations mode
Context Tool menus in Text mode appear after right
clicking in:
- a text model pane (left)
- an initial values pane (right).
Both menus offer similar options for editing and printing
model and its initial values.
The Monitor and Simulate options are described further
in this chapter.
The Variables… option opens the List of Variables
dialog which shows the variables selected for
display under connections for Values, Meters,
Diagrams and Tables and in lists of Standard
Values, Meters, Diagrams and Tables.
To define a new variable
• Click Add button.
• Select a variable from the list.
• Type in its unit, decimals, minimum and
maximum .
• Click OK to confirm.
To delete a listed variable
• Select a variable from the list.
• Click Delete button.
Figure 98. The List of defined variables.
130
5.3. Creating a Text model
1. After opening the empty Model window in Text mode, the default independent variable time
(name t, unit s) is already defined.
2. Type in the model equations. Coach does not guide you to write equations correctly, these
equations have to be built according to the rules of Coach Language. However, on executing
a model with syntax errors, Coach will indicate which equations are not correct and place the
cursor at the error position. A few general rules are given below:
• Constants may be defined either in the model or in the list of initial values.
• Variables defined by an expression containing the variable itself, e.g.
variable:=variable + dvariable must be defined in the model. To be able to calculate this
variable at the first iteration, the initial value of this variable is needed.
• Variables obtain a new value in each iteration and so they must be defined in the model.
3. Type in initial values. In Text mode, initial values may also be given as an expression
(provided that this expression results in a number).
4. Create diagrams/tables by using the yellow buttons available in the Activity toolbar.
5. Execute your model.
Figure 99. Example of a model in Text mode.
5.3. Editing a Text model
To edit
The model equations and initial values can be edited directly in the Model window. The
equations have to be built according to the Coach Language rules.
To move a selection
• Make a text selection.
• Right click the selection and select Edit > Cut (or press <Ctrl>+<X>).
• Right click the line above which you want to paste the cut lines. Select Edit > Paste (or
press <Ctrl>+<V>).
To copy a selection
• Make a text selection.
131
•
•
Right click the selection and select Edit > Copy (or press <Ctrl>+<C>).
Right click the line above which you want to paste the copied lines. Select Edit > Paste (or
press <Ctrl>+<V>).
To delete a selection
Make a text selection and press <Del>.
To erase a model
Right click in the Model window and select the Erase model option. Click Yes when the
question Do you want to erase model? appears. The model will be deleted.
Useful shortcuts
- With the menu option Undo or <Ctrl>+<Z> the last performed action is cancelled.
- With <Ctrl>+<A> the whole model is selected.
6. Model execution
During model execution calculations of the model variables are done, based on the given model,
initial values and model settings.
To specify Model settings
• Click the Settings button.
• Specify conditions for the independent
variable:
- Start value of the independent variable.
- Stop value of the independent variable or
a condition which should be reached to
stop the model.
- Step interval of the independent
variable.
• In case of large data sets it can be useful to
save only part of the calculated data. It can
be specified in the Save data every # steps
field. By default data are saved every step.
• Check Display run controller to display the
Run controller. By default this option is off.
• Check Draw connectors automatically if Figure 100. The Model Settings dialog in Graphical
you want to automatically draw connectors and Equations modes.
of variables used in a variable definition
(formulas). By default this option is off.
• Select the Integration method; by default the Euler method is selected.
• Select the Notation of the differential equations in Equations
mode; by default the Difference equation is selected).
The Model Settings dialog in Text mode is simple and offers only
a few options.
Figure 101. Model Settings in
Text mode.
132
To execute the model
• To start model execution click the green Start button.
• Model execution stops when the stop value or the stop condition (in the Graphical and
Equation modes) or the number of given cycles (in Text mode) is reached. To interrupt
model execution use the red Stop button or keep <Esc> pressed.
• Additionally you can control the model by using the run controller or the Monitor option.
Run controller
The Run controller is available in Graphical and
Equations mode and is used to control model
execution. It can be placed on the screen by
checking the option Display Run controller in
the Model Settings dialog or the Run
Figure 102. Run controller.
Controller option in the Tool menu of the
Model window.
The Run controller allows to:
• execute the animation by clicking
• stop the execution by clicking
• pause execution by pressing
• adjust the execution speed with the speed given by the slider bar (also during a run).
During model execution the progress of the independent variable and its current value is
displayed next to the independent variable slider. After model execution is finished, one can
scroll through the independent variable values. The calculated values for all other variables are
shown in the model.
For adjusting the model execution speed the speed slider can be used. When the speed slider is
set to its utmost right position (fastest execution) then the model values are not updated in digital
displays. When the speed slider is set in another position then the model values are displayed in
digital displays.
Monitor window
The Monitor window is available in Text
mode when the Monitor option, available
in the Tool menu of the Model window, is
checked.
After starting the model execution, the
Monitor window opens and the execution
of the model can be followed line-by-line.
• Adjust the speed of the monitoring
with the slider (this can be done also
during execution).
• Execute a single line of the model by
pressing the 1-button in the Monitor
bar.
• Click the green button in the Monitor
bar to start line-by-line model
Figure 103. Monitoring the program execution in Text mode.
133
•
execution. During monitoring the line being calculated is indicated and all values of the
variables are displayed at the right side.
Click the red Stop button in the Monitor bar or keep <Esc> pressed to interrupt model
execution.
7. Simulations
With simulation, the effect of a single
model parameter on the model can be
studied.
To simulate
• Right click the Model window and
select the Simulate option.
• Select a parameter from the dropdown-list of model variables.
Figure 104. The Simulation dialog.
• Specify a parameter value by typing a
value in the Value field or setting a value with the Range slider.
• Click the Execute button to draw a graph resulting from the model with the new parameter
value. The new graph has a different color and the parameter value is displayed next to the
vertical axis. This procedure can be repeated for other parameter values. A number of graphs
can be drawn in the same graph.
To verify whether the theory (calculated
data) matches the reality (measured data)
the option Simulate may be used with the
presence of a background graph. Each
diagram allows for one (measurement)
graph to be placed as a background graph.
Graphs resulting from model calculations
can be compared against the background
graph. A hypothesis can be tested by
varying a parameter, to investigate which
value leads to the best fit of the background graph.
If the calculated graph partially overlaps
Figure 105. Testing a hypothesis. The Simulate option helps
the background graph, the option Shift to find the best fit of the measurement data.
Background Graph makes it possible to
shift the background graph horizontally. This option becomes available in the diagram Tool
menu after the background graph is placed in the diagram. With the option Scan the co-ordinates
of points of both graphs can be determined.
Note: To scan the background graph <Ctrl> + <click> should be used.
134
8. Management of models
In general, models are saved together with all other Activity settings in the Coach
Activity/Result file. It is also possible, however, to import only the model from another Coach
Activity/Result.
To import a model
• Right click the Model window and select the option Import model.
• Select a desired Coach Activity/Result and open it. Loading a new model will erase your
current model.
Coach 5 text models are opened in Text mode of Coach 6. It is not possible to view them in
Graphical and Equations modes. Coach 5 graphical models are opened in Graphical mode
and are automatically translated into Coach 6 graphical models.
9. Constructing models in Coach Language
9.1. Coach Language
The models are interpreted by the Coach Language interpreter. The Coach Language syntax is
described in a separate document (see VI. Coach Language).
9.2. Numerical methods used by Coach
There are three numerical methods for solving differential equations:
Euler Method
Coach implements the forward Euler method:
yn+1 = yn + h * f(xn, yn)
Second order
Runge-Kutta method
Coach implements the MidPoint method:
k1 = h * f(xn, yn)
y n+1 = yn + h * f(xn + 0.5*h, yn + 0.5*k1)
Fourth order
Runge-Kutta method
Coach implements the classical fourth order Runge-Kutta
method:
k1 = h * f(xn, yn)
k2 = h * f(xn+0.5*h,yn+0.5*k1)
k3 = h * f(xn+0.5*h,yn+0.5*k2)
k4 = h * f(xn+h,yn+k3)
y n+1 = yn + (k1 + 2*k2+2*k3+k4)/6
9.3. Execution of a Coach Language program
A text model (in fact a program in Coach Language) is constructed from a Graphical or
Equations model according to the Coach Language rules. Such a text model is executed in the
way described below.
135
Initial Value Section
The initial value section is executed one time at the beginning of the model execution to set the
initial values and to calculate the first point. The first point is defined completely by the model
and initial values and is the same for all three iteration methods.
The independent variable is defined by its initial value and step interval, state variables have
initial values defined by constant values or expressions, constants are defined with constant
values or expressions. Auxiliary variables and flows are calculated from these values. This leads
to the following for the initial section of the model program:
1. <independent variable> := <start value>
2. d<independent variable> := <step value for independent variable>
3. All constants and states variables with their initial expressions are added in their order of
dependency. Only the independent variable is known here so that is the only object skipped
in the dependency check.
<constant> := <constant expression>
<state variable> := <state variable initial expression>
4. All auxiliary variables and flows are added in order of their dependency. All other variable
types are already known and dependency checking is done only for auxiliary variables and
flows.
<aux> := <expression>
<flow>:= <expression>
5. All variables have values and the first point is saved:
SaveData
Model Section
The model section is repeated in a loop. An integration step for state variables is calculated based
on their rates of change (sum of all in and out flows), auxiliary variables and flows are
recalculated based on their expressions, the independent variable is increased with it step value
and events are added. The basic structure for the program is the same for all three integration
methods. Assuming that we go from a moment tn and to a moment tn+1 then state variables are
integrated from tn to tn+1. All three methods are forward integration methods starting in tn and
using values of the flows in tn for the start of the integration step. In the Runge-Kutta methods
intermediate points are used to calculate the integration step and the original values are stored.
1. For the Runge-Kutta methods the values of the independent variable, state variables,
auxiliary variables and flows are stored:
old_<state>:= <state>
old_<independent variable>:= <independent variable>
old_<aux>:= <aux>
old_<flow>:= <flow>
2. The calculation of the integration step is different for all three methods, e.g. for Euler:
<state> := <state> + d<independent variable>* (<inflow1> + <inflow2> - <outflow1> …)
3. The state variables are in tn+1 and the independent variable is increased:
<independent variable> := old_<independent variable> + d<independent variable>
4. For the Runge-Kutta methods the auxiliary variables and flows are restored to their previous
values:
<aux>:= old_<aux>
<flow>:= old_<flow>
5. The program part for events is added:
Once (condition) Do
136
6.
7.
<state> := <expression in case of event>
EndDo
The auxiliary variables and flows are calculated in point tn+1. They are added in order of
their dependency. All other variables are known so we only look at dependencies on other
auxiliary variables and flows when determining the order.
<aux> := <expression>
<flow> := <expression>
SaveData is automatically added at the end of the loop (not visible for user).
References for Modeling:
1. Beurs, C. de, Mulder, C.H.T., Vernieuwde computertoepassingen in the Natuurkunde,
Uitgeversmaatschappij Thieme, Zutphen, 1995
2. Few, A., System behavior and system modeling, University Science Books, Sausalito,
California 1996
3. Forrester, J.W. etc. , The first step prepared for the MIT System Dynamics in Education
Project, Principle of Systems, Cambridge, MA, Productivity Press
http://sysdyn.clexchange.org
4. Schecker, H. , Physik – Modellieren , Ernst Klett Verlag, Stuttgart 1998
5. Ogborn, J., Physics Dynamic modeling system – models, Longman Microsoftware London
1985
6. Heck, A., Modeling Chemical Kinetics Graphically (submitted) 2009
137
138
VII. Animation
Table of Contents
1. INTRODUCTION.................................................................................................................................................. 140
2. THE ANIMATION PANE ...................................................................................................................................... 141
2.1. Creating a new or selecting existing animation ....................................................................................... 141
2.2. Edit and Play mode .................................................................................................................................. 142
2.3. Tool menus ............................................................................................................................................... 143
2.4. Animation stage ........................................................................................................................................ 143
3. BACKGROUND PROPERTIES ............................................................................................................................... 145
3.1. Coordinate System tab.............................................................................................................................. 145
3.2. Display tab................................................................................................................................................ 146
3.3. Looping Background ................................................................................................................................ 147
3.4. Zooming Background ............................................................................................................................... 147
4. ANIMATED OBJECTS PROPERTIES ....................................................................................................................... 148
4.1. Ellipse properties...................................................................................................................................... 148
4.2. Rectangle properties................................................................................................................................. 151
4.3. Vector properties ...................................................................................................................................... 151
4.4. Picture properties ..................................................................................................................................... 154
5. CONTROL OBJECTS ............................................................................................................................................ 155
5.1. Button properties ...................................................................................................................................... 155
5.2. Slider properties ....................................................................................................................................... 157
6. CREATING AND EDITING AN ANIMATION ........................................................................................................... 159
7. EXECUTING AN ANIMATION ............................................................................................................................... 160
8. MANAGEMENT OF ANIMATIONS ........................................................................................................................ 160
139
1. Introduction
Presenting data in graphs or in tables may not be enough for students to fully understand the
underlying principles of a phenomenon. Coach 6.3 is enriched with another way of representing
the data – animations.
Figure 106. An example of animation based on the computer model.
Coach animations consist of animated graphics objects, like ellipses, rectangles, vectors and
pictures, which can be linked to model variables, program variables or sensor values18 to control
their positions or sizes. The heart of an animation is a model, program or sensor data. This is the
‘engine’ which contains all the rules and formulas governing the variables involved and which
leads to data as input for the animation.
Constructing an animation is an easy process: choose the desired graphical objects, place them
on the animation stage and assign their properties which describe the way they are displayed and
animated. Additional interactive control objects like buttons and sliders can then be added. These
control objects allow altering parameter variables during the execution of the animation to
interact with the system and to see the effect of those changes.
18
Throughout this chapter, either of these is denoted with the word ‘variable’.
140
2. The Animation pane
2.1. Creating a new or selecting an existing animation
.
Animations can be created or selected via the yellow information button Animation
A Coach Activity can contain several animations; the list of available animations is given under
the Animation button after clicking the arrow next to the button or after clicking the button itself.
To select an existing animation
• Click the arrow next to the Animation button and select an animation from the list.
Or
• Click the yellow Animation button, select an animation from the list and click OK.
To create a new (empty) animation
• Click the arrow next to the Animation button and select Add new, type in an animation title
and click OK, click a pane to place animation on the screen.
Or
• Click the yellow Animation button and click New Animation. Type in an animation title
and click OK. Click OK again.
To edit the title of an animation
• Click the yellow Animation button, select an animation from a list and click Edit.
• Overwrite the selected animation title.
Or
• Right click an animation pane or click the animation Tool menu button and select Edit Title.
To delete an animation
• Click the yellow Animation button.
• Select an animation from the list and click Delete.
• The animation is removed from the list. Mind that deleting is an irreversible process.
To copy an animation
• Click the yellow Animation button.
• Select an animation from the list and click Copy Animation.
• A duplicate animation appears in the list.
Note: If you want to copy an animation that is currently displayed in a pane, first close that
animation, then it will show up again in the yellow button list.
Note: Creating, deleting and copying animations is possible only in Author and Senior student modes.
141
2.2. Edit and Play mode
Animations are created in Edit mode (only possible in Author and Senior student modes) and
executed in Play mode. By default an existing animation is opened in Play mode. A new
animation is opened in Edit mode.
allows switching between Edit and Play mode (if the user level
The Show Properties button
of current activity permits this). Each of the modes has it own toolbar.
Edit mode toolbar
Hide/Show Properties to switch between Edit and Play mode.
This button is available only in Author mode and Senior student mode.
Insert Ellipse object (also: circle)
Insert Rectangle object (also: square)
Insert Vector object (also: line)
Insert an Image
Select Mode to reposition objects in the Animation stage
(either this mode or Rotate mode is operational).
Rotate Mode to rotate objects in the Animation stage
(either this mode or Select mode is operational).
Insert an Annotation
Fit to Stage to fit the animation to the size defined by the fit markers
Interpret model and connect animation objects to (initial) values of variables
Insert a Control Button
Insert a Control Slider
Play mode toolbar
Hide/Show the Properties dialog and switch between Edit and Play mode.
This button is available only in Author mode and Senior student mode.
Fit to Stage to fit the animation to the size defined by the fit markers
142
2.3. Tool menus
Tool menus appear after right-clicking in the Animation pane. The Tool menu depends on the
mode in which the Animation is set and for the Edit mode also on the location of clicking:
The Tool menu of Play mode:
The Tool menu of Edit mode
when right-clicking the
Background:
The Tool menu of Edit mode
when right-clicking an
animated object:
Most of these Tool-menu options are described further on.
2.4. Animation stage
The Coach pane where the animation is placed is called the animation stage or simply the
‘stage’. The stage consists of the Background and animation objects. All objects used in the
animation are displayed under the drop-down list of the Properties sheet.
Stage and Local Coordinate Systems
Each animation has one stage coordinate system which is defined in its Background tab (in
pixels or other units). Each object has its own local coordinate system defined in terms of the
stage coordinate system. The position of this local coordinate system is defined by the location
where the object is placed on the stage or when controlled by variables by initial values of
connected variables. The object’s coordinates are displayed then with respect to its local object’s
coordinate system.
It is also possible to use the stage coordinate system globally for all animation objects, then all
objects just share the stage coordinate system and do not have local coordinates systems (see also
‘3.1. Coordinate System’).
Stage Rulers
The stage rulers follow the coordinate system settings and display the size of the stage in the
stage coordinate system units (only in Edit mode).
143
To turn hide/show the Stage Rulers
• By default the stage rules are displayed in Edit mode.
• In Edit mode, right-click the Animation pane and select/deselect the Tool-menu option
Show/Hide Stage Ruler.
Fit Markers
With the fit markers, the creator of an animation can
specify a stage area which will at least stay visible
when zoom to fit is used. This is useful when the
animation is run on a computer with a different screen
resolution, or if an object is moving during the
animation, to reserve some extra space in its
direction(s) of motion.
To set the fit markers
• In Edit mode, right-click the Animation pane and
select the Tool-menu option Use Fit Markers.
• Specify a stage area by moving dark grey bars on
the stage rulers. The light grey bars define the area
(see screen-shot to the right).
Note: After resizing the Animation pane you can have a
problem to “find” the dark grey bars. To solve it first turn
the option Use Fit Markers off and then turn it on again.
After this action the markers adjust to the new
Animation pane size and are easy to get.
Figure 107. Specifying an animation area by the
fit-markers.
Animation Z-order
Each of the animation objects has its own Z-order which determines the arrangement of the
objects on the stage. The object’s Z-order is set automatically during the creation of the
animation (and follows the order the objects are inserted); the background always gets Z-order 0,
the first created object gets Z-order 1, the second created object gets Z-order 2, etc. The object
with the highest Z-order is in front of all other objects, the object with the lowest Z-order is
behind all objects (usually the Background), i.e. the arrangement of the objects determines which
object covers which when they are moving over each other.
To change the Z-order of an object
• In Edit mode, right-click the Background and select the
Animation Z-order or right click an object and select Object
Z-order.
• The Z-order dialog appears which displays the stage map
location of the animation objects in the given Z-order.
• Select an object.
• Click Backward or Forward to move the object backward or
forward in the arrangement.
• Click Delete to delete the selected object.
Figure 108. The Z-Order dialog.
Note: Placing objects behind the background assigns them a negative Z-order value. This can be useful
if the background picture covers only part of the stage.
144
3. Background properties
An animation has one Background. All options regarding the properties of the background can
be found in Edit mode after selecting Background from the drop-down list of the Properties
sheet.
3.1. Coordinate System tab
Each animation has one stage coordinate system. The location of the
origin (0, 0) of this stage coordinate system is given by the X and Y
coordinates with respect to the lower left corner of the Animation pane.
By default the origin of the stage coordinate system is placed in the
middle of the pane and the unit of the stage coordinate system is 1
pixel, but it can be changed to another unit (see below).
The stage rulers follow this system and display their values in the stage
coordinate unit.
To change the location of the coordinate system
• Drag the coordinate system origin or one of the axes in the
Animation pane (the cursor above the coordinate system changes
into a hand).
Note: Be careful with dragging too much in the neighborhood of objects.
Dragging objects has prevalence above dragging the coordinate
system.
Or
• Type the new coordinates X, Y of the new origin in the respective
fields of the Coordinate System tab.
Figure 109. The Coordinate
• The coordinate system origin can be re-centered simply by right System tab.
clicking the Animation pane and selecting Center Coordinate
System.
When Show is checked, the stage coordinate system will be shown in
Play mode.
When Same system for all objects is selected then all objects use the
stage (global) coordinate system instead of their own local coordinate
systems. The options regarding local coordinate systems disappear from
the
objects’
properties.
Scale Coordinate System
The stage coordinate system can be scaled into other units by checking
the Scale coordinate system option.
To change the scale of the stage coordinate system
• Check the Scale coordinate system option.
• The scaling fields, from pixels into other units, appear. By default
100 px to 100 u.
• Type in a new scale and if needed another unit ( means that the
direction is positive (from left to right), means that the direction Figure 110. Defining a new
is negative (from right to left)).
scale for the stage Coordinate System.
145
•
After this is done all information in the objects’ properties will be displayed in the new units
rather than in pixels. Also the stage rulers use the new scale.
3.2. Display tab
By default the color of the background is white.
To change the Background color
• Click the color box and select a color from the Pick a Color dialog.
To display the Background grid
• Check the option Grid and type in the number of pixels/units
between the grid lines. Also the color of the grid can be changed.
Picture
The Background can contain a picture.
To load a Background picture
• Check the option Picture. Now several related options appear.
• Click the Browse button and browse your computer to find a
background picture.
• Click OK.
Has transparent color – by selecting this option it is possible to indicate
which color in the picture becomes transparent.
Figure 111. The Display
Under Position on stage the X and Y coordinates of the lower left corner tab of the Background.
of the picture are displayed in units of the stage coordinate system.
To place a picture in another location on the stage
• Define a new picture position by typing its new X and Y coordinates of the lower left corner
of the picture.
Or
• Move the cursor over the picture in the Animation stage until it changes into a cross and drag
the picture to its new location.
The size of the picture (in stage units) is displayed under Size. This size can be changed by
typing new values for Width and Height. If Keep aspect ratio is checked (on by default), then
the ratio between width and height of the picture is kept the same during resizing of the picture.
The Reset button allows resetting the picture to its original dimensions.
The Tile option (Horizontally, Vertically, All directions) allows placing copies of the original
background picture to fill the stage (respectively in horizontal, vertical or both directions). The
original picture is indicated by a black frame around it.
If the option Auto-fit is selected then Coach resizes the picture to fill the Animation pane.
However, if also the option Keep aspect ratio is on, then Coach fills the smallest of either width
or height, such that the aspect ratio stays the same.
146
Background type
A background picture can be displayed stationary or can move in several special ways like
moving in a horizontal or vertical loop, zooming in or out. The way the background picture
behaves is defined by a background type:
• Stationary - the background picture does not move during the animation.
• Looping - the background picture moves during the animation.
• Zooming – the background picture is zoomed during the animation (i.e. it resizes).
3.3. Looping Background
If the option Looping is selected as the Background type on the tab
Display, a new tab Looping appears. In this tab the motion of the
background picture during the animation can be specified. Looping
means that the movement of the background picture in horizontal
and/or vertical direction can be controlled by an independent, constantrate factor, or by a variable.
If the picture is tiled in the chosen direction(s) then a continuously
unwinding background picture can be created. To make this look
realistic, the picture should have suitable end points. So motion can be
simulated, e.g. by creating a street with houses which moves with a
constant rate (while the object itself can stay at the same place).
To control the movement of the background picture by a variable
• Make a connection by selecting a variable for either the horizontal
or vertical direction or both.
Local scale
Check this option to change the scaling of the motion by typing values
in the scale boxes, or by dragging the ruler displayed on the animation Figure 112. The Looping tab.
stage. Default 100 stage units means 100 new units ( means the
positive direction is to the right or up, means the positive direction is
to the left or down).
Note: When Constant rate is chosen, local scaling can be used to fine-tune
the speed of the motion.
3.4. Zooming Background
If the option Zooming is selected as the Background type on the tab
Display, a new tab Zooming appears. In this tab a zooming motion of
the background picture during the animation can be specified.
Zooming means that the size of the picture is either enlarged or
diminished controlled by an independent, constant rate factor, or by a
variable. In this way a motion towards or away from the background
can be suggested.
To control the zooming of the background picture by a variable
• Select the reference point of the background picture from where
the zooming takes place. By default the center of the picture is
taken.
Figure 113. The Zooming tab.
147
•
•
Make a connection by selecting a variable for the Zoom.
Check the Local scale option to change the scale of the zooming motion by typing values in
the scale boxes, or by dragging the ruler displayed on the animation stage. Default 100 stage
units means 100 new units ( means the positive direction is to the right or up, means the
positive direction is to the left or down).
Note: When Constant rate is chosen, local scaling can be used to fine-tune the speed of the zooming.
4. Animated objects properties
An animation can consist of four types of objects which can be animated:
- Ellipse;
- Rectangle;
- Vector; and
- Image.
In Edit mode objects can be created, positioned, sized and animated. Animation is achieved by
letting the objects move across the screen, by changing their dimensions or by rotation.
4.1. Ellipse properties
The name of a newly created Ellipse is displayed under the drop-down list of the Properties
sheet. The default name is ‘Ellipse #’ (where # denotes a number).
Position tab
With the options on this tab it is possible to control the position of the
reference point of the ellipse during animation, or to rotate it.
Under Reference point the reference point of the ellipse can be set
(center (default), left center, top center, right center, bottom center).
Under Origin of local coordinate system the X and Y coordinates of
the origin of the local coordinate system are given in terms of the stage
coordinates. With Show checked, the local coordinate system of the
object will be shown in Play mode.
When the stage coordinate system is used as the global coordinate
system for all objects, the section Origin of local coordinate system is
not shown.
To relocate the Local Coordinate System
• Type in the new X and Y coordinates of the origin in terms of the
stage coordinates.
Or
• Drag the local coordinate system to a new position on the stage (the
cursor above the coordinate system changes into a hand).
Note: Be careful with dragging too much in the neighborhood of objects. Figure 114. The Position
Dragging objects has prevalence above dragging the coordinate tab of the Ellipse properties.
system.
148
Connections
The options Horizontal direction and Vertical direction allow controlling the horizontal and
vertical position of the ellipse on the stage during the animation.
The option Angular direction allows controlling the angle of rotation around the reference
point. For rotations only the center of the object can be used as a reference point.
When Stationary is selected, then the ellipse does not move in the given direction and the
respective co-ordinate of the reference point, given in terms of the local coordinate system, is
specified in the field next to the drop-down list. By default it is 0. An object can be relocated in
its own coordinate system by typing a new value or dragging an object to a new location on the
stage.
When a connection to a variable is made then the selected variable controls the movement of the
reference point of the ellipse in the given direction. The initial value of this variable determines
the initial location of the object in its local coordinate system. This value is automatically
received from the model, program or sensor.
Check the Local scale option to change the scaling of the selected connection from the stage
coordinate units to the local coordinate units. This can be done by typing values in the scale
boxes, or by dragging the ruler displayed on the animation stage. Default 100 stage units means
100 new (variable) units ( means the positive direction is to the right or up,
means the
positive direction is to the left or down).
To define ellipse movement
• Under Horizontal direction and/or Vertical direction select the connection from the dropdown list which will control the horizontal and/or vertical movement on the screen.
• If needed apply local scaling by marking the option Local scale and by typing a new value or
by dragging the corresponding ruler(s) on the stage.
• Under Angular direction select a connection which will control the rotation of the object on
the screen. It is not possible to scale this connection locally (for rotation always real angles
are used). The reference point will always be in the center of the
object.
The animation makes use of the settings for degrees/radians from the
Activity Options.
Dimension tab
With the options on this tab it is possible to control the size of an object
during the animation.
Note: When Circle is checked then the ellipse becomes a circle and definitions
have to be done only for a circle radius. Some options disappear.
The options Semimajor axis/Semiminor axis allow controlling the
dimensions of the ellipse during animation.
When Stationary is selected, the ellipse does not change its size in the
given direction, and the respective fixed dimension, given in terms of the
local coordinate system, is specified in the field next to the drop-down
list. This size can be changed by typing a new value or by resizing the
ellipse on the stage.
Figure 115. The Dimension
tab of the Ellipse properties.
149
When a connection to a variable is made then the selected variable controls the length of semiminor/semi-major ellipse axis (or circle radius). The initial value of this variable determines the
initial dimension. This value is automatically received from the model, program or sensor.
Note: Mind that if the variable has a small value (or is equal to zero), the object will disappear from the
screen. It can be reselected via the drop-down list in the Properties sheet.
Check the Local scale option to change the scaling of the selected connection from the stage
coordinate units to local coordinate units. This can be done by typing values in the scale boxes,
or by dragging the ruler displayed on the animation stage.
Default 100 stage units means 100 new (variable) units ( means the positive direction is to the
right or up, means the positive direction is to the left or down).
To define ellipse resizing
• Under Semimajor Axis and/or Semiminor Axis (or Radius) select the connection from the
drop-down list which will control the length of that axis.
• If needed apply local scaling by marking the Local scale option and by typing a new value or
by dragging the corresponding ruler(s) on the stage.
Display tab
This tab contains options connected to the way the object is displayed
on stage.
Show name: by marking this option the object’s name is displayed
next to the object on the stage. The Font button allows changing a font
of the displayed name.
To change the object’s name
• Select an object’s name in the drop-down list of the Properties sheet
and type in its new name.
Or
• Select an object’s name tag when displayed on the stage and
overtype the new name.
• Click the Font button to set the font of the name display.
Show digital display: by marking this option, the values of the
connected variable(s) are displayed next to the object on the stage. The
digital display can be dragged to any desired position with the mouse.
The Edit button opens the dialog in which the digital displays can be
specified per selected variable (e.g. if an object has several
connections, you can specify which values to show): Figure 116. The Display tab
of the Ellipse properties.
150
Fill color: to select the inside color of the object. If the option Gradient is checked, the fill style
of the object can be selected via the Style… button. In this way a suggestion of 3D can be
obtained.
Border color: to select the color for the object’s border.
Border width: to set the width of the object’s border or to hide the border (none).
Z-Order: to set the stacking order of objects in the animation. The Z-order can be changed by
typing a new order value or by using the dialog which opens after pressing the Change button
(see also & 2.4. Animation stage’).
Show trajectory of: by marking this option the path of the selected point is displayed on the
stage during the animation. This option is only active if the object has a connection. The default
is the object’s reference point.
When this option is marked then the Edit Style button
appears. Clicking this button opens the dialog Edit
Trajectory Style and allows specifying a Color, Marker,
Type and Line width of the trajectory.
Trace every # steps: when this option is selected then the object leaves a picture (‘shadow’) on
the stage during the animation each given interval. The interval is defined by the number of time
steps.
Only first frame: when this option is checked, it is possible to mark only the begin and end
position of the object.
4.2. Rectangle properties
The properties sheets of a Rectangle object are very similar to the properties sheets of an Ellipse
except for the Dimensions tab. Here the Height and Width of the rectangle are used instead of
the Semi-minor axis and Semi-major axis. And if Square is checked then the rectangle
becomes a square and definitions can be made only for the height.
The name of a newly crated Rectangle is displayed under the drop-down list of the Properties
sheet. The default name is ‘Rectangle #’ (where # denotes number).
4.3. Vector properties
The name of a newly created Vector is displayed under the drop-down list of the Properties
sheet. The default name is ‘Vector #’ (where # denotes a number).
Position tab
During an animation you can control the position of the begin point
of a vector.
The End point
of the vector
Under Reference point the Begin point is shown (this is the only
possible reference point of the vector).
Under Origin of local coordinate system the X and Y coordinates
The Begin point
of the origin of the local coordinate system are given in terms of the
of the vector
stage coordinates. With Show checked, the local coordinate system
of the object will be shown in Play mode.
When the stage coordinate system is used as the global coordinate system for all objects, the
section Origin of local coordinate system is not shown.
151
To relocate the Local Coordinate System
• Type in the new X and Y coordinates of the origin in terms of the stage coordinates.
Or
• Drag the local coordinate system to a new position on the stage (the
cursor above the coordinate system changes into a hand).
Note: Be careful with dragging too much in the neighborhood of objects.
Dragging objects has prevalence above dragging the coordinate system.
Connections
The options Horizontal direction and Vertical direction allow
controlling the position of the begin point of the vector on stage.
When Stationary is selected, then the begin point does not move in the
given direction and the respective coordinate of the reference point,
given in terms of the local coordinate system, is specified in the field
next to the drop-down list. By default this coordinate equals 0. A
vector’s begin point can be relocated in its local coordinate system by
typing a new value or dragging a vector to a new location.
When a connection to a variable is made then the selected variable
controls the movement of the begin point of the vector in the given
direction. The initial value of this variable determines the initial location
of the begin point in its local coordinate system. This value is
automatically received from the model, program or sensor.
Figure 117. The Position
Check the Local scale option to change the scaling of the selected tab of the Vector properties.
connection from the stage coordinate units to the local coordinate units.
This can be done by typing values in the scale fields, or by dragging the ruler displayed on the
animation stage. Default 100 stage units means 100 new (variable) units ( means the positive
direction is to the right or up, means the positive direction is to the left or down).
To define vector movement
• Under Horizontal direction and/or Vertical direction select the connection from the dropdown list which will control the horizontal and/or vertical movement of the vector’s begin
point on the screen.
• If needed apply local scaling by marking the Local scale option and by typing a new value or
by dragging the corresponding ruler(s) on the stage.
Dimension tab
With the options on this tab it is possible to control the vector size during animation. The
vector’s dimensions can be displayed in Cartesian or Polar coordinates.
In Cartesian coordinates the vector is described in terms of its X and Y components. In Polar
coordinates the vector is described in terms of its length and angle.
152
Cartesian
X-component and Y-component allow controlling the position of the
end point of the vector on stage.
When Stationary is selected, then the selected vector component does
not change its size and its length is specified in the field next to the drop
down list. By default this length equals 50 pixels. The vector’s end
point can be relocated in its local coordinate system by typing a new
value or dragging the vector’s end point to a new location.
When a connection to a variable is made then the selected variable
controls the selected vector component. The initial value of this variable
determines the initial component length. This value is automatically
received from the model, program or sensor.
Mind that if the initial values are zero, the vector seems to disappear
from the screen (its magnitude is zero)!
Check the option Local scale to change the scaling of the selected
connection from the stage coordinate units to the local coordinate units.
This can be done by typing values in the scale boxes, or by dragging the
ruler displayed on the animation stage. By default 100 stage units
means 100 new (variable) units ( means the positive direction is to the Figure 118. Defining
right or up, means the positive direction is to the left or down).
vector’s dimensions in the
Cartesian coordinates.
To define vector resizing
• Under X-component select a connection which will control the
length of the horizontal component.
• If needed check the Local scale option and specify a new scale by
typing a new value or by dragging the horizontal ruler on the stage.
• Under Y-component select a connection which will control the
length of the vertical component.
• If needed check the Local scale option and specify a new scale by
typing a new value or by dragging the vertical ruler on the stage.
Polar
Length and Angle allow controlling the position of the end point of the
vector on stage.
When Stationary is selected, then the length and angle do not change
during the animation and their values are specified in the field next to
the drop-down list. The vector’s end point can be relocated in its local
coordinate system by typing a new value or dragging the vector’s end
point to a new location.
When a connection to a variable is made then the selected variable
controls the selected vector component. The initial value of this variable Figure 119. Defining
determines the initial length/angle. This value is automatically received vector’s dimensions in the
Polar coordinates.
from the model, program or sensor.
Mind that if the initial length is zero, the vector seems to disappear from
the screen (its length is zero)!
153
To define the vector resizing
• Under Length select a connection which will control the length of
the vector.
• If needed check the Local scale option and specify a new scale by
typing a new value or by dragging the horizontal ruler on the stage.
• Under Angle select a connection which will control the rotation of
the vector. It is not possible to rescale angles.
Display tab
The Display tab sheet is similar to those of the Ellipse and Rectangle.
The only additional options:
- Show arrow, which is by default checked to attach an arrow head
at the end of the line, and
- Show components with which its horizontal and vertical vector
components are shown. The components will be drawn in the
selected color.
4.4. Picture properties
A picture can be selected directly via the Open dialog after clicking the
Image button on the Toolbar.
Figure 120. The Display tab
The properties for a Picture are very similar to the properties of an of the Vector properties.
Ellipse and Rectangle.
In the Dimensions tab a few additional options appear:
• Lock aspect ratio – when this option is checked then the ratio between the width and height
of the picture is kept constant when resizing the picture. (Default this option is on).
• Use the Reset button to reset the picture to its original dimensions.
In the Display tab the following additional
options appear:
• Image file name: displays the name of the
picture file. If the name is too long, a
tooltip displays the full name (and path).
• The Browse button allows replacing the
picture by another picture from disk.
• The option Has transparent color allows
to define a transparent color in the picture.
Figure 121. The Dimension and Display tabs of the
Picture properties.
154
5. Control objects
Parameters of the model or program e.g. a constant or a model initial value, can be assigned to
Control objects. These Control objects are active during the animation; they allow the user to
change parameter values during the animation and to observe the effects of these changes.
There are two types of Control objects:
• Button – this category consists of control objects with just two states;
• Slider – this category consists of control objects with ‘multiple states’.
Each Control object also has its own properties sheet which is displayed in Edit mode when the
object is selected. The name of a new Control object is displayed in the drop-down list of the
Properties dialog. The default name is ‘Control #’ (where # denotes a number).
5.1. Button properties
Definition tab
There are four shapes available for Button:
Button
Button not pressed assigns the State 0 value.
Button pressed assigns the State 1 value.
Checkbox
When empty, it assigns the State 0 value.
When ticked, it assigns the State 1 value.
Switch
Position 1 assigns the State 0 value.
Position 2 assigns the State 1 value.
Radio Buttons
When empty, it assigns the State 0 value.
When ticked, it assigns the State 1 value.
155
Under Position on stage, the coordinates X, Y of the left bottom corner
of the button object are given in terms of the stage coordinates.
To relocate the control object
• Type in the new X and Y coordinates of the left bottom corner of
the Button in terms of the stage coordinates.
Or
• Select the Button on the stage, press and hold <Ctrl> and drag it to
another location on the stage.
Under Dimension the width and height of the Button are given.
To change the Button size
• Type in new values of Width and Height in the indicated unit.
Or
• Select the Button on the stage and drag to resize it.
Control parameter
Use option Variable to assign a parameter to the control object. As
soon as a variable is selected from the drop-down list, the Range
properties appear. For a button-type of control its two states, State 0 Figure 122. The Definition
tab of the Button properties.
(Off) and State 1 (On) have to be defined.
To assign a variable
• Under Variable select a variable from the drop-down list.
• Under Range, type in the state values. The default value of State 0
is the current value of the variable (defined in the model or
program), and State 1 value is not defined.
Display tab
Show name: by marking this option the object’s name is displayed
next to the object on stage. The Font button allows changing the font of
the displayed name.
Show state names: by marking this option (by default on) the names of
the states are displayed on the control object on stage. The Font button
allows changing the font of the displayed states.
Show value: by marking this option the current state value is displayed
next to the object on stage. The Font button allows changing a font of
the displayed name.
Either of these can be dragged to the desired position.
Figure 123. The Display tab
of the Button properties.
156
5.2. Slider properties
Definition tab
There are three shapes available for continuous sliders and five shapes available for discrete
sliders:
Slider
Continuous & Discrete
Bar
Continuous & Discrete
Spinner
Continuous & Discrete
Radio Buttons
Discrete only
Drop-down list
Discrete only
Under Position on stage, the X and Y coordinates of the left bottom corner of the slider are
given in terms of the stage coordinates.
To relocate the control object
• Type in the new coordinates X, Y of the left bottom corner of the slider in terms of the stage
coordinates.
Or
• Select the Slider on the stage, press and hold <Ctrl> and drag it to another location on the
stage.
Under Dimension the width and height of the Slider are given.
To change the Slider size
• Type in new values of Width and Height in the indicated unit.
Or
• Select the Slider on the stage and drag to resize it.
Control parameter
Use the option Variable to assign a parameter to the control object. As soon as a variable is
selected from the drop-down list, the Type and Range properties appear.
To assign a variable
• Select a variable from the drop-down list under Variable.
157
•
Select the type: Continuous or Discrete. Depending on the selection different options appear
under Range:
- When Continuous is selected specify the Min and Max values of the range, the Number
of steps or the Step size and the Nr. Decimals used by the slider.
- When Discrete is selected specify Number of states (at least 3 up to 25) and assign each
state its own Name and Value.
Figure 124.Defining a Continuous (left) or Discrete (right) Slider.
Display tab
Depending on the selected shape different options are available:
Show Name: by marking this option the object’s name is displayed
next to the object on stage. The Font button allows changing the font of
the displayed name.
Show state names: by marking this option (by default on) the names of
the states are displayed on the control object on stage. The Font button
allows changing the font of the displayed states.
Show value: by marking this option the current state value is displayed
next to the object on stage. The Font button allows changing the font of
the displayed name.
Either of these can be dragged to the desired position.
Orientation can be Horizontal or Vertical for the Slider and Bar
shapes.
Empty color, Full color and Pointer color can be defined for the Bar
shape.
Color can be defined for the drop-down list.
Figure 125. The Display tab
of the Slider properties.
158
6. Creating and editing an animation
1. Click the arrow next to the Animation button and select Add new or click the Animation
button and click New Animation (only for Author and Student user modes).
2. Enter a title of your new Animation and click OK. The shape of the mouse cursor changes
into the animation symbol.
3. Click in a pane to place the animation, or click <Esc> to cancel.
4. The new animation opens in Edit mode. Only in this mode it is possible to build and modify
an animation. The Properties dialog for the Background is displayed directly on the screen.
5. Define the Background: the location of the stage coordinate system (default the center of the
pane), color, grid, movement etc. (see 3. Background properties).
6. Place a new object on the stage and connect it to a variable(s) to animate it:
• Ellipse and Rectangle: Click an object button on the toolbar, the cursor shape changes
into a small ellipse/rectangle symbol, move the cursor into the stage to the roughly
desired position and click. The ellipse/rectangle gets the default name
Ellipse 1/Rectangle 1.
•
Vector: Click the vector’s button on the toolbar, the cursor shape changes into a small
vector symbol, move the cursor into the stage to the roughly desired position, click and
drag to form a vector. The begin point of the vector is displayed as a small black
rectangle; the end point of the vector is displayed as a small white rectangle.
The vector gets the default name Vector 1.
•
Note: If you just click and do not drag, a standard vector will be drawn with two components of
50 pixels each. You can change the size later by dragging its end point.
Picture: Click the picture’s button on the toolbar, in the Open dialog select the desired
picture and click Open, the cursor shape changes into a small picture symbol, move the
cursor into the Animation pane, position it and click. The picture gets the default name
Picture 1.
• Notice that on the moment of placing a new object on the stage the origin of the object’s
local coordinate system goes through its reference point.
• The name of the selected object can be changed by overtyping its name in the dropdown list of the Properties sheet.
7. Define the properties of each object (see 4. Animated objects properties).
If your new object makes use of the same Position properties (connections and scaling) as an
already defined animated object, you can copy these properties by right clicking the new
object, choosing Copy position from…, and selecting an earlier defined object from the list.
8. Place a control object(s) on the stage. Click a control object (Button or Slider) button on the
toolbar, the cursor shape changes into a small object symbol, move the cursor into the stage
to the roughly desired position and click. The control object gets the default name Control 1.
The name can be changed by overtyping it in the drop-down list of the Properties sheet.
9. Define the properties of each control object (see 5. Control objects properties).
To select an object and display its properties
• Click an object on the stage.
Or
• Select the object’s name from the drop-down list in the Properties sheet.
To edit an object properties
• Select the control object on the stage.
• Edit its properties in the Properties sheet.
159
To move an animated object (Ellipse, Rectangle, Vector or Picture) on stage
• Select the animated object on the stage.
• Drag the object to its new position or type its new co-ordinates in the Properties sheet.
To move a control object (Button and Slider) on stage
• Select the control object on the stage.
• Hold the <Ctrl> key and simultaneously drag the control object to its new position or type its
new co-ordinates in the Properties sheet.
To delete an object on the stage
• Select the object.
• Press <Del> key.
Useful hints
By repeatedly selecting the menu option Undo or pressing <Ctrl>+<Z> you can undo your last
series of actions.
7. Executing an animation
To execute an animation
• Click the green Start button.
• The animation(s) will be executed as long as the model or program is executed or as long as
the measurement lasts.
• Alternatively, you can control the animation by using the run controller.
• After the animation is finished you can reset it by right clicking the Animation pane and
selecting Reset animation.
- By using the Scan option (available via the Tool menu of the Diagram pane) all data
representations, graphs, tables, meters, values and animations can be viewed simultaneously
during the model execution.
The animation can also be controlled by using the Run Controller in the similar way like in
Modeling. It can be placed on the screen by checking the option Run Controller in the Tool
menu of the Animation pane or the Model window (see 6. Model execution).
8. Management of animations
In general, animations are saved together with all other Activity settings in the Coach
Activity/Result file. It is also possible, however, to export an animation (without control objects)
as an AVI video.
To export an animation
• Right click the Animation pane and select the option Export as AVI ….
• In the Save as dialog, type in a name for the AVI file and click Save.
• Wait until the complete animation is being exported.
Note: Control objects are not included in the created AVI file.
160
IX. Data Processing and Analysis
Table of Contents
1. INTRODUCTION................................................................................................................................................... 162
2. SELECT/REMOVE DATA...................................................................................................................................... 162
3. SMOOTH ............................................................................................................................................................. 163
4. DERIVATIVE ....................................................................................................................................................... 167
5. INTEGRAL ........................................................................................................................................................... 169
6. SLOPE ................................................................................................................................................................. 170
7. AREA.................................................................................................................................................................. 171
8. FUNCTION FIT ..................................................................................................................................................... 172
9. SIGNAL ANALYSIS .............................................................................................................................................. 174
10. STATISTICS ....................................................................................................................................................... 186
11. HISTOGRAM ..................................................................................................................................................... 186
161
1. Introduction
The data collected in measurements or generated by models can be further
processed with the help of advanced tools. The data processing is closely
connected to the Diagram and Table panes.
The Process/Analyze options work all in a similar way. After selecting an
option an extensive dialog that includes the diagram is shown. Below the
diagram the parameters can be specified. The Column option appears in all
dialogs. This option is used to switch between vertical quantities (graphs) if
the diagram contains several quantities. The selected graph is shown;
invisible data ranges can not be selected.
Figure 126. The Process
The Tool menus of the dialogs consist of three options:
/ Analyze options.
- Print – to pint the dialog
- Copy to Clipboard <Ctrl>+<C> - to copy the dialog to the clipboard.
- Help – to get help on a Topic.
2. Select/Remove Data
With the option Select/Remove Data either a range of data or single points can be selected for
removal (or retention) from the diagram. The selected points/rows will be removed from all
diagrams/tables in the Activity.
In the Select/Remove Data dialog, the selected graph is blue and zoomed-to-fit. The other visible
graphs in the diagram (if any) are gray. The boundary lines of the selected range and the selected
points are dark red. The following specific options are available:
Selection method
For selecting either Range (default)
or Point-by-point method.
Data Fields
When Selection method is set to
Range, the fields display the begin
point and the end point of the
selected interval along the X-axis.
You can also type values for the
boundary points. When the original
diagram was zoomed in, the values
are pre-selected corresponding to the
boundaries of the zoomed diagram.
When Selection method is set to
Point-by-point, the fields display
the co-ordinates of the horizontal
quantity and vertical quantity of the
selected point.
Keep selected
All non-selected points will be removed.
Figure 127. The Select/Remove Data dialog.
Remove selected
All selected points will be removed.
162
To select/remove data
• Select Process/Analyze > Select/Remove Data.
• Under Column select the graph for which you want to make a selection.
• Select the selection method.
• For the Range method: select the range by dragging the boundary lines, or type the
boundary values in the Begin and End fields.
• For the Point-by-point method: select points on the graph by clicking. Use the cursor keys
to walk from point to point. Click a selected point to deselect it.
• Select between Keep selected or Delete selected.
• Click OK to confirm or Cancel to close the Select/Remove Data dialog without changes.
- Via the option Undo (<Ctrl>+<Z>) in the corresponding table it is possible to undo this
action. The Undo buffer only stores one action!
- Single points can also be removed via the Rows option via the table Tool menu.
Note: The rows will be removed from all diagrams and tables in the Activity.
3. Smooth
The option Smooth is used to create a smooth curve that fits a rough or limited set of measured
points as well as is reasonable. This option offers three techniques of approximations: Moving
average, Bezier and Spline. The smoothed graph may consist of (much) more points than the
original data set and can successively be processed. An important application of spline
smoothing is the computation of derivatives that still have smooth graphs. Moving averages are
often used in time series analysis to eliminate short-term fluctuations in time series and highlight
long-term trends and cycles.
Moving average
The Moving average is used to reduce random noise in the graph. The result is a smoother graph
that consists of the same number of points. Each point of the graph is replaced by the average
value of a range of neighboring points. The filter width parameter determines how many points
will be used to calculate the smoothed value. When filter width is set to n, each point is replaced
by the average of itself, its n predecessors, and its n successors (i.e., in Coach a central moving
average filter is used whose filter range is 2n+1 points). Filtering applied prior to taking the
derivative leads to a far less noisy graph of the derivative. But beware, this method does not
always provide enough smoothing to enable velocities and accelerations to be calculated and it
has a broadening effect on sharp features, especially if the number of points in the moving
average is large and the smoothing method is applied more than once. Although moving average
filtering is adequate for many purposes despite its simplicity, other data smoothing tools are
needed in many cases.
Example: The Filter width size determines the degree of filtering.
163
Original graph
Original graph
Filter width = 1
Filter width = 1
Filter width = 2
Filter width = 10
Bézier
With a Bezier approximation, a curve is created that at least contains the first and the last of the
original points. The shape of the calculated graph depends on the position of all the intermediate
points. It tends to the original graph, but it will generally not contain the original points. For a
Bézier approximation, the number of points in the graph must be less than 100 and greater than
2, and all values of the quantity along the horizontal axis must be in ascending order.
You can reduce the number of points in a graph by using the Select/Remove Data option or by
deleting rows from a Table. The number of points after the Bézier approximation can be as high
as 250000.
Example: The Bézier smoothing is forced through the
first and the last original point. The intermediate points
determine the degree of curvature of the graph.
Spline
The option Spline smoothes a curve by means of a natural quintic spline, i.e., by a piecewise
polynomial approximation of degree 5 that satisfies certain conditions of continuity, smoothness,
and boundary. There is a smoothing factor that controls the trade off between fitting the raw data
and minimizing the roughness of the approximation. A large value of the smoothing factor
(infinity in theory) will result in the best parabolic fit of the data. If you decrease the smoothing
factor, data smoothing becomes less important and the spline curve gets closer to the raw data. If
the smoothing factor is set to zero, the natural quintic spline interpolation through the data points
is obtained. The number of points after the Spline approximation can be as high as 250000
(minimal number of points is equal to 8).
The Spline approximation is a powerful tool to deal with noisy data and to enable good
derivative estimation.
Examples:
Smoothing factor = 0, the curve is a natural quintic
spline curve through all original points.
164
Smoothing factor = 0.05, the curve will not be forced
through all original points and a compromise between
data fitting and data smoothing is made.
Smoothing factor = Automatic, the best compromise
between data fitting and data smoothing via a built-in
method (in this example, smoothing factor = 5.154).
Smoothing factor = 10000, very large values of the
smoothing factor will lead to a parabola that fits the raw
data best.
In the Smooth dialog, the selected graph is blue and zoomed-to-fit. The other visible graphs (if
any) are gray; the smoothed graph is dark red. The following specific options are available:
Smooth technique
To select type of the data smoothing technique: Moving average (default), Bezier or Spline (see
descriptions below).
Quantity
The suggested quantity name for the smoothed graph (the unit stays the same and cannot be
changed). You can enter any new quantity name. However, quantity names which are used
already in the Diagram are not allowed.
Smoothing factor (Spline only)
When the radio button Automatic is checked then the smoothing factor that determines the best
compromise between data fitting and data smoothing is selected automatically via a built-in
method (generalized cross-validation criterion). The automatically chosen value is displayed (in
gray) in the disabled text field Factor.
If you want to set the smoothing factor yourself, check the radio button Factor and specify a
smoothing factor.
165
Filter width
(Moving average only)
Specify the number of points n
which should be used to calculate
the smoothed value (default n=1).
Start
Press Start to smooth the graph
with the specified settings and
evaluate the effect of the smoothing.
The smoothed graph appears in the
diagram in dark red. If necessary,
change parameter settings and press
Start again.
Add graph
The smoothed graph will be added
as a formula (in the first empty data
range) to the graphs in the diagram.
Figure 128. The Smooth dialog.
Replace graph
The smoothed graph will replace the original data in the diagram (in the same data range) with
original number of points.
New diagram
A new diagram will be created with the original data in data ranges C1 and C2 (C2 automatically
made Invisible), together with the smoothed graph in C3 (as a formula). After pressing OK, the
cursor changes shape (diagram) and the diagram can be placed by clicking in a pane. Or place it
later.
Replace data (Spline and Bezier only)
When the Replace data option is checked then after confirmation
you have to first set the number of points in the dialog.
Note: This option is not available for diagrams in the Data Video
Activity.
An example of several types of data smoothing
The graphs in the right diagram show the effect of
some smoothing techniques when applied to a small
data set.
166
To execute smoothing
• Select Process/Analyze > Smooth.
• Under Column select the graph of which you want to smooth.
• Select the smoothing method: Moving average, Bezier or Spline.
• Specify the smoothing parameters:
- For Moving average enter the desired Filter width.
- For Spline leave the Smoothing factor to Automatic or enter one by selecting Factor
and typing the desired value in the field.
• If desired, change the name of the Quantity.
• Click Start to show the smoothed graph. The result can be evaluated in the diagram. If you
are not satisfied with the result, change parameter settings and press Start again.
• Choose between Add graph, Replace graph, New diagram or Replace data.
Note: - For Spline and Bezier - when the option Replace Data is selected then the number of
points should be specified. For Moving average the number of points remains always the
same.
- When you choose to replace the graph, the original data will be lost unless you saved the
result prior to the smooth operation.
•
Click OK to confirm or Cancel to close the Smooth dialog without changes.
-
If filter width is set low, the filtered graph may be hardly visible (as it falls together with the
original graph), or not enough noise may be filtered out. If filter width is set too high, there is
a risk that significant details of the original data are filtered out (especially near maxima or
minima).
A better result may be obtained by filtering two (or three) times with Filter width = 2 than
one time with Filter width = 5. When filtering several times, do not forget to select the last
filtered graph under column.
Spikes (single points lying clearly outside the curve determined by the other points) can be
removed by changing/deleting the value in the table cell. It works best in combination with
Scan to pinpoint the spike in the diagram.
A smoothed graph can also be manually added to a diagram/table with the formulas
Filter(Column,Interval), Bezier(Column) and Spline(Column;Factor). In that case, the
smoothed graph consists of the same number of data points as the source graph. A negative
value indicates the automatic choice of the smoothing factor.
-
4. Derivative
Derivatives are a measure of the rate of change of a quantity. They are used much in science to
calculate among others the speed of processes. Use the option Derivative to produce the graph of
the first derivative or the second derivative of the original quantity. There are two methods
available to determine the graphs of the first and second derivatives numerically:
1. Difference method - using a difference of successive values from C2 divided by the difference
of the corresponding values in C1 (differential quotient). Especially when data sets are used
with few points (up to 20), e.g. from a manually- triggered measurement or a Data-Video
measurement, a boundary effect may become noticeable.
2. Smooth method - first a smoothing spline for the raw data is computed, followed by exact
differentiation of the spline function. This method gives in most cases the best results, but is
not set as default for two reasons: (i) it needs at least 7 data points and (ii) in case the
167
automatically chosen smoothing factor is not useful enough, a user has to fine-tune the
smoothing manually.
In the Derivative dialog, the
selected graph is blue and zoomedto-fit. The other visible graphs in
the Diagram (if any) are grey. The
graph of the derivative is dark red.
The following specific options are
available in this dialog:
Order
To select the derivative order.
Method
To select the method of calculating
the graph of the derivative.
Quantity & Unit
These fields suggest the quantity
and unit names of the derivative
graph. In case the derived quantity
or unit has another more usual
name, you can enter these. However,
quantity names that are already used
in the diagram are not allowed.
Figure 129. The Derivative dialog; the original pH(time) graph and
its derivative.
Start
Press Start to calculate the graph of the derivative with the specified settings. The graph of the
derivative appears in the diagram in dark red with its scale along the second horizontal axis.
Add graph
The graph of the derivative will be added as a formula (in the first empty data range) to the
graphs in the diagram. Both the original graph and its derivative are displayed.
New diagram
A new diagram will be created with the original data in data ranges C1 and C2 (C2 automatically
made invisible), together with the graph of the derivative in C3 (as a formula). After pressing
OK, the cursor changes shape (diagram) and the diagram can be placed by clicking in a pane. Or
place it later.
To calculate a derivative graph
• Select Process/Analyze > Derivative.
• Under Column select the graph of which you want to calculate the derivative.
• Select a derivative order.
• Select a method of calculating the graph of the derivative.
• When desired, edit the Quantity and Unit.
• Click Start to calculate the Derivative graph.
• Select either Add graph or New diagram.
• Click OK to confirm or Cancel to close the Derivative dialog without changes.
168
-
-
-
The derivative is added to the diagram as a formula, which will be evaluated in real time! So
on a next measurement run the original data will be measured and its derivative will be
calculated and displayed in real time. This is useful for measuring position-time, velocitytime (first derivative) and acceleration-time (second derivative) graphs while actually only
the position is measured.
A small (sudden) variation in the original graph can cause a wide variation in the derivative.
The minimum and/or maximum scale value of the y-axis may change drastically. Therefore
the graph of the derivative is placed along the second horizontal axis and both the original as
the derivative are displayed optimally because of the independent scales.
A graph of a derivative can also be manually added to a diagram/table with the formula
Derivative(Column) or DerivativeSmooth(Column,Factor). A difference quotient, which is
an approximation of the derivative, can be added manually as Deltafil(Column)/Delta(time).
A graph of a second derivative can also be manually added to a diagram/table with the
formula DerivativeSecond(Column) or DerivativeSecondSmooth(Column,Factor).
5. Integral
The option Integral is used to calculate the function (the primitive function) whose derivative is
equal to the displayed graph. Such an integral function can be determined but for a constant, the
constant of integration. The integral function is also called the 'primitive' or the 'anti-derivative'.
In the Integral dialog, the selected graph is blue and zoomed-to-fit. The other visible graphs in
the Diagram (if any) are grey. The Integral graph is dark red. The following options are available
in this window:
Initial value
An integral function is determined
but for a constant. The constant of
integration can be typed here. The
constant of integration is the value
assigned to the quantity along the
vertical axis for x=0.
Quantity & Unit
These fields suggest the quantity
and unit of the integral graph. In
case the derived quantity or unit has
another more usual name, you can
enter these. However, quantity
names that are already in use in the
diagram are not allowed.
Start
Press Start to calculate the graph of
Figure 130. The graph of the original function (left y-axis) and its
the integral function with the anti-derivative (right y-axis).
specified settings and evaluate the
quality of the integral. The graph of the integral function appears in the diagram in dark red with
its scale along the second horizontal axis. If necessary, change settings and press Start again
until a satisfactory result is obtained.
169
Add graph
The graph of the integral function will be added as a formula (in the first empty data range) to
the graphs in the diagram. Both the original graph and its integral are displayed.
New diagram
A new diagram will be created with the original data in data ranges C1 and C2 (C2 automatically
made 'Invisible'), together with the integral graph in C3 (as a formula). After pressing OK, the
cursor changes shape (diagram) and the diagram can be placed by clicking in a window. Or place
it later.
To calculate an integral graph
• Select Process/Analyze > Integral.
• Under Column select the graph of which you want to calculate the integral.
• When desired, change the name of the Quantity and/or Unit.
• Click Start to calculate the integral graph.
• Select either Add graph or New diagram.
• Click OK to confirm or Cancel to close the Integral dialog without changes.
-
-
The graph of the integral function is added to the diagram as a formula that will be evaluated
in real time. So on a next measurement run, the original data will be measured and its
integral function will be calculated and displayed in real time.
The scale range of the integral function may change drastically compared to the source
function. Therefore the graph of the integral function is placed along the second horizontal
axis and both the original as the derivative are displayed optimally because of the
independent scales.
The graph of the integral function can also be manually added to a diagram/table with the
formula Integral(Column).
6. Slope
Use the Slope option to manually
determine the slope of the tangent at
any point of a displayed graph.
In the Slope dialog, the selected
graph is blue and zoomed-to-fit. The
other visible graphs in the diagram
(if any) are grey. The cross hairs for
point selection and the tangent line
are dark red. At the bottom of the
dialog, help about the next action is
displayed. The following specific
options are available in this dialog:
Data fields
These fields display the co-ordinates
of the selected point.
Slope
The actual value of the slope of the
Figure 131. Determining a slope.
170
tangent drawn in the diagram. This field only appears after a point has been selected.
To determine a slope
• Select Process/Analyze > Slope to open the Slope dialog.
• Under Column select the graph in which you want to determine a slope.
• The diagram in the dialog is in scan mode. The co-ordinates of the scanned point, indicated
by the dark red cross-hairs, are displayed in the fields below the graph.
• Click the point in which you want to determine the slope. A line appears in the diagram.
• Press <Ctrl> and drag the mouse horizontally to rotate the line until it is positioned correctly
along the graph. The only way to determine the slope is by vision; Coach does not indicate
what slope is ‘correct’.
• Read the value of the slope in the Slope field.
• Click Close to return to the regular Coach screen.
• You can copy the value of the slope by selecting the slope value and using <Ctrl>+<C>. Or
by right clicking it you can copy the resulting diagram with the tangent line to the clipboard.
- To have a calculated value for the slopes in all points of the graph, add the derivative graph to
the diagram and scan this graph.
- If you want to determine the slope in another point of the graph, repeat the above procedure.
7. Area
Use the Area option to determine an area between a displayed graph, the horizontal axis and two
boundary lines.
In the Area dialog, the selected
graph is blue and zoomed-to-fit.
The other visible graphs in the
diagram (if any) are grey. The
selected area is dark red. At the
bottom line of the dialog, help about
the next action is displayed. The
following specific options are
available in this dialog:
Begin & End
These fields display the x-coordinates of the boundary lines. It is
possible to type values here. When
the original diagram was zoomed in,
the
values
are
pre-selected
corresponding to the boundaries of
the zoomed diagram.
Figure 132. Determining area under the graph.
Area
The actual value of the area enclosed between the boundary lines, the function and the x-axis in
the diagram. An area below the x-axis has a negative value.
To determine an area
• Select Process/Analyze > Area.
171
•
•
•
•
•
-
Under Column select the graph from which you want to determine an area.
The diagram shows two boundary lines between which the area is calculated. Drag the
boundary lines to the required position, or type the x-values for the boundary lines in the
Begin and End fields.
Read the area displayed in the Area field.
Click Close to return to the regular Coach screen.
You can copy the value of the slope by selecting the slope value and using <Ctrl>+<C>.
To obtain a calculated value for the areas in all points of the graph, add the Integral graph
(with the right constant of integration) to the diagram and scan this graph.
If you want to determine another area below the graph, repeat the above procedure.
8. Function fit
Function fit is a procedure to approximate the data on the screen
with a standard mathematical function. You can choose from a
number of function types (see the list).
The coefficients of the fit function are determined using a leastsquares method. Fitting can be done manually or automatically.
In the Function Fit dialog, the selected graph is blue and zoomedto-fit. The other visible graphs in the diagram (if any) are gray.
The fit function is dark red. At the bottom of the dialog box an
explanation is given about what action is possible. The following
options are available in this window:
Function Type
Select the standard function to
which the data should be fitted. This
choice requires some knowledge
about the phenomenon, which
yielded the data.
Figure 133. The list of functions
available for Function fit.
Coefficients
These fields indicate the value of the
coefficients (a, b, c and d) used in
the fit function. Depending on the
function type there are one to three
coefficients.
Fix
By checking a box next to a
coefficient the coefficient will be
“locked” and will be not changed
during calculations.
Estimate
Figure 134. The Function Fit dialog.
This button gives automatic
suggestion for initial parameter values of the fit function. In some cases it already gives the
optimal fit, e.g., in case of linear regression.
172
Refine fit
Use this button to improve the suggested fit (via the Levenberg-Marquardt method) and find the
best fit based on the current initial parameter values.
Add graph
The fit function will be added as a formula in the first empty data range to the graph(s) in the
Diagram.
Replace graph
The fit function (as a formula) will replace the original data in the diagram (in the same data
range).
Fit quality
This number indicates the standard deviation of the fitted function from the original data; the
lower the deviation, the better the quality.
To determine a function fit
• Select Process/Analyze > Function Fit.
• Under Column select the graph that you want to fit.
• Select the Function type that will be used.
• There are two methods for the function fit which complement each other, manually and
automatic. Both methods are described below.
• You can interrupt the automatic fit process with <Esc>. Keep it pressed until the fit process
stops. This may take a short while.
• Select Add graph or Replace graph. When you choose to replace the graph, the original
data will be lost unless you saved the result prior to the fit procedure.
• Click OK to confirm, or Cancel to close the Function-Fit dialog without changes.
Note: When starting function fit from a zoomed diagram, Coach will only use the visible part of the data
for its fit.
Manual function fit
The manual function fit allows finding the coefficients of a fit function by translating and
stretching it. This can be started any time during the fit process. It is used for example when the
graph consists of a repeating pattern of exponential functions (you can try to fit the exponential
fit function to one of the exponential parts of the graph), or to help an automatic fit get
initialized. To obtain a reasonable result with manual function fit, it is often necessary to go a
few times through a cycle of steps.
On the fit function, one point is marked with a pin, which can be moved along the fit function by
dragging it. The pin can be opened or closed (by clicking on it). When the pin is opened, the fit
function can be shifted; when the pin is closed the fit function can be shaped.
• Select a point on the original graph by shifting the opened pin along the fit-function. If you
can not find a suitable point continue with the next step.
• Shift the fit function itself by dragging with the mouse somewhere on the line (mouse cursor
is a hand).
• Click the pin to 'close' it, i.e. to fix the fit curve at the pinpoint.
• Shape the fit-function by dragging a point of the curve towards the pin or away from the pin.
Dragging past the pin reverses some parameter values of the fit-function.
• Repeat the above steps until a satisfying result is obtained. Check if the coefficients have
real values. If this is not the case, type other values.
173
•
•
•
When desired, press the Refine button to finalize the fit process.
Select Add graph or Replace graph.
Click OK to confirm, or Cancel to close the Function Fit dialog without changes.
Note: Using the fit-function type f(x)=a*x, the pin stays fixed in the origin. In fact, this function can only
be rotated.
Automatic function fit
• Click the Estimate button. Coach automatically finds the best initial parameter values of the
fit function. In some cases this is already the optimal fit.
• Click the Refine button. Coach automatically improves the suggested fit and to find the best
function fit. The Refine button can be used after using the Estimate button or during the
manual fit process.
9. Signal Analysis
Signal Analysis can display the frequency spectrum of the original graph. The graph is assumed
to present a periodic signal of the form yt = γ + ∑ ρ j sin (ω j t + φ j ) . The peaks in the frequency
j
spectrum correspond with the frequency components ω j (actually, we write ω j = 2π f j and call
f j the frequency in the spectra). Once the frequency components of a periodic signal have been
found, the other parameters (amplitude ρ j and phase φ j ) can be estimated by linear regression
methods.
You can choose between four methods: Fourier Transform, Linear Prediction, R-ESPRIT,
and Prony. These four methods differ fundamentally.
Fourier transform is a nonparametric method, in which the estimate of the power spectral density
(PSD) is made directly from the signal itself. In this case, the periodogram is used as an estimate
of the PSD. Linear Prediction is a parametric method in which the signal whose PSD we want to
estimate is assumed to be output of a linear system driven by white noise.
Linear Prediction is an example of an autoregressive (AR) method in which we first estimate the
parameters (coefficients) of the linear system that hypothetically “generates” the signal. These
parameters are then used to generate an artificial spectrum, called the pseudospectrum.
R-ESPRIT and Prony are also parametric methods. R-ESPRIT is an example of a subspace
method, also known as a high-resolution method. It generates frequency component estimates
for a signal based on an analysis of eigenvalues and eigenvectors of the autocorrelation matrix of
the signal. Prony is a parametric method based on the autoregressive - moving average (ARMA)
model of the signal and generates frequency component estimates for a signal based on a direct
estimation of the parameters in this model. An analysis of eigenvalues and eigenvectors of a
matrix plays again an important role here. In R-ESPRIT and Prony, the pseudospectrum is
generated after estimation of the parameters in the model of the signal. Peaks in the
pseudospectrum correspond with frequencies components in the signal.
The strengths of the four signal analysis methods complement each other.
Fourier Transform
With the Fourier Transform (FT), a periodic signal is decomposed into frequency components.
The basic assumption of the Fourier Transform is that any oscillation can be represented as a
superposition of sinusoidal components. The spectrum is a graph of the amplitudes (intensity) of
the sinusoidal components against their frequency.
174
The Fast Fourier Transform (FFT) is a numerical method that has been developed to rapidly
calculate the components of the spectrum. This method requires a set of 2N data points and the
number of points in the spectrum is half the number of original sample points. This may be a
major limitation in some cases: e.g. when precise determination of frequencies is required from a
small number of data points.
Advantages of FT
• Faster than other methods like LP or RESPRIT, especially when the oscillation
consists of pure tones;
• Very good at determining intensities in
the spectrum;
• Asymptotically efficient, i.e., as sample
size goes to infinity the Cramér-Rao
bound is approached)
Weaknesses of FT
• Very poor frequency resolution when few
data points are available.
• Increased data size improves resolution,
but it does not improve performance
regarding the variance of the frequency
estimator.
• The noise-to-signal ratio must be small in
order to get good estimates.
Linear Prediction
Linear Prediction (LP) is a spectral analysis method that adequately describes spectra of data that
is “peaky”, i.e., data whose PSD is large at certain frequencies. The data of sound vibrations of
the human voice tends to have “peaky spectra” so that the Linear Prediction method is often
useful. The method is based on the principle that each data point of an oscillation can be
predicted from a function of previously measured points. The value of a measured point is
approximated by the value of a function. More precisely, it is assumed that the signal y j can be
modeled as y j = µ j + ε j , where the ε j are random observation errors and the µ j satisfy the
recurrence relation µ k + ξ m −1µ k −1 + L + ξ1µ k − m +1 + ξ 0 µ k − m = 0 . The coefficients ξ j are estimated by
minimizing the sum of squared errors ε j . These coefficients are used to generate an estimate of
the power spectral density, which is known as the autoregressive power spectrum:
PAR ( f ) =
δ ⋅σ 2
m −1
2
,
e 2π i mδ f + ∑ ξ j e 2π i j δ f
j =0
where δ is the sample interval of the equidistant data and σ 2 is the variance of the prediction
errors. A logarithmic scaling is optional. Peaks in this power spectrum correspond with
frequencies. The accuracy of the approximation depends upon the number of coefficients (m)
and the accuracy with which these are determined.
Compared to the Fourier Transform, Linear Prediction always produces a convoluting curve (a
function of frequency) of the characteristic frequency areas of the spectrum (in speech analysis
called the Formants). This results in a greater frequency resolution when few data points are
available.
The user is able to choose the accuracy of the calculation by specifying the number of
coefficients in the calculation (m). This number, also referred to as the model order, determines
the maximum number of characteristic peaks that is searched for: the number of peaks will be at
most half the number of assigned coefficients (sometimes including peaks at the borders,
sometimes peaks hidden by others). Naturally, increased accuracy comes at the expense of
higher execution time. The physical relevance of the resulting spectrum peaks has to be assessed
critically. Various criteria for automatic choice of the model order in Linear Prediction exist.
175
Advantages of LP
• Good frequency resolution, even if there
are few data points;
• Best model order can be automatically
estimated via Akaike’s Final Prediction
Error Criterion.
• By using lower quality for the
coefficients, the envelope of the spectrum
(i.e. formants) can be gained. This is
useful
for
determining
resonant
frequencies for example.
Weaknesses of LP
• The more accurate the frequencies are
determined, the less accurate are the
intensities;
• Poor settings may lead to a spectrum
which lacks important details;
• Accuracy is lower for high-order models,
long data records, and large noise-tosignal ratio (causing line-splitting or
extraneous peaks in the spectrum);
• Peak locations may slightly depend on
initial phase of a noisy sinusoidal signal;
• Slower than FT;
• Often fails for small sample intervals or
large noise-to-signal ratios (can only
improved by increasing the order of the
model).
R-ESPRIT
Subspace methods are best suited for line spectra, i.e., spectra of sinusoidal signals, and are
effective in the detection of sinusoids buried in noise when the noise-to-signal ratios are high.
Many of these methods are based on an ARMA model of the signal and the eigenanalysis of the
autocorrelation matrix of the signal. The methods are called subspace methods because the
autocorrelation matrix of the signal depends on a subspace that is the direct sum of the noise
subspace and the signal subspace.
The R-ESPRIT method is a state-of-the-art subspace method that depends on two parameters.
The number of frequencies determines the order of the sinusoidal model of the signal. The
second parameter in the R-ESPRIT method, the snapshot dimension, is linked to the construction
of the autocorrelation matrix of the signal. To form the autocorrelation matrix of the signal, the
data set is broken into small overlapping fragments or snapshots of fixed length using a sliding
window technique known as spatial smoothing. The snapshot dimension must be larger than or
equal to the number of frequencies and it must be less than or equal to the number of data points
divided by two. There exists no simple criterion for an automatic choice of the best snapshot
dimension. In Coach, we do the spectral analysis for all values less than 100 and select the best
snapshot dimension in this range. Higher snapshot dimensions can only be set manually in the
program.
The pseudospectrum for the R-ESPRIT method is defined such that it leads to a graph in which
peaks correspond with frequencies found:
PR-ESPRIT ( f ) =
σ2
∏ (e π
2 ifδ
−e
2π i f j δ
j
)( e
2π i f δ
−e
− 2π i f j δ
)
2
,
where the f j are the estimated frequencies, δ is the sample interval of the equidistant data and
σ 2 is the variance of the prediction errors. A logarithmic scaling is optional. Due to the definition
of the artificial spectrum, you could be confronted occasionally with a numerical error of
division by zero. These errors are caught in the software and the point in the pseudospectrum is
skipped. Note that heights of peaks in a pseudospectrum have no meaning at all with regards to
176
amplitudes of corresponding frequencies in the signal. Peaks only indicate locations of
frequencies found.
Advantages of R-Esprit
• Excellent resolution
(R-ESPRIT outperforms other methods);
• Works in general also good with small
snapshot dimensions;
• Allows large noise-to-signal ratios
provided that the sample size is large
enough to get good results;
• Less sensitive to noise-to-signal ratio in
case of close frequencies than other
methods (this is way it is also called a
super-resolution method).
Weaknesses of R-Esprit
• One must determine the order of the
model; no criterion implemented;
• No criterion for selection of snapshot
dimension and occasionally high values
are needed for good performance;
• Computationally less efficient than FT
for large data sets or large snapshot
dimensions;
• Increased data size improves resolution,
but it does not improve performance
regarding the variance of the frequency
estimator.
• Biased frequencies estimates may occur
depending on the estimation of the
autocorrelation matrix.
Prony
In the Prony method we assume again a periodic signal of the form yt = γ + ∑ ρ j sin (ω j t + φ j )
j
and an ARMA model of the signal. It is in fact an ARMA(m,m) model because it is assumed that
the signal y j can be modeled as y j = µ j + ε j , where the ε j are random observation errors and
the µ j satisfy the recurrence relation
µk + ξ m −1µk −1 + L + ξ1µk − m+1 + ξ 0 µk − m = ε k + ξ m−1ε k −1 + L + ξ1ε k − m+1 + ξ 0ε k − m .
The parameter m , the model order, is twice the number of frequencies that we want to estimate.
Once the coefficients ξ j haven been estimated, the corresponding frequencies, multiplied by the
sample interval, can then be found as the phase components of the complex roots of the
polynomial z m + ξ m −1 z m −1 + L + ξ1 z + ξ 0 . The coefficients ξ j are used to generate an estimate of
the power spectral density, which is known as the pseudospectrum. The formula for the pseudospectrum is taken similar to the formula of the autoregressive power spectrum of the Linear
Prediction method.
In Prony, the coefficients ξ j are directly estimated by an algorithm described in Smyth (2000).
The algorithm implemented is actually the symmetry-adapted, modified Osborne-BreslowMacovski algorithm. Symmetry-adaptation means that the constraints ξ j = ξ m − j for i = 0,K , m
are applied in the implemented algorithm, which improves the frequency estimation.
It is possible for the Prony algorithm to return fewer frequencies than requested. In this case the
data set is not well fitted by a sum of the specified number of sinusoids. The algorithm works
extremely well on data sets of moderate size. The algorithm uses differences of data values, and
therefore will be numerically unstable if the number of data points is large and the observation
are sampled very densely relative to the frequencies. If the model order is chosen large, then
numerical problems (“singularities encountered”) may arise due to lack of decimal precision.
177
Coach computes by default with extended floats, which means a decimal precision of about 19
decimals. This numerical precision cannot be increased.
Advantages of Prony
• Resolution as good as AR methods,
sometimes better;
• The only parameter needed is the model
order, i.e. the number of frequencies;
• Allows incorporation of zero frequency
to deal with a constant shift of the data;
• Symmetry adaptation improves frequency estimation
• Asymptotically efficient, i.e., as sample
size goes to infinity the Cramér-Rao
bound is approached.
Weaknesses of Prony
• One must determine the order of the
model; no criterion implemented;
• Fewer frequencies than asked for when
the model in ill-chosen;
• Computationally less efficient than FT
for large data sets or large number of
frequencies;
• Requires the computation of complex
roots of a polynomial;
• High decimal precision is often needed
in case of large model orders to avoid
numerical problems.
When to use FT, LP, R-ESPRIT or Prony?
The main differences in using FT, LP, R-ESPRIT, and Prony concern the settings. LP and Prony
uses the number of frequencies as a parameter, whereas R-ESPRIT offers in addition to this the
choice of the snapshot dimension.
LP allows you to choose the number of coefficients (related to the number of frequencies in the
AR model) and thereby the accuracy of the spectrum: the choice to see the general outline of the
spectrum (few coefficients), or fine detail (many coefficients), the amount of which increases
with the number of coefficients. Unfortunately the details can become too fine to be displayed,
and so the limitation of LP is that there is a risk that the most important details are missed.
Unless you already know what the spectrum will look like, it is sensible to use FT for a first
calculation (to see where the main frequency components are located) and then use LP to find
the precise frequencies. Above the strengths and weaknesses of the two methods are
summarized.
R-ESPRIT allows you to specify the number of frequencies and the snap shot dimension. The
algorithm automatically applies zero-mean correction to ensure that the method is actually
applied to data with zero mean; otherwise, too often a zero frequency would be found to take
care of the mean value. For each parameter setting, pressing the start button results in a pseudospectrum and a display of the sum of squared errors. You can play with parameter values to
improve the performance, i.e., to lower the sum of squared errors. In some case, a small change
in the snap shot dimension has a large effect on the result obtained. The Coach implementation
of the R-ESPRIT method offers automatic selection of the best snapshot dimension less than
100. The R-ESPRIT method also allows you to add the graph of the approximation found by the
spectral analysis method to the diagram in which the signal analysis was originally requested. In
this way it can be used to approximate functions by a sinusoidal expression.
In the Prony method you only have to specify the number of frequencies to define the ARMA
model used. For each parameter setting, pressing the start button results in a pseudospectrum and
a display of the sum of squared errors. You can play with parameter values to improve the
performance, i.e., to lower the sum of squared errors. The Prony method also allows you to add
the graph of the approximation found by the spectral analysis method to the diagram in which
the signal analysis was originally requested. In this way it can be used to approximate functions
by a sinusoidal expression. The algorithm automatically takes care of the determination of the
178
constant term in the sinusoidal approximation of the signal. If zero-mean correction is not good
enough to deal with the constant term in a sinusoidal approximation, then the Prony method is
preferred.
The Signal Analysis dialog is empty
until you press the Start button.
Then the spectrum is drawn in dark
red. The following specific options
are available in this dialog:
Function Type
To select a method of signal
analysis: Fourier transform, Linear
Prediction, R-ESPRIT or Prony.
Scale
Choose between a logarithmic or a
linear y-axis scale. A linear scale
gives a good overview of the size of
different signals compared to each
other (not available for the RESPRIT and Prony methods). A
logarithmic scale, however, gives
Figure 135. The Signal Analysis dialog.
more information about how the
sound signal will be perceived by
the human ear, as the human sense of hearing has a logarithmic character.
Coefficients (LP only)
The number of coefficients determines the maximum number of peaks (formants) which will be
found by LP.
Number of frequencies (R-ESPRIT and Prony only)
The number of frequencies determines the ARMA model used in the spectral analysis and the
maximum number of peaks in the pseudospectrum.
Snapshot dimension (R-ESPRIT only)
The snapshot dimension determines the autocorrelation matrix that is used in the R-ESPRIT
method to estimate frequencies. The snapshot dimension can be determined automatically when
the Automatic option is checked (at least the best value less than 100), or entered manually
when the Value option is checked.
Start
Press Start to calculate the spectrum with the specified settings.
New diagram
A new diagram of the spectrum will be created.
To determine a frequency spectrum
• Select Process/Analyze > Signal Analysis.
• In the Function type field select the method: Fourier transform, Linear prediction, RESPRIT or Prony.
179
•
•
•
Select Linear or Logarithmic for the intensity scale along the y-axis. For a linear scale, the
highest intensity has the value 1. For a logarithmic scale, 0 dB corresponds to 1 mV.
Specify signal parameters:
- Linear Prediction: enter the number of coefficients. This number determines the
maximum number of peaks (formants) which will be found in the spectrum.
- R-ESPRIT: enter the number of frequencies and the snapshot dimension. This number
determines the model used in the analysis and the maximum number of peaks in the
spectrum. The snapshot dimension can be determined automatically when the Automatic
option is checked, or entered manually when the option Value is checked.
- Prony: only enter the number of frequencies.
Click Start to display the frequency spectrum of the graph.
Click OK and click in a pane to place the graph or click Cancel to close the Signal Analysis
dialog without changes.
- If the signal contains frequency components, which are higher than half the sample frequency,
then these samples can affect the displayed spectrum considerably.
- For a successful use of FT or LP, we recommend to choose a measuring time of less than 200
ms.
- When applying LP to human voice signals it is not recommended to set the number of
coefficients higher than 14, because the expected number of characteristic formants is at most
6.
- The spectrum of FT and LP are normalized, i.e. the area below the graph is always set to a
fixed number (presumably 1). If the original signal data does not have an average value of 0,
then there is a so-called d.c. (direct current) frequency component. This component may take
so much of the fixed area of the total spectrum that a lot of detail in the remainder of the
spectrum may be lost. First create a shifted set of original data (by subtracting/adding a
suitable number via a formula). Shift until the average value of the data is zero (the average
value of a data set can be calculated via the option Statistics in a Table). Then the d.c.
component will be zero as well, and all the 'energy' in the spectrum will be available for the
frequency components. This process of shifting the data set to one that has zero mean value is
called 'zero mean correction'. In R-ESPRIT this is automatically applied.
- When analyzing musical tones (from instruments, or sung), the first frequency component in
the spectrum is called the 'fundamental'. The higher frequency components (which are exact
multiples of the fundamental frequency in pure tones), are called the 'harmonics'. Amongst
others, the mixture and intensity ratio of the harmonics determine the timbre of the tone.
- Coupling between time units and frequency units. (s Æ Hz; ms Æ kHz) If time scale is
minutes or hours, then the frequency unit will be Hz.
- When the sample size is small only use R-ESPRIT or Prony and add the approximation to the
original diagram from which signal analysis was invoked to check the quality of the spectral
estimation.
- Experiment with the snapshot dimension in the R-ESPRIT method to see if you can improve
the quality of the spectral estimation in case you are not quite pleased or want to obtain a
better result. Try to minimize the sum of squared errors before you add the graph. Note that if
the frequency estimates do not change much, the approximation well not change much either.
- If you need more data for improvement of spectral analysis, you are advised not to sample at a
higher frequency, but to measure for a longer time interval (if you can, of course). This
reduces the variance of the frequency estimates.
180
- If a signal is composed of more than 8 frequency components, you can subtract the computed
approximation of the signal in the R-ESPRIT and Prony method from the original signal and
continue the spectral analysis with this difference.
Notes:
-
It is possible that very sharp peaks in the source function are not displayed on the screen.
-
When the number of coefficients in LP is set very high, the spectrum approaches the Fourier
spectrum.
-
It is possible that the R-ESPRIT method leads to a numerical error message (connected with the
definition of the artificial spectrum). Ignore such a message and choose another snapshot dimension
to work with.
Examples
Speech Analysis
A typical example is vowel analysis. The picture shows a screen shot of the analysis of the vowel
‘u’. In the upper-right diagram the recorded signal is shown (2 seconds of the sound signal has
been recorded with a sample interval of 0.2 milliseconds, which gives 1000 data points). The
lower-right graph shows the Fourier spectrum. The lower-left graph is the autoregressive power
spectrum with an automatically selected order of the model. The upper-left corner shows the
result of the R-ESPRIT method with the number of requested frequencies equal to 7 and
snapshot dimension equal to 15, i.e., small in comparison to the number of data points. The
spectra are in good agreement with each other.
Figure 136. Speech analysis of the vowel ‘u’.
181
However, the approximation obtained in the R-ESPRIT is not so good. Apparently either the
snapshot dimension is too small or the noise-to-signal ratio is too large to get good results. You
also have to keep in mind that speaking a vowel for 2 seconds in the same way is hardly
possible: frequency changes are expected during this time frame. Also, when looking at the
formula of the approximation found, only 2 frequencies seem to be important.
Figure 137. Speech analysis of the vowel ‘u’ in a short period.
The R-ESPRIT can be used to investigate a smaller time frame with less data points (about 600).
Figure 66 shows the result of R-ESPRIT applied to a short part of the speech data with 3
frequencies and snapshot dimension 20.
The resulted formula of the approximation is: -0.0041 + 0.1204*Sin(1173.9856*time-1.8507) +
0.0556*Sin(2343.7714*time+2.3538) + 0.0072*Sin(10584.2287*time+1.6137).
This formula shows again that the frequencies 187 and 373 Hz are dominant in the signal.
Sound beats
In the picture below the left graph shows the data points of a recorded sound signal consisting of
two close frequencies. This effect is known as ‘sound beats’. In the same figure is also displayed
the graph of the approximation found by the R-ESPRIT method. The pseudospectrum is shown
on the right. The frequencies found are 383 and 440 Hz, which is in excellent agreement with the
tuning forks used in the sound experiment. The graph of the approximation is most convincing
evidence of the quality of the spectral analysis.
Figure 138. Spectral analysis of sound beats.
182
Tidal analysis
In figure 68 the left graph shows the 144 data points of recorded seawater levels at Europahaven.
This tidal effect is known as ‘agger’. In the diagram is also displayed the graph of the
approximation found by the R-ESPRIT method. The pseudospectrum is shown on the right (8
frequencies, snapshot dimension 47). Excellent agreement between data and approximation.
Figure 139. Tidal analysis using R-ESPRIT.
Sound of a baroque flute
In the picture below sound spectra of a baroque flute played using fingering for a G5 tone are
displayed. The data of size 1037 comes from a recorded sound that was downloaded from the
Internet address http://www.phys.unsw.edu.au/music/flute/baroque/sounds/G5.baroque.wav. The
spectra look very different but describe the same signal.
Figure 140. Spectral analysis of the G5 tone of a baroque flute.
183
The Fourier spectrum in the upper-left diagram suggest that 3 tones are dominant in the signal.
Its general shape is shown by the pseudospectrum of the Linear Predication method (upper-right
diagram) The R-ESPRIT and Prony pseudospectra in the lower-left and lower-right diagram,
respectively, are obtained with the number of frequencies equal to 6 (6 peaks shown in these
pseudospectra). The fact that the peaks are located differently may seem strange, but when you
look at the corresponding approximations it becomes clear that some of these peaks arise just
from estimating the noise in the signal. The approximations of the signal are:
R-ESPRIT:
0.000950375993645+
0.142364881106792*Sin(4.684964984276387*time+1.631829457034705)+
0.000741950764807*Sin(6.816405970486143*time-1.882265712166016)+
0.001342623382862*Sin(8.203052162525841*time+0.855226898297875)+
0.004543353769201*Sin(9.392981241137852*time+2.742486454957161)
0.004778126735585*Sin(14.055293931000303*time+2.458716144908273)+
0.00006490406218*Sin(27.373026938160163*time-0.188538044487191)
Prony:
0.000674312376915+
0.1423517063384*Sin(4.685139323718463*time+1.580242714955776)+
0.004508949172267*Sin(9.396625148037559*time+1.663419768875514)+
0.004798045971447*Sin(14.058057329868088*time+1.637447826091147)+
0.001056361766906*Sin(18.655292902267395*time-2.757672172060451)+
0.001465464506869*Sin(28.112477553193499*time-2.903383608737326)+
0.000711685026711*Sin(32.785959865234925*time-1.097957015554868)
Figure below shows a zoomed part of the graphs of the signal and the approximation. Data and
approximations are excellent agreement.
Figure 141. R-ESPRIT and Prony fits of the G5 tone.
184
Let us take a close look at the R-ESPRIT result. Frequencies and amplitudes are listed below.
The harmonic numbers are given as well.
frequencies (Hz): 745.635 1084.865 1305.556 1494.039 2236.970 4356.553
amplitudes:
0.142365 0.000741 0.001343 0.004543 0.004778 0.000065
harmonic number: 1
2
3
Let us take a close look at the Prony result. Frequencies and amplitudes are listed below. The
harmonic numbers are given as well.
frequencies (Hz): 745.663 1495.519 2237.409 2969.082 4472.240 5218.052
amplitudes:
0.142335 0.004509 0.004780 0.001056 0.001465 0.000712
harmonic number: 1
2
3
4
6
7
It is clear from these results that 3 harmonics describe the signal quite well. The value of 746 Hz
for the fundamental frequency agrees with the literature value for G5 in baroque tuning.
Gait analysis
In the picture below a screen shot of a video activity is given. In this activity the angle of the
knee and hip joint are measured for a girl running 10 km/hr. These angles are approximated by a
model of a sum of three sinusoids via the Prony method. The two spectra on the right show that
the gait frequencies are harmonic and the same for hip and knee joint (1.358, 2.717, 4.069 Hz).
The amplitudes and phases are different and this explains the different shapes of the
approximations in the lower –left diagram.
Figure 142. Spectral analysis of hip and knee joint movement of a running girl.
185
10. Statistics
The option Statistics displays statistical
information about the diagram/table as a whole
or about a selection of data in the table. For each
data range (in the selection), the following items
are shown:
Number:
Number of rows
Max:
Maximum value
Min:
Minimum value
Average:
Average value
Sum:
Sum of the values
Sum sqr:
Sum of squared values
s(n):
Standard deviation based on n values
s(n-1):
Standard deviation based on n-1 values
Figure 143. The Statistics window.
To display statistics
• Select Process/Analyze > Statistics.
When only a single cell is selected in a table, information for the whole table is displayed.
Drag a selection in a table (e.g. a whole column, a number of rows) to get statistical
information about the selection and then select: Process/Analyze > Statistics.
• In the Statistics window:
- Press Print to print the Statistics window.
- Press Copy to copy the statistical information to the Clipboard for use in a Text pane or
other Windows application (e.g. MS-Word, useful for reports).
11. Histogram
The histogram option is used to
create the histogram bar diagram.
The range of the variable (column)
is divided into equal size bins for
which the frequency of occurrence
is calculated. The height of the
diagram bar is equal to the
frequency of occurrence within the
bin.
In the Histogram dialog, the red bar
diagram is displayed. The following
specific options are available in this
window:
Lower & Upper boundaries
To specify the boundary values. The
initially displayed boundaries are
computed from the data. It is
possible to type values here.
Figure 144. The Histogram dialog.
186
Number of bins
To define number of bins (default 5).
Start
Press Start to create the histogram with the specified settings.
New diagram
A new diagram will be created with the original data in data ranges C1 and C2 (C2 automatically
made 'Invisible'), together with the histogram graph in C3 (as a formula). After pressing OK, the
cursor changes shape (diagram) and the diagram can be placed by clicking in a window. Or place
it later.
To determine an histogram
• Select Process/Analyze > Histogram.
• Under Column select the column for which you want to create the histogram.
• Specify the Lower and Upper boundary values.
• Type the number of bins (default 5).
• Click Start to show the histogram graph. The result can be evaluated in the diagram. If you
are not satisfied with the result, change parameter settings and press Start again.
• Click OK to create a new diagram, or Cancel to close the Histogram dialog without
changes.
-
The histogram is added to the diagram as a formula which will be evaluated in real time! So
on a next measurement run, the original data will be measured and its histogram function will
be calculated and displayed in real time!
The histogram can also be manually added to a diagram/table with the formula
Histogram(C;numberOfBins;lowerBoundary;upperBoundary)
References about spectral analysis
1. Barrodale, I., and Erickson, R.E. (1980). Algorithms for least-squares linear prediction and
maximum entropy spectral analysis. Geophysics 45, 420-446.
2. Kay, S.M., and Marple, S.L. (1980) Spectrum Analysis – A Modern Perspective.
Proceedings of the IEEE 69 (11), 1380-1419.
3. Mackisack, M.S., Osborne, M.R., and Smyth, G.K. (1994), A modified Prony algorithm for
estimating sinusoidal frequencies. Journal of Statistical Computations and Simulation 49,
111-124.
4. Mahata, K. (2003). Estimation Using Low Rank Real Signal Models. Acta Universitatis
Upsaliensis. Uppsala Dissertations from the Faculty of Science and Technology 48. Uppsala,
Sweden.
5. Marple, S.L. (1987) Digital Spectral Analysis with Applications. Prentice-Hall: New Jersey.
6. Smyth, G.K. (2000) Applying symmetry constraints fro improved frequency estimation by
eigenanalysis methods. Technometrics 42, 277-289.
187
188
IX. Coach Language
Table of Contents
1. INTRODUCTION INTO COACH LANGUAGE ........................................................................................................... 190
2. NAMES AND NUMBERS ....................................................................................................................................... 190
2.1 Names ......................................................................................................................................................... 190
2.2. Numbers..................................................................................................................................................... 190
2.3. Reserved words and characters................................................................................................................. 191
3. EXPRESSIONS ..................................................................................................................................................... 192
3.1. Simple expressions..................................................................................................................................... 192
3.2. Expressions with operators ....................................................................................................................... 192
3.3 Syntax of expressions.................................................................................................................................. 194
4. STATEMENTS ...................................................................................................................................................... 195
4.1. Simple statements ...................................................................................................................................... 196
4.2. Structural statements ................................................................................................................................. 196
5. STANDARD FUNCTIONS AND PROCEDURES OF COACH LANGUAGE .................................................................... 198
5.1. Standard mathematical functions .............................................................................................................. 198
5.2. Special mathematical functions ................................................................................................................. 199
6. ERROR MESSAGES IN COACH LANGUAGE ........................................................................................................... 200
6.1. Error messages during interpretation ....................................................................................................... 204
6.2. Error messages while executing a model .................................................................................................. 205
189
1. Introduction into Coach Language
Coach Language is an easy programming language which is used in:
• formulas, to do calculations on data in tables;
• models, to find a numerical solution of differential equations.
• programs to control devices or processes.
A formula consists of a variable (C1 .. C8, or the corresponding quantity names) to which a single
expression is assigned.
A model19 or a program consists of one or more statements which are composed of words, numbers
and symbols. he statements must meet certain criteria to be understood by Coach. The Coach
Language interpreter checks whether expressions and statements are correct. If not, an error
message appears on the screen. The formula or model must always be corrected before it can be
executed.
For models which are created in Graphical and Equations Modeling modes Coach automatically
generates the correct program in Coach Language. Advanced users, who want to write text models
directly in Coach Language, need to know the rules of Coach Language, its syntax - the order the
words in expressions and statements should appear and semantics - the words’ meanings. This
section gives describes these rules.
Unlike more complex programming languages, it is not possible to define Arrays and Character
variables (‘Chars’) in Coach Language, to enter values by means of the keyboard, or handle files
while running a Program. On the other hand, using Expressions, and Standard Procedures and
Functions offered by Coach Language you have direct control over the 'in', 'out' and 'counter' ports
of the interfaces.
2. Names and numbers
When writing a formula or model you must use names to indicate constants or variables. You have
a lot of freedom in giving suitable names.
2.1 Names
When composing names you are allowed to use characters from the following sets:
• { A B C .. Z } capital letters;
• { a b c .. z }
lower case letters;
• 1 2 3 .. 0 }
numbers;
• { £ _ & ~ ! | { } [ ] } symbols;
The Coach interpreter is case sensitive and distinguishes between capital letters and lower case
letters. For example PopulationGROWTH and populationgrowth are recognized as different words.
When composing names certain characters and words are reserved to Coach and may not be used
(see 2.3). For these words Coach is not case sensitive.
Note: This is a new feature in Coach 6. A side effect is that if a user has mixed uppercase and
lowercase in different ways in Coach 5 formulas/models, these may not work any longer upon
opening them in Coach 6. First correct the spelling regarding case, then the formula/ model will
work again correctly.
2.2. Numbers
When composing numbers you can use characters from the set: {0 1 2 3 4 5 6 7 8 9 + - . e E }
19
Program lines visible in modeling Text mode
190
The maximum number of significant figures is eleven. The smallest accepted positive number is
1.0e-36, the largest positive number 1.0e+36. An error message appears when these limits are
exceeded.
You may use the letter e or E to denote powers of 10, (scientific notation) e.g. :
0.5e-3 = 0.5E-3 = 0.0005 = 0.5 ∗ 10^3.
Notes:
-
Decimal figures are created depending on the regional settings of the decimal separator of Windows.
-
A number may not begin with a decimal separator.
2.3. Reserved words and characters
Reserved characters
Some characters have a special meaning. You are not allowed to use them in names of constants,
variables, procedures or functions.
These characters are listed in the table below.
• ASCII codes:
0 .. 31
• Symbols for arithmetic operators: ( ) - + ∗ / ÷ ^ = < >
• Spaces and the symbols: ' . , % " : ; $ # @
It is not allowed to choose a number as the first character of a name.
By placing a name between square brackets the above restrictions do not apply. The first character
of the name will be "[" and the last character "]", e.g. [2πr] is allowed as a variable name.
Reserved words
Some words have a special meaning. You are not allowed to use them as names of constants,
variables, procedures or functions. These words are listed below.
Abs
And
ArcCos
ArcSin
ArcTan
Becomes
Bit
ClearData
Column
Cos
Count
Counter
Delta
Do
Domain
Derivative
DerivativeSmooth
DerivativeSecond
DerivativeSecondSmooth
Else
EndDo
EndFunction
EndIf
EndRedo
EndProcedure
Entier
Exp
Fac
Filter
Function
If
Interval
Level
Ln
Log
Max
Min
Not
On
Off
Once
Pi
Print
Procedure
Pulse
Rand
Redo
Repeat
191
RepeatedPulse
Reset
ResetAbsolute
ResetCounters
Round
RunningTime
SaveData
Set
SetLevel
SetAbsolute
Sign
Sin
Sound
Sqr
Sqrt
Stop
Stopwatch
Tan
Then
Until
Wait
Latched
Unlatched
While
The reserved words On, Off and Pi are the names of constants. The values of these constants are
255, 0 and 3.141592654 respectively. You cannot alter the value of these constants.
3. Expressions
An expression is any combination of variables, operators, constants and functions which
generates a single value. There are two groups of expressions.
3.1 Simple expressions
A simple expression is:
• a single number such as 6.13 or 105
• a single constant (Pi, On, Off)
• a variable (x, time)
• a call to a mathematical function or to a standard Coach Language function. The result of a
function is always a value.
Variables
A variable name can be considered as a label for a numerical value.
Assigning the value of an arithmetical expression to a variable name means that the value is stored
in a memory position of the computer under the label, e.g. "Total := 5 + 6" means that the value
"11" is stored under the label "Total". The prescriptions of names and numbers hold for the name
giving of variables.
Logical variables
The result of a logical expression is also a value and stored in memory. The label is called a logical
variable (or Boolean variable).
If the result of a logical expression is On (True/High), the memory position is filled with the value
255. If the result is Off (False/Low), it is filled with the value 0. The preference of the names On
and Off in Coach Language has to do with the control facilities available in the full version of the
Coach 6 Program.
Notes:
-
In formulas, quantity names or column names (C1 to C8) are used as a variable.
-
Variables in a model are usually global, meaning that they are available in functions and procedures as
well as in the rest of the program.
3.2. Expressions with Operators
An expression with operators consists of values and operators. An operator acts on one or more
values. An operator is a prescription by which values are converted into other values.
There are three different types of operators: Arithmetical operators, Logical operators and
Relational operators. In expressions with more than one operator, the priority of each operator
determines the order of execution. For example: in the expression 3 ∗ (V+1), the operator "∗"
works on the values "3" and "(V+1)".
Expressions with operators can be used to define conditions in statements. An expression can be
used as a condition when the result is one of the Boolean values True or False (Logical 1
respectively Logical 0).
For True, Coach Language uses the term On. (On corresponds to the value 255).
For False, Coach Language uses the term Off. (Off corresponds to the value 0).
192
Examples of conditional expressions:
Temperature > 15
Brightness <> (l+1)/l
(Brightness > 20) AND (Color <> Red)
Coach Language: Arithmetic operators
Operator
^
∗
/
+
-
Description
Reverse sign
Raise to the power
Multiply
Divide
Add
Subtract
Priority
1
1
2
2
3
3
When operators in an expression have equal priority, the expression is evaluated from left to
right. The priority of an operation in a expression can always be overruled by using parentheses.
Coach Language: Logical operators
Logical operators (or Boolean operators) act on logical values, for example on the result of
relational operators. In Coach Language, there are three Logical operators:
Operator
NOT
AND
OR
Description
Negation of Logical value
Logical AND
Logical OR
Priority
1
2
3
Truth tables for the Logical operators
NOT
S1
On
Off
NOT S1
Off
On
AND
S1
On
On
Off
Off
S2
On
Off
On
Off
S1
On
On
Off
Off
S2
On
Off
On
Off
S1 AND S2
On
Off
Off
Off
OR
S1 OR S2
On
On
On
Off
Note: S1 and S2 in this table stand for statements like for instance ‘A>B’ or ‘Number<1’.
193
Coach Language: Relational operators
Relational operators always act on two values. These values are compared with each other. The
result is a Boolean (one of the logical constants On (True) or Off (False). All relational operators
have equal priority. Complex relational expressions can be composed using Logical operators. In
such cases the relational expressions must always be placed between parentheses.
Operator
=
<>
<
>
<=
>=
Equation
equals
not equal
less than
greater than
less or equal
greater or equal
Priority
4
4
4
4
4
4
When operators in an expression have equal priority, the expression is evaluated from left to
right. The priority of an operation in an expression can always be overruled by using
parentheses.
Examples of expressions with operators:
(x>1) AND (x<2)
For example if x=1.3 then the condition has the value True (On). If x=4 then the condition has
the value False (Off).
NOT (Temperature >100)
The condition has the value True (On) if the temperature is smaller or equal to 100, and False
(Off) in all other cases.
(y<-1) OR (y>1)
The condition has the value True (On) if e.g. y = 2, and False (Off) if e.g. y = 0.2.
(z>1) AND (z<2) OR (z>5) AND (z<6)
The condition has the value True (On) if z has a value between 1 and 2 or between 5 and 6, and
False (Off) in all other cases.
3.3. Syntax of expressions
Use of Spaces and <Enter>
In a logical expression spaces must be placed to separate the logical operator from the value(s). In
arithmetic or relational expressions the use of spaces is optional. It is not necessary to write an
expression on just one line. It may for clarity be desirable to spread an expression with more than
one function over a few lines.
Expressions have to be separated from each other by spaces or by <Enter>. In the first case two or
more expressions can be placed on one line. When using <Enter> to separate expressions each
expression is placed on a new line.
Use of brackets
Brackets in an expression are required if you wish to alter the priority of an operation. Brackets may
be used to increase the clarity of expressions.
194
Expressions with operators
If an operator acts on a single value, then the value must be placed behind the operator. If an
operator acts on two values, then the operator must be placed between the values. Operators with
priority one are performed first, then operators with priority two, etc.
Example: Interpretation of expressions in Coach Language
Expressions with Arithmetic operators
Interpretation
A∗B^C
A^-B∗C
A^-B-C
A/B-C
A+B∗C
A-B∗-C
a3∗x^3 + a2∗x^2 + a1∗x + a0
A∗ (B^C)
(A^(-B))∗C
(A^(-B))-C
(A/B)-C
A+(B∗C)
A-(B∗ (-C))
(a3∗x^3)+(a2∗x^2)+(a1∗x)+a0
Expressions with Logical operators
Interpretation
NOT Dry+1
On OR NOT(Available)
Dry AND Wind OR Sun
Sun OR Dry AND Wind
(NOT(Dry))+1
On OR (NOT(Available))
(Dry AND Wind) OR Sun
Sun OR (Dry AND Wind)
Expressions with Relational operators
Interpretation
X<Z/(Z-1)
X>=1+Y
X∗2<=Y+5
(A<=B) AND NOT(C>B)
X<(Z/(Z-1))
X>=(1+Y)
(X∗2)<=(Y+5)
(A<=B) AND (NOT(C>B))
When comparing a logical variable with a numerical variable, keep in mind the On and Off
correspond with the numerical values 255 and 0. However, a Boolean variable automatically gets
the logical value On if its numerical value is not equal to 0.
You may prefer to work with the names True and False instead of the names On and Off. This is
only allowed if you define the following assignments:
True := On
False := Off
4. Statements
A statement can be executed independently. Here, we distinguish between simple and structured
statements.
195
4.1. Simple statements
Assignment
With an assignment the value of a variable is replaced by the result of an expression. The symbol
for the assignment operator is := (colon equals). In Coach Language you can also use the symbol =
or the word becomes. It is not necessary to separate the operator with spaces: variable := expression
Examples:
X := Y + Z
Wet becomes (rain) AND (NOT(umbrella))
Procedure calls
Procedures are used to organize a program. A procedure consists of one or more statements and
carries a name. The result of a procedure is the execution of the defined statements.
The statements are executed at the position where the call to the procedure name is placed in the
Program. In Coach there are several types of procedures possible:
• Standard Coach Language procedures.
• Pre-defined procedures by the Author of the Activity (Micro-world).
• Own commands - procedures created by the Student users.
4.2. Structural statements
A structural statement is a statement which has a prescribed structure. There are two types of these
statements:
• Conditional statement
• Loop statements
Conditional statements
This statement conditionally executes a group of statements, depending on the value of an
conditional expression. The conditional expression must generate a Boolean value: True (On) or
False (Off).
If .. Then
If the condition is True (On), then statements between Then and EndIf are executed.
Syntax:
If Conditional expression Then Statements EndIf
If .. Then .. Else
If the condition is True (On), then the statements between Then and Else are executed.
If the condition is False (Off), then the statements between Else and EndIf are executed.
Syntax:
If Conditional expression Then Statements Else Statements EndIf
Once.. Do .. EndDo
If the condition is True (On), then the statements between Do and EndDo are executed.
Syntax:
Once Conditional expression Do Statements EndDo
196
Examples of conditional statements in Coach Language
If (a<2) AND (b>5) Then
If x>0 Then
a:=a + 1
y:= sqrt(X)
b:=b – 5
EndIf
Else
a:=a –1
b:=b+3
EndIf
Once x>0 Do
v:= -0.9*v
EndDo
Loop statements
In a loop statement, a number of statements are executed a certain number of times.
Repeat .. Until
Repeat .. Until repeats the statements between Repeat and Until as long the condition is False
(Off).The statements will at least be executed once.
Syntax:
Repeat Statements Until Conditional expression
Examples
Repeat
Set(1)
Reset(1)
Until RunningTime > 125
Repeat
If x>1 Then
Set(2)
Else
Reset(2)
EndIf
Until x>2
Redo .. EndRedo
Redo .. EndRedo repeats the statements between Redo and EndRedo a fixed number of times
(determined by the parameter ‘Number’). The statements will be executed at least once.
Syntax
Redo Number Statements EndRedo
Examples
Redo 10
Wait(0,5)
Set(1)
Wait(0,5)
Reset(1)
EndRedo
Redo 1000
If x>1 Then
Set(2)
Else
Reset(2)
EndIf
EndRedo
While ... Do ... EndDo
While .. Do .. EndDo repeats the statements between Do and EndDo as long as a condition
behind While is True (On). If the condition is False (Off) at the start, no execution will follow.
197
Syntax:
While Conditional expression Do Statements EndDo
Examples
While t>1 Do
Set(1)
Reset(1)
EndDo
While r<> 3 Do
If x>1 Then
Set(2)
Else
Reset(2)
EndIf
EndDo
5. Standard functions and procedures of Coach Language
5.1. Standard mathematical functions
The maximal value of x is 10^35 (if applicable)
Sqr(x)
Sqrt(x)
Ln(x)
Log(x)
Exp(x)
Sin(x)
Cos(x)
Tan(x)
Arcsin(x)
Arccos(x)
Arctan(x)
Square of x
Square root of x
Natural logarithm (base e)
Briggs logarithm (base 10)
e-power of x (ex)
Sine of x
Cosine of x
Tangent of x
Inverse sine function (radians)
Inverse cosine function (radians)
Inverse tangent function (radians)
Entier(x)
Abs(x)
Rand
Rounds a number down
The absolute value of x
Generates a random number in the interval [0,1]
Sign(x)
Fac(x)
Round(x)
Generates -1 for x < 0; +1 for x > 0; 0 for x = 0
Generates (round(x))! (factorial)
Rounds off a number
UnitStep (x,b)
Generates 0 for x < b and 1 for x ≥ b
Pulse(x;b;l;h)
Generates a pulse of variable x which starts at a
begin value b, has duration l and height h.
RepeatedPulse(x;b;l;i;h)
Generates pulses of variable x with repeated
interval i. The first pulse starts at a begin value b,
has a duration l and a height h.
20
In radians or in degrees, this depends on settings done in Activity Options.
198
x in [-max, 81)
x20
x1
x1
x in [-1;1]
x in [-1;1]
x in [0;+33.5)
5.2. Special mathematical functions
Special mathematical functions use more than one cell to calculate a new value. These functions
are used in the advanced formula editor for calculations in diagrams and tables.
Min(x1;x2;..xi )
Selects the smallest of i parameters
Max(x1;x2;.. xi)
Selects the largest of i parameters
Domain(b;e)
Fills all cells of the column with equally distributed values
over the interval [b,e] (b: begin value, e: end value)
according to the formula:
cell(index) = b + [(e - b) * (index - 1)]/(n – 1), where n is the
number of rows.
Delta(C)
Difference between two successive values in the source
column C. Cell(n) in the calculated column is filled with the
value of the expression Cell(n) – Cell(n-1). The first cell in
the target column remains undefined.
Sum(C)
Cell(n) contains the sum of all values in source column C
which have an index smaller or equal to n.
Derivative(C)
Numerical differentiation of the values in column C.
DerivativeSmooth(C,n)
Smooth derivative, first a spline with the smoothing factor n
is computed, then numerical differentiation of the spline
function
DerivativeSecond(C)
Numerical second order differentiation of the values in
column C.
DerivativeSecondSmooth(C;n)
Smooth second derivative, first a spline with the smoothing
factor n is computed, then the second numerical
differentiation of the spline function
Integral(C;r)
Numerical integration of values in column C, r is the
constant of Integration (initial value)
Spline(C;n)
Spline approximation based on the values in the column for
the X-axis and column C. The factor n stands for smoothing
factor.
Bezier(C)
Bezier approximation based on the values in the column for
the X-axis and column C.
Histogram(C;n,l,u)
It returns a column with in the i-th cell the number of values
in column C that are larger or equal then
l+(i-1)*(u– l)/n and are smaller than l+i*(u-l)/n
n – number of bins, l – lower boundary, u – upper boundary.
Deltafil(C)
Combination of Delta(C) and Filter(C;n). Only useful if
sample points have an equidistant distribution in time. For n
the fixed value of 10 is used.
Filter(C;n)
Filtering of values in source column C with interval n. Each
cell is replaced by the average value of the cell itself, its n
predecessors and n successors (i.e. the average over 2n+1
points).
199
5.3. Standard functions
Bit
The function Bit(n) returns On (True) if the digital input (n) is "High", and Off (False) if it is
"Low”. The numerical values On and Off correspond with 255 respectively 0.
Examples:
In an assignment:
In a conditional statement:
or shorter:
State = Bit(1)
If Bit(2) = On Then …
If Bit(2) Then …
Counter and ResetCounters
The standard function Counter(n) returns the number of pulses that has been detected on
Counter input (n). All counters are reset to 0 with the standard procedure ResetCounters.
Counters cannot be set individually to 0, so ResetCounters has no parameters.
Examples:
In an assignment:
In a conditional statement:
State = Counter(1)
If Counter(2) < 100 Then …
Interval
The standard function Interval returns the time (in seconds), which has lapsed after the
execution of the standard procedure Stopwatch(On), and returns 0 after the execution of
Stopwatch(Off).
Example:
Stopwatch(On)
Repeat
…
Until Interval > 10
Level
The standard function Level(n) returns the value of the sensor which has been connected to
analog input (n). If the sensor is calibrated, the value will be expressed in the calibrated unit.
Examples:
In an assignment:
In a conditional statement:
Brightness = Level(1)
If Level(2) < 0,5 Then …
Latched
The standard function Latched(n) returns On (True), if the digital input (n) has been "High"
after the last call of Latched(n), otherwise it returns Off (False). The numerical values of On and
Off correspond with 255 respectively 0. Latched is the complement of the standard function
Unlatched
Examples:
In an assignment:
In a conditional statement:
State = Latched(1)
If Latched(2) = On Then …
200
or shorter:
If Latched(2) Then …RunningTime
Unlatched
The standard function Unlatched(n) returns On (True) if the digital input (n) has been "Low"
after the last call of Unlatched(n), otherwise it returns Off (False). The numerical values of On
and Off correspond with 255 respectively 0. Unlatched is the complement of the standard
function Latched.
Examples:
In an assignment:
In a conditional statement:
or shorter:
State = Unlatched(1)
If Unlatched(2) = On Then …
… If Unlatched(2) Then
RunningTime
The standard function RunningTime returns the time (in seconds) which has lapsed since the
start of the program.
Examples:
Repeat
…
Until RunningTime > 100
While RunningTime < 100 Do
…
EndDo
5.4. Standard procedures
Count
The standard procedure Count(n;p) counts pulses via the counter input n. The program waits
until the number of pulses (p) is reached. The maximal value of (p) is 65535. By pressing any
key (except <Esc>), the program is forced to continue with the next statement even though the
specified number of pulses has not yet been reached (this prevents the program from halting).
<Esc> is reserved to interrupt program execution.
The use of the standard procedure Count is analogous to the use of the standard procedure Wait.
Count counts pulses, Wait ‘counts’ time SaveData.
ClearData
The procedure ClearData erases all data (in all diagrams and tables) in the current Coach
Activity. ClearData is the complement of the standard procedure SaveData.
Set
The standard procedure Set(i, j,..) sets the digital outputs i, j, .. to 'High'. The list of parameters
can be as long as the number of outputs of the interface. Set is the complement of the standard
procedure Reset.
Examples:
For an interface with four digital outputs is Set(1;2;3;4) allowed.
201
If no parameters are mentioned, Set sets all digital outputs to ‘High’. So, with four outputs the
command Set does the same as Set (1;2;3;4).
SetLevel
This procedure only works with CoachLab II/II+ and the LEGO DACTA interfaces. The standard
procedure SetLevel(i,p) sets the power level of the digital output i to p.
• When used with CoachLab II/II+, i should be a number between 1 and 4, where 1
corresponds to output A, 2 to output B etc, and p should be a number between 1 and 16,
where 1 corresponds to the lowest power and 16 to the highest power level.
• When used with the LEGO DACTA Interface B, i should be a number between 1 and 8,
where 1 corresponds to output A, 2 to output B, … , 8 to output H, and p should be a number
between 1 and 8, where 1 corresponds to the lowest power and 8 to the highest power level.
• When used with the LEGO DACTA RCX, i should be a number between 1 and 3 where 1
corresponds to output A, 2 to output B and 3 to output C, and p should be a number between
1 and 8, where 1 corresponds to the lowest power and 8 to the highest power level.
The highest power obtained with the SetLevel command is limited automatically by the setting
of the power slider range. Higher values for p than the maximum value specified above do not
lead to an error message, they also invoke the maximum allowed power for the actuator.
Reset
The standard procedure Reset(i, j, ..) sets the digital outputs i, j, .. to 'Low' and leaves the state of
the other outputs as they are. The list of parameters can be as long as the number of outputs of
the interface. Reset is the complement of the Standard Procedure Set.
Examples:
For an interface with for example four digital outputs Reset(1;2;3;4) is allowed. If no parameters
are mentioned, Reset sets all digital outputs to ‘Low’. So, with four outputs the command Reset
does the same as Reset(1;2;3;4).
SetAbsolute
The standard procedure SetAbsolute(i, j, ..) sets the digital outputs i, j, .. to 'High' and all others
to ‘Low’. The list of parameters can be as long as the number of outputs of the interface.
SetAbsolute is the complement of the Standard Procedure ResetAbsolute.
Examples:
For an interface with for example four digital outputsSetAbsolute(1;2;3;4) is allowed. If no
parameters are mentioned, SetAbsolute sets all digital outputs to ‘High’. So, with four outputs
the command SetAbsolute does the same as SetAbsolute(1;2;3;4).
ResetAbsolute
The standard procedure ResetAbsolute(i, j, ..) sets the digital outputs i, j, .. to 'Low' and all
others to ‘High’. The list of parameters can be as long as the number of outputs of the interface.
ResetAbsolute is the complement of the standard procedure SetAbsolute
Examples:
202
For an interface with for example four digital outputs ResetAbsolute(1;2;3;4) is allowed.
If no parameters are mentioned, ResetAbsolute sets all digital outputs to ‘Low’. So, with four
outputs the command ResetAbsolute does the same as ResetAbsolute(1;2;3;4).
Sound
The standard procedure Sound(f;t) produces a sound with a frequency of f Hertz during t
seconds. The standard procedure Stop halts the execution of the program at the position of this
procedure.
Stop
Standard procedure Stop halts the execution of the program at the position of this procedure.
Stopwatch
The standard procedure StopWatch(B) starts a time measurement (in seconds) if the Boolean
variable B has the value On (True). The elapsed time after start of the time measurement, is
recorded by the Standard Function Interval. Interval returns the value 0 immediately after the
execution of StopWatch(On). The function Interval remains 0 after the execution of
Stopwatch(Off).
Example:
Stopwatch(On)
Repeat
…
Until Interval > 10
SaveData
The standard procedure SaveData stores the values of variables which are present in diagrams or
tables. On each pass, the values of the variables will be written once. If SaveData is not used or
erroneously used, empty or wrong diagrams and tables will result. SaveData is the complement
of the standard procedure ClearData.
Example:
Measure during half an hour and only store the values if the temperature is higher than 20°C:
Correct solution
As long as the temperature is below 20 ºC, no values are
written to the diagram. (SaveData is located inside the If
statement which tests the temperature).
Repeat
If Temperature > 20 Then
Wait(1)
SaveData
EndIf
Until RunningTime>1800
Incorrect solution
Values are also written in the diagram when the
temperature is below 20 ºC. (SaveData is located outside
the If statement which tests the temperature).
Repeat
If Temperature > 20 Then
Wait(1)
Endif
SaveData
Until RunningTime>1800
203
Use SaveData exclusively if the type of Activity in the Activity options is set to Control with a
Program. In other Activity types, data from program variables are saved automatically.
Wait
The standard procedure Wait(t) pauses program execution for t seconds. <Esc> interrupts
Program execution. By pressing any key (except <Esc>), the program is forced to continue with
the next statement even though the specified time has not yet been lapsed. <Esc> is reserved to
interrupt program execution.
The use of the standard procedure Wait is analogous to the use of the standard procedure Count.
Wait pauses a time interval, while Count pauses until a specified number of pulses has been
detected.
6. Error messages in Coach Language
Two kinds of errors may occur:
• Syntax errors which are detected during the compilation of the model preceding the
execution or preceding the selection of variables along the graph axes.
• Execution errors which are only detected while programs are executed.
6.1. Error messages during interpretation
If during interpretation an error is detected an error message pops up. The cursor flashes behind
the position in the text model where the error has been detected. The error may be corrected
immediately.
Error message
Cause
”Character not expected”
A character is placed where it is not expected to be.
”Number not correct”
The compiler fails to read a number.
”This name is already in use”
Appears when two variables, functions or procedures have
identical names.
”Type conflict”
Occurs when a value has been assigned to the name of a
procedure, or when the function result has been assigned
outside the function definition.
"... expected”
The compiler expects a name or a symbol.
"... NOT expected”
The compiler does not expect the symbol entered. Often the
cause is not immediately clear.
”Too many variables”
The available memory for names of variables has been used.
Solution: choose shorter names.
”Function result not assigned”
The function definition has not been closed with the
assignment: function_name := function_result
204
Example of a model with a syntax error
t := t + dt
If t > 13 Then
a := F/m
Else
a := F/(2 ∗ m)
v := v + a ∗ dt
x := x + v ∗ dt
The cursor does not always flash at the exact position where
the error occurs. In the incorrect model displayed at the left,
the conclusion ('EndIf') of the 'If'-statement fails to appear.
The compiler does not detect this syntax error until the last
assignment.
The error message "EndIf expected" appears and the cursor
is placed behind the last character and not behind the
assignment a := F/(2 ∗ m).
Examples of syntax errors and corresponding error messages
Text model
a:1
a1
a := / 1
a := 1e=12
If a>0 Then
a:=1e12
Repeat a:=1e12
Redo a := 1e12
Redo a 1e12
Function a(x;y)
EndFunction
Function a(x;y)
z=x∗y
EndFunction
Function a(x;y)
a=x∗y
EndFunction
Procedure a(e)
w = sqrt(e)
EndProcedure
Function a(x;y)
a=x∗y
EndFunction
a = 12
Procedure a(x;y)
z = x+y
EndProcedure
s = a(1;2)
a(1;2;3)
a(1)
Procedure b
b = 12
EndProcedure
Error message
”Character not expected”
"Assignment" expected
"/" not expected
”Number is not correct”
"EndIf expected”
"Until expected”
"Assignment not expected”
"Number not expected”
"EndFunction not expected”
”Function result not assigned”
”This name is already in use”
”Type conflict”
”Type conflict”
”")" expected”
”";" expected”
”"=" not expected”
205
6.2. Error messages while executing a model
When a Program or Model has been developed, there is no guarantee that errors will not occur
during the execution. If such an error occurs, the Program/Model is halted and a message appears
on the screen. Possible execution errors and corresponding causes:
Error message
Cause
”Division by zero”
A variable in the denominator of a fraction has become 0.
A number becomes too large or too small.
“Number out of range” or
“Value not in the domain”
The argument of a standard function receives a value which is not
allowed.
Example: A program, which returns error messages when executed.
Program
a := 100 w := 100
Redo 100
a := a - 1
y := 12/a
y := ln(a)
w := w∗w
EndRedo
Error messages
“Division by 0 (in the last loop (when a=0))”
“Value not in the domain (in the last loop (when a=0))”
“Number out of range (in the 6th loop)”
206
FOR AUTHORS
X. Authoring Environment
Table of Contents
1. USER LEVELS..................................................................................................................................................... 208
1.1. Author mode ............................................................................................................................................. 208
1.2. Senior student ........................................................................................................................................... 209
1.3. Junior student ........................................................................................................................................... 209
2. COACH PROJECTS .............................................................................................................................................. 209
2.1. Creating and editing Coach project ......................................................................................................... 210
2.2. The location of Coach projects................................................................................................................. 211
3. COACH ACTIVITIES ........................................................................................................................................... 212
3.1. Activity types............................................................................................................................................. 212
3.2. Creating Activity....................................................................................................................................... 213
3.3. Defining Activity options .......................................................................................................................... 213
3.4. Filling an Activity ..................................................................................................................................... 216
3.5. Saving an Activity ..................................................................................................................................... 216
3.6. Coach files ................................................................................................................................................ 216
4. AUTHOR TOOLS ................................................................................................................................................. 217
4.1. Preferences ............................................................................................................................................... 217
4.2. Switching the language of the Coach user interface ................................................................................ 217
4.3. The sensor/actuator editor........................................................................................................................ 217
4.4. The Library filter ...................................................................................................................................... 218
4.5. Install path................................................................................................................................................ 218
4.6. Deactivate hardware ................................................................................................................................ 219
4.7. Starting Coach via command line............................................................................................................. 219
5. CREATING AND EDITING SENSORS AND ACTUATORS .......................................................................................... 219
6. CREATING CUSTOMIZED PROGRAMMING ENVIRONMENT ................................................................................... 221
6.1. Creating new functions and procedures ................................................................................................... 221
6.2. Creating programming buttons ................................................................................................................ 223
6.3. Modifying the command list...................................................................................................................... 224
6.4. Advanced programming ........................................................................................................................... 229
207
1. User levels
Coach is an authoring environment and allows teachers or other curriculum developers (in Coach
called Authors) develop and manage Coach Activities for student users.
Coach 6 has three user levels:
• Author,
• Senior student, and
• Junior student.
The user level is selected on starting Coach or it can be specified in the Coach project file. The
default student-user level is stored in the options of each Activity.
1.1. Author mode
In Author mode, Coach Activities can be created, edited and managed. This includes among
others the possibility to specify the type of Activity, the student-user level for the Activity,
providing content for the Activity (including diagrams, tables, meters, pictures, texts, pictures,
videos, web links etc.) and the way it is presented (lay-out) to the students. Regarding
management of these materials, Authors can create shortcuts to projects for student users.
When starting Coach, by default the user level specified in the Activity will be used.
To start Author mode
• Press the Login button in the Main toolbar.
• Select Author in the user level drop-down list.
• Type in the correct Author key to enter Author mode.
• The default Author key is ‘0000’.
To change Author key settings
• In the Main menu, select Tools > Author Key Settings.
The Author Key Settings dialog appears.
• First, type in the current Author key.
• Mark the option Change Author
key.
• Type in the new Author key, and type
it once more in the Confirm new
Author key field.
• Click OK.
Note: Beware that without Author key, the
Author mode is no longer protected and
any user of Coach can switch to Author
mode and make changes to the Coach
settings.
Figure 145. The Login dialog.
Figure 146. The Author Key Settings dialog.
To disable the Author key
The Author key can be disabled, i.e. upon logging in as Author there will be no request for the
Author key.
• Select Tools > Author Key Settings.
• Enter the current Author key.
208
•
Unmark the option Enable Author key and click OK.
1.2. Senior student
The Senior student can use all end-user functions of Coach. This includes all measurement
settings, selection and calibration of sensors, creating control programs by typing, adding
information (student texts, pictures, videoclips, web pages) to their Result, specifying Data
Video settings, capturing video, creating models, and full data analysis and processing.
A Senior student cannot edit texts and cannot remove elements which were added by the Author
of the Activity.
To prepare an Activity for Senior student mode
• Set the default user mode in the Activity options to Senior.
When a student starts such Activity via double clicking, or when the student opens the Activity
in Coach when logged in as Activity user level then the Activity will run in the Senior student
mode.
To force any Activity to run in Senior student mode
• Press the Login button in the Main toolbar.
• Select Senior student in the user level drop-down list.
All Activities will open in Senior student mode, regardless of its default activity level specified
in the Activity options.
1.3. Junior student
In this User mode it is possible to close down functions in Coach in three stages: Closed, Open
and Own Lab.
In Closed mode: the Activity screen cannot be changed by the students. Each Activity is one
single experiment. So Authors should provide all required elements on the screen. There are no
yellow buttons, nor a Settings button.
In Flexible mode: students have a little more freedom. They can change the duration of
measurements and they can change pane elements via the yellow buttons. Only those yellow
buttons show for which Authors have added items are available. They can switch sensors or
actuators prepared for them on the sensor or actuator palette. They can display a diagram, table,
meter or value of connected sensors. They can edit their own columns in diagrams and tables.
In Own-Lab mode students have more freedom: they can do simple calibrations and have all
yellow buttons available.
To prepare an Activity for a Junior student mode
• Set the default user mode in the Activity options to the required Junior Student level.
When a student starts such Activity via double clicking, or when the student opens such Activity
in Coach when logged in as Activity user level then the Activity will run in the Junior mode.
2. Coach projects
A Coach project is a folder enriched with the Coach project file (cmaproject.cms) which contains
a project description, a project title picture and project settings (i.e. information about how
Coach should start when it is started via the project file). Coach project folders can be recognized
209
easily, as the icon of a Coach project folder has a red ‘C’ in the yellow folder, which also shows
in Windows Explorer.21
2.1. Creating and editing Coach project
Authors can create a new project, edit the current project, convert any ordinary Windows folder
to a Coach project or restore the current Coach project back to an ordinary folder. The Create
Project dialog is available through the option File > Coach Project in the Main menu and
Activity menu or by clicking the Coach Project… button
in the Open/Save File dialog
(available only in Author mode).
To create/edit a Coach project
• Select the File > Coach
Project > Create…/Edit…
option in the Main or Activity
menu. Or:
• In the File Open dialog press
the Coach Project… button
and select New Coach
Project/Edit Current Coach
Project.
• Enter at least a Title of the
project.
• Optionally press Browse… to
select a title picture which will
Figure 147. The Create Project dialog.
be displayed in the background
of the Coach window when opening the project.
• Optionally write a summary about the content of the project. This summary is visible in the
File dialogs for all users of Coach.
• Press OK. The Coach project will be created and opened (i.e. it immediately becomes the
current folder).
To convert an ordinary folder into a Coach project
This option is available only if the current folder is an ordinary folder.
• Select the option File > Coach Project > Convert… in the Main or Activity menu. Or:
• In the File Open/Save dialog press the Coach Project… button and select the option
Convert this Folder to a Coach Project.
The Coach project will be converted to an ordinary Windows folder.
To edit project settings
This option is available only if the current folder is a Coach project folder. When Coach is
started via double-clicking a Coach project, the options in the project settings file overrule the
settings of Coach itself.
• In the Create/Edit Project dialog click the tab Settings.
• The default folder for results is ‘My Documents’. If desired, press Browse… to select
another folder (e.g. a folder on the student area of the school network).
21
On certain network drives, this special folder icon may not work.
210
•
Select the user level. The
choices are:
- Default activity user level each Activity is run with the
level specified in the
Activity itself.
- Senior
student - all
Activities run as Senior
student. The level specified
in the Activity is ignored.
- Author - run Coach in
Author mode. This is merely
meant for developers of
Figure 148. Editing project settings.
lesson materials. Note that
Coach asks to enter the Author key when started via such project. It is possible to disable
the Author key via Tools > Author Key Settings.
To create a desktop shortcut
Via
a
shortcut
to
the
cmaproject.cms file, Coach can be
started with the options provided by
the project settings of that file.
• In the Create/Edit Project
dialog click the tab Shortcut.
• Enter a name for the shortcut
(optional). If no name is
entered, the shortcut gets the
name of the project.
• Press the button Create
Shortcut to create the shortcut
on the desktop.
• If necessary move or copy this
shortcut to the folder where
your students should click it.
Figure 149. Creating a shortcut to a Coach project.
To restore a Coach project to an ordinary folder
This option is available only if the current folder is a Coach project.
• Select the option File > Coach Project > Restore to Ordinary Folder in the Main or
Activity menu. Or:
• In the File Open/Save dialog press the Coach Project… button. Select the option Restore
Current project to Ordinary Folder.
The Coach customization of the current folder will be removed. The folder will be restored to an
ordinary Windows folder and its icon will change back to the normal Windows folder icon.
2.2. The location of Coach projects
Coach 6 projects (or shortcuts to projects) can be stored at any location (also inside other
projects) but there are two special locations for Coach projects:
211
1. the CMA projects folder (default: C:\Program Files\CMA\coach6\Full.EN\CMA Coach
Projects) with the content delivered by CMA; and
2. the School projects folder, which is selected during the installation of Coach 6 for content
developed by the school. This location is optional. This is a folder where preferably teachers
of the school have writing rights.
The CMA and School projects locations appear in the top part of the favorites list for quick
access by all users.
3. Coach Activities
An Activity is the place where student users do their work in Coach. An Activity can be
modified by Authors, never by student users.
3.1. Activity types
There are 4 types of Activities available in Coach Measurement, Control, Modeling and Data
Video.
3.1.1. Measurement Activity
Measurement Activities are designed for data acquisition. Measurements are taken according to
the given measurement settings. Data can be collected with sensors or manually (by typing).
Specify this type of Activity by setting Measurement as a type of Activity in the Activity
options. For manual measurements, where data is only typed in or being imported, the No panel
option should be selected under Currently selected panel. For measurements with sensors (if
desired, combined by manual measurements) an interface panel should be selected from the
drop-down list. The selected panel is the default panel for the Activity. By defining alternative
panels the same Activity can be used for different interface panels.
The option Off-line is active for dataloggers which are able to work off-line e.g. CMA ULAB.
By marking this option two extra buttons appear in the Activity toolbar: the Send settings button
for sending experiment settings to a datalogger and the Get Data button for retrieving the
measurement results from a datalogger. A datalogger is not necessarily connected to the
computer during off-line measurements.
The option With a program should be marked for Activities in which only data from sensors
and/or actuators have to be stored in diagrams/tables while a program is used to control. Program
variables can not be displayed in diagrams/tables. The duration of the control process is
determined by the program, while the sensor/actuator signals are evaluated according to the
sampling frequency. The advantage of this setting is that the signals are evaluated independent of
the program speed. The green Start button is available to start a measurement run and program
execution.
3.1.2. Control Activity
Control Activities are designed for creating and executing control programs. Specify this type of
Activity by setting Control as a type of Activity in the Activity options.
Such control programs can determine the way measurements are being taken or are used to do
calculations on measured signals. Program variables can be displayed in diagrams/tables.
However, the values are stored in memory (and appear in the diagrams/tables) only when the
standard procedure SaveData is used in the program. Disadvantage of this setting is that the
sensitivity to signal changes depends strongly on the execution speed of the program (and hence
on the processor speed of the computer).
212
The option Off-line is active for interfaces which are able to work off-line control, e.g. the
LEGO Dacta RCX. By marking this option two extra buttons appear in the Activity toolbar: the
Send settings button for downloading control programs to an interface and the Get Data button
for retrieving the measurement results from an interface.
By default, the option With a program is marked. When this option is unmarked then the
resulting Activity can be used for manual control of actuators connected to an interface.
Note: If sensor signals change rapidly, you can better use the setting Measurement with a Program. In
that case, however, program variables cannot be displayed in diagrams or tables.
3.1.3. Modeling Activity
Modeling Activities are designed for creating and executing dynamical Models. Specify this type
of Activity by setting Modeling as a type of Activity in the Activity options.
This setting can be selected only when the Activity has No panel.
3.1.4. Data Video Activity
Data Video Activities are designed for making measurement on videoclips or single images.
Specify this type of Activity by setting Data Video as a type of Activity in the Activity options.
This setting can be selected only when the Activity has No panel.
3.2. Creating Activity
An Activity can be created and modified only by Authors, not by student users.
To create a new Activity
• In the Main or Activity toolbar press the New button, or select File > New… from the menu.
• Next do the following steps:
1. Define the Activity options.
2. Fill the Activity.
3. Save the Activity.
The detailed description of each step is the next sections.
3.3. Defining Activity options
Upon creating a new Activity, the Activity Options dialog is automatically shown. To open the
Activity Options dialog in an existing activity select Tools > Activity Options or use
<Shift>+ .
3.3.1. Activity type
In this sheet the Activity settings
can be specified.
• Select the type of Activity:
Measurement, Control, Modeling or Data Video.
• For a Measurement or Control
Activity select the panel from
the drop-down list.
• For Modeling and Data-video
Activities, the No Panel option
should be selected.
Figure 150. The Activity Options dialog, the Activity Type sheet.
213
•
•
If the panel supports off-line measurement and you want to use this feature in the Activity,
select Off-line.
If a Panel is selected, the option With a program can be marked. This option allows the use
of Coach Language programs in the Activity.
A few rarely used options can be found in the
More pane. Press the More button to reveal
these options. This button is only active when
applicable. To hide these options again, press
Figure 151. The options available after pressing the
Less.
More button.
•
•
•
If the Program button or Model button should be hidden for Junior student-users, deselect
Show program button or Show model button. These options are only active when
applicable, i.e. when With a program or Modeling is selected. Only the button will be
hidden. It is possible to display a model/program in an Activity only if the Model/Programwindow is visible at the moment the Author saves the Activity.
Deselect Allow switching between different modes to hide the Modeling buttons to change
the model to other Modeling modes.
Select Stop on digital input to determine which of the panel inputs is used to
unconditionally end program execution. The program stops as soon as the value on the
selected Input becomes High (only when With a program is On).
Note: The red Stop button of the LEGO DACTA Interface is always connected to input 9.
3.3.2. User level
In this sheet, the default user level
of the Activity can be set. In
general, this is the user level in
which Coach runs this Activity,
unless explicitly overruled by the
user level login or settings in a
Coach project file.
• Click the tab User level.
• Select the user level for the
Activity. Default is Senior.
• The Junior level is split up into
three levels: Fixed, Flexible
and Own Lab.
Figure 152. The Activity options dialog, the User Level sheet.
3.3.3. Advanced
In this sheet the options are
available which are used in rare
cases.
• Mark Show previous runs in
diagrams when you want to
keep previous runs in diagrams
(by default on). The previous
runs (grey color) are only
Figure 153. The Activity Options dialog, the Advanced sheet.
214
•
•
•
•
•
displayed on the computer screen; data associated with these runs are not stored in the
memory.
Mark the option Always run in Quick mode only when fast program execution is required.
In Quick mode, the screen is not updated during program execution, to speed up the
execution time.
Note: Check if this option is unmarked when no data appear in diagrams or tables during a
measurement.
Unmark Display all digital bits during replay for fast replay. Only bit information will be
stored for channels to which a sensor/actuator is connected.
Angle units: Specify the unit for angles used in the Activity (e.g. in formulas), or measured
in the Data-Video window.
Note: Changing the angle unit when data or formulas are present in the Activity may lead to faulty
results as Coach does not convert angles to the new unit.
Command language (i.e. the language of Coach-Language commands). This option makes
it possible to use English Coach Language in an “another language” Coach environment. By
default, the current user interface language appears in this field. The selected language is
saved in the Activity. In the drop-down list you find all installed languages.
Alternative panels are used to make an Activity suited for more interfaces. Student users
can select an alternative panel by right clicking the panel. Moreover, when the panel for the
Activity can not be found, the button Select Other Panel appears which shows the list of
alternative panels.
Alternative panels are not defined by selecting a particular interface, but by specifying the
minimum number of required inputs and outputs in the Activity. From this, Coach
determines which panels meet the conditions. These panels appear in a list.
To set up alternative panels
• Click the button Alternative Panels.
• Specify interface inputs and
outputs by entering the number,
selecting the type and kind of
connection.
The options for Kind depend
on the selected type of
connection. In most cases
General can be selected.
Yellow, Blue (for inputs) and
Black (for outputs) are used
only for the LEGO DACTA
interfaces. Sonar (for inputs) is
used for ultrasonic motion
Figure 154. Defining alternative panels.
detectors. Special is reserved
for future extensions of the package. Do not select it.
• If you want to specify more than one type of connection, use a new line.
• If you want to set up alternative panels for an Activity with ultrasonic motion detectors,
select Connection = Analog input, and Kind = Sonar.
Note: Selection of an alternative panel may cause a change of sensor/actuator icons positions on the
new panel and removal of sensors/actuator icons that are not supported by the new panel. Coach
will display a warning message if this is the case.
215
To disable alternative panels
• Click the button Alternative Panels.
• Simply delete all Number fields by selecting a number and pressing <Del>.
3.4. Filling an Activity
In fact, filling an Activity is nothing more than – depending on the Activity type – preparing a
measurement, a video measurement, a model or a programming environment (Micro-world) for
creating programs and filling the Coach panes with suitable content information. When filling an
Activity an Author should keep in mind for which user level the Activity will be. During the
development process, Authors can immediately view and evaluate the Activity in another
student-user mode by using the menu option Options > View as in an Activity. The status bar
gives indicates the chosen level as: As Activity User Level or As Senior.
Except for the Activity toolbar, the Activity will behave exactly as a student user would
experience it. The View as menu option stays available to change back to Author mode again.
If you want to prepare an Activity for a panel which is currently not connected to the computer
then deactivate the interface by deselecting the option Activate Hardware in the Tools menu.
Then Coach does not bother you any longer with messages that the panel could not be initialized.
Instead, it places an inactive picture of the panel, which can be used to prepare the Activity. As
soon as the Activity is opened on a computer which has the interface connected (and provided
the option Activate Hardware is marked) it will work normally.
3.5. Saving an Activity
Activities can be saved only by Authors.
To save an Activity
• Select the Save as… button in the Activity toolbar or select File > Save from the menu or
press <Ctrl>+<S>. If an Activity is saved for the first time, all these commands invoke Save
as… dialog.
• Browse to the desired location.
• Type in a descriptive file name. The activity name will be the same as its file name.
• Once an Activity is saved, the Save as… button always invokes Save as… dialog, while
Save from the menu or <Ctrl>+<S> immediately update (overwrite) the current Activity.
3.6. Coach files
All elements which are used in an Activity (Result), like pictures, video clips, data and modified
or newly created sensors/actuators are stored in the CMA (CMR) file, similar to pictures in a
Word document.22, 23
This makes exchanging of Coach Activities with other users very simple: simply send someone
the CMA or CMR file. On one double-click the complete activity will start on the other
computer (provided Coach 6 is installed). In a similar way, hyperlinks to CMA files can be put
22
When large video’s are included in the Activity, the Activity file can become quite big. Usually the size of the
video file is the main measure for the size of the Activity file.
23
In Coach 6.3 version and higher, when an Activity/Result links to local files like word documents, local websites
etc. then these files are incorporated in the CMA/CMR files (zipped).
In the older Coach versions only the references are stored in the CMA/CMR files, and not the referenced
document(s) itself. If such an Activity/Result is sent to someone else, do not forget to include the referenced
document with it.
216
on a website to be downloaded and started in Coach upon selecting Open from the browser’s
download menu.
Overview of Coach 6 file types
File
Type
Remarks
*.CMA
Coach Activity
(Coach Materials Archive)
Coach Result
(Coach Material Result)
Coach Project file
(Coach Material Starter)
File with the Author password
(Coach Key File)
writable by Authors; incorporates all related
files for the Activity.
writable by Authors and Student users;
incorporates all related files for the Result.4
writable by Authors via Coach; incorporates
the title picture.
*.CMR
CMAPROJECT.CMS
AUTHORKEY.CKF
If the Author key is lost, copying the
authorkey.bak file to authorkey.ckf restores
the Author key to its default (‘0000’).
This file resides in the Coach folder. In case
of a network installation the location of the file
is specified during the installation.
4. Author tools
Author tools are available through the Main menu via the Tools and Options menu.
4.1. Preferences
The option Preferences allows selecting a
project location upon starting Coach:
•
The CMA Projects folder (default)
•
The School Projects folder
•
The last folder used during the
previous session.
Figure 155. The Preferences dialog.
4.2. Switching the language of the Coach user interface
It is possible to change the default language of the Coach user interface (not possible for the
English version of Coach 6).
To switch the Coach user-interface language
• In the Main menu select Options > Switch Language. A submenu appears listing all
installed languages. The current default language is marked.
• Mark another default language.
• Close Coach and restart Coach.
4.3. The sensor/actuator editor
With the sensor and actuator editors Authors can create and modify sensors and actuators.
Sensors and actuators are stored in the Coach Libraries. There are two libraries available:
• CMA Library with the pre-calibrated sensors, and
• User Library with the user-defined sensors.
217
The process of creating new sensors/actuators is described in 5. Creating and editing sensors and
actuators.
4.4. The Library filter
The Library filter allows Authors to compose their own CMA Library. The sensors and
actuators, which are not available at school, can be hidden. The hidden sensors/actuators are not
displayed in the CMA Library and hence cannot be selected in Activities.
To hide a sensor/actuator
• Open the Library Filter dialog by
selecting in the Main menu Tools
> Library Filter.
• By default all CMA sensors and
actuators are marked to be
visible.
• Hide a sensor by pressing the
Hide button or by unmarking the
checkbox next to a sensor.
• To make a sensor visible again
press the Show button or mark
the sensor.
Figure 156. The Library Filter dialog.
- Sensors/Actuators can be sorted
by Name, Brand, Family and Visibility.
- Multiple selections can be made with the <Ctrl> and <Shift> keys similar as in Windows
Explorer. A selection can be shown/hidden by using the Show/Hide buttons.
- By using the buttons Show All and Hide All all sensors or actuators are respectively selected
or deselected.
4.5. Install path
This option is only useful in case Coach 5 Activities or
Results which make use of such ‘paths’ should be opened
in Coach 6. The option Install path allows Authors to
define paths to multimedia files (pictures, videos, HTML
pages, Word documents) – resources for Coach Activities.
The default path is the graphics-folder in the Coach
directory.
To add/remove a path
• Select in the Main menu Tools > Install paths.
• To add a path click Add and browse to find the desired
location.
• To remove a path, select a path and click Remove.
Only the path will be deleted, not the folder itself and
its contents.
• Click OK.
218
Figure 157. The dialog to install path
to graphics and video files.
4.6. Deactivate hardware
When creating Coach Activities for interfaces which are not connected to the computer, it is
possible to deactivate the hardware. This means that Coach does not try to communicate with the
selected interface. As soon as the Activity is run on a computer where the hardware is available,
it works properly.
To deactivate the hardware
• Switch off the Main menu option Options > Activate hardware.
• The hardware is deactivated for the whole Coach session, or until this option is switched on
again. Coach will not try to set up communication with an interface upon opening an
Activity.
4.7. Starting Coach via command line
To force Coach 6 to start in Author mode you can use the command-line option /A in a
command line for Coach32.exe. This switch can also be used in a command line for a
cmaproject.cms file. An Author key can not be passed along with this switch, if a key is set then
the user should type in the correct key after Coach has started.
With the option /d one can start multiple instances of Coach24.
With the option pair /w: and /h: one can specify the dimensions of the Coach window upon
startup, i.e. when putting /w:800 /h:600 behind the reference to Coach32.exe will make Coach
run in an 800x600 window.
5. Creating and editing sensors and actuators
Authors and student users in some modes can edit CMA sensors/actuators and create new
sensors/actuators. All modified and newly created sensors/actuators are written into the
respective Activity/Result where they were created. However, Authors have the option Save to
User Library when right clicking a sensor/actuator defined in the Activity. This allows storing
the sensors and actuators in the User Library.
- When the sensors/actuators are stored in the Activity/Result then they are available only in
this Activity/Result.
- Sensors/Actuators from the User Library are available for all Activities/Results.
Note: Senior student users and Junior student users in Own-Lab mode can only create, edit and store
sensors/actuators in the Result.
Notice that it is not possible to change the content of the standard CMA Library. By using the
option Tools > Library Filter in the Main menu it is possible to hide sensors/actuators
displayed in the CMA Library.
To create a sensor/actuator in the Activity
• In the Activity, right click an empty palette position and select Create a New Sensor.
• Fill in the sensor/actuator properties and click OK.
• Save the Activity/Result to store the created sensor/actuator icon.
24
Version 6.3 or higher.
219
To edit a sensor/actuator in the Activity
• In the Activity, right click a sensor/actuator icon and select Edit Properties.
• Modify the sensor/actuator properties and click OK.
• Save the Activity/Result to store the edited sensor/actuator icon.
To store a sensor/actuator in the User Library,
right click the newly crated sensor/actuator icon
and select Save in User Library.
The name of the newly created sensor/actuator
will be shown. Click OK to store.
To remove a sensor/actuator icon from the Activity
• In an Activity/Result, right click a sensor/actuator that is defined in the Activity.
• Select Delete All. The icon is then removed from the Activity when the Activity is saved
again.
To create a sensor/actuator in the User Library
• In the Main menu, select Tools > Sensor Editor/Actuator Editor.
• Click New Sensor/Actuator.
• Fill in the sensor/actuator properties and click the Save as New button.
• Click OK to accept the new sensor/actuator name. The sensor/actuator will be added to the
User Library.
To edit a sensor/actuator in the User Library
• In the Main menu, select Tools > Sensor Editor/Actuator Editor.
• Select a sensor/actuator from the list and click Edit.
• Fill in the sensor/actuator properties and click the Save as New button.
• Click OK to accept the new sensor/actuator name. The edited sensor/actuator will be saved
in the User Library.
To remove a sensor/actuator from the User Library
• In a Main menu, select Tools > Sensor Editor/Actuator Editor.
• Select a sensor/actuator from the list.
• Click Delete. The sensor/actuator will be removed from the User Library.
Sensors/actuators in the CMA Library can not be deleted.
Locking a sensor/actuator icon
Icons on the panel can be locked so that student users cannot move the icon between the
inputs/outputs, or between the panel and the palette. For Activities in Junior Fixed mode, icons
are always locked irrespective of the setting made here.
To lock/unlock an icon
• Drag an icon to an input or output on the panel.
• To lock the icon, right click it and mark Icon Locked.
• To unlock the icon, right click it and unmark Icon Locked.
Note: Even Authors can not move a locked icon, they have to unlock it first.
220
6. Creating customized programming environment
Control or Measurement Activity with a program has the Program window with a standard
programming instructions - Coach Language commands. Authors can customize this standard
list and adapt it for a specific application, called also Micro-world. Such Micro-world consists of
set of commands - functions or procedures tuned to a particular control application.
6.1. Creating new functions and procedures
Authors
create
micro-world
programming commands in the
Procedure window. The Procedure
window is placed in the Program
window and is hidden behind the
program editor.
• Place the mouse cursor on the
bottom line of the title bar of
the Program window until it
changes its shape to:
• Drag the top edge down. The
Procedure window opens. In
this window new procedures
and functions can be entered.
To define a new function
• Open the Procedure window.
• Type the function.
• In a function a number of statements are defined under the name of the function. The result
of a function is a calculated value. Its syntax is:
Function Function_name(p1; p2)
Statements
Function_name:= expression (assign a value to the function's name)
EndFunction
Keep the following in mind:
- The function name may not be identical to the name of a reserved word, a variable, a
procedure or of an already defined function.
- The statements should be separated from each other by spaces or <Enter>.
- The parameters, as defined in the function name, act as local variables. The names of each
parameter must be unique. It is not allowed to use the same names at other positions in the
Micro-world.
- The parameters have to be separated from each other by a semicolon (;).
- Only functions with 0, 1 or 2 parameters can be used in the command list.
- In a function it is allowed to call an already defined function.
- Uppercase and lowercase names are different in Coach 6.
221
Examples of functions
Function Mean(A; B)
C = A+B
Mean = C/2
EndFunction
Function Light
If LightIntensity > 50
Then
Light = 1
Else
Light = 0
EndIf
EndFunction
To define a procedure
• Open the Procedure window.
• Type the procedure. In a procedure, a number of statements are defined under the name of
the procedure. The result of a procedure is the execution of the defined statements. The
definition of a procedure is very similar to the definition of a function. The difference is that
the definition of a function ends with an assignment (i.e. the function results in a value) and
the definition of a procedure does not. The syntax of the procedure is:
Procedure Procedure_name(p1; p2; ...)
Statements
EndProcedure
Keep the following in mind:
- The procedure name may not be identical to the name of a reserved word, a variable, a
function or of an already defined procedure.
- The statements should be separated from each other by spaces or <Enter>.
- The parameters, as defined in the function name, act as local variables. The names of each
parameter must be unique. It is not allowed to use the same names at other positions in the
Micro world.
- The parameters have to be separated from each other by a semicolon (;).
- Only procedures with 0, 1 or 2 parameters can be used in the command list.
- In a procedure it is allowed to call an already defined procedure.
- Uppercase and lowercase names are different in Coach 6.
Example of procedures
Procedure Lamp
Set(1)
EndProcedure
Procedure Lamp(n)
Set(n)
EndProcedure
Procedure Lamp(n; State)
If State = 1 Then
Set(n)
Else
Reset(n)
EndIf
EndProcedure
222
6.2. Creating programming buttons
Students can make programs by manually
controlling a system via so-called
programming buttons. By clicking
programming buttons Coach executes
procedures that are associated with these
buttons and translates them into the
program lines. The automatically created
program can be visible in the program
editor area (but it does not have to).
By executing the program, Coach repeats
recorded program lines.
When the mouse cursor is moved over a
button, a tool-tip with a procedure(s)
name (its action) appears.
Figure 158. Instruction buttons used in the Crossroads project.
To add a new button
• Right click the Program window and mark the Show Programming Buttons option is
marked.
• Right click an empty place in the
button area of the Program window
and select New Button….
• Select a button type, see detailed
descriptions on the next page.
• Select the procedure(s) associated
with this button. In the list appear
only procedures, which can be used
for the selected button type. These
can be standard Coach Language
procedures or procedures created in
the Procedure window.
• Select a button icon from the list of
Figure 159. Defining new programming button.
icons.
• Click OK. The new button is placed in the Program window.
To edit button
• Right click a button and select Edit.
• Edit properties of the button and click OK.
To move a button
• Right click a button and select Move.
• Move the button to another location and click it.
To delete a button
• Right click a button and select Delete.
• The button is removed from the Program window.
223
The following button types are available:
Button name Button description
One shot
Example of associated
procedure
A one-shot button executes a procedure once Procedure Main_road_Red
when it is pressed. Only procedures without Set(4)
parameters (standard and created in a micro Reset(5;6)
EndProcedure
world) can be selected.
Pushing the button executes the procedure once
and places the procedure name in the program
line.
Push/Release A push/release button executes two procedures:
one when the button is pushed and one when the
button is released. There is a wait between the
two operations.
Only procedures without parameters (standard
and created in a micro world) can be selected.
Pushing the button executes the first procedure
once only and places the procedure name in the
program line. As long as the button is pressed a
Wait command counts the time in the next line
in the program. When the button is released the
time counting is finished, the second procedure
is executed and its name is placed in the next
program line.
Stepping
These buttons can be used
for example to turn a lamp
or a motor on for a given
time interval.
A stepping button causes a procedure to be Procedure
executed a number of times while the button is Go_Down(Number)
pressed. A parameter 'steps' is added to the Repeat
Do_a_Step
procedure name.
….
Only procedures with one parameter can be
selected. This parameter must determine the Until Number
EndProcedure
number of repetitions in the procedure.
6.3. Modifying the command list
The command list in the Program window consists of references to either standard Coach
Language commands or to commands (functions and procedures) created by Author. The
command list can be adapted by deleting references to existing commands from the command
list and adding references to procedures and functions.
Such an adapted command list forms an easy programming environment for student users. They
create programs by selecting commands from the list. In many cases to obtain a complete
command they select items from several submenus e.g. to select parameters for the command, to
enter a value or to put together a conditional expression. Through this system, Coach ensures that
constructed commands always have a correct syntax.
224
The command list is displayed when the Show Command List option is marked.
To edit the command list title
The command list by default has the title Commands. To change this title:
• Right click the Commands title or right click the Command List and select Edit
Command List Title.
• Edit the title and confirm with OK.
To delete the command from the list
• Right click the command you would like to remove and select Delete, or press <Del>.
• The name will be removed from the command list, together with the submenu for the item.
When you want to restore the name, you have to create the submenu again.
To cut the command from the list
• Right click the command you would like to cut and select Cut, or press <Ctrl>+<X>.
• The name and corresponding submenu(s) are moved to the clipboard and can be placed
elsewhere in the list with Paste.
To copy the command from the list
• Right click the command you would like to copy and select Copy, or press <Ctrl>+<C>.
• The name and corresponding submenu(s) are copied to the clipboard and can be placed
elsewhere in the list with Paste.
To paste the command into the list
• Make sure you have copied or cut an item from the command list.
• Right click the position after which the command should be placed and select Paste (after),
or press <Ctrl>+<V>.
Note: The option Paste (before) <Ctrl>+<Shift>+<V> is available only for the first position of the
command list.
Adding a command
1. Before you add the new self-made command to the list you have to create a new function or
procedure in the Procedure window. This is not necessary if you want to add a standard
Coach Language command.
2. Right click a command or an empty place in the command list and select Insert.
3. In the Add New Command to the List dialog type in the Name of the new procedure. Here
you can type also a name of the standard Coach procedure or function. The detailed
description of Coach Language can be found in VIII. Coach Language.
4. Coach automatically recognizes the name (as a name of procedure defined in the Procedure
window or the standard Coach Language command) and adds its description in the
Description field. Coach can display the following descriptions:
Operator or unknown command - The name is not recognized to be a standard command
or a micro-world procedure or function. A procedure or function with this name still has to
be made, or the name is wrong.
Procedure with a variable number of parameters - These are standard Coach Language
procedures (e.g. Set, Reset, Sound, etc.). The corresponding submenus cannot be edited.
225
Function with a variable number of parameters - These are standard Coach Language
functions. The corresponding submenus cannot be edited.
Procedure with (n) parameters / Function with (n) parameters - Only submenus of
commands with 0, 1 or 2 parameter(s) can be edited.
Statement with an expression - These are If, Until, While and Redo. Conditions for these
commands can be edited.
Other Coach Language word - Like Repeat, Else, EndIf, EndRedo, EndDo. These
commands do not need a submenu.
5.
The description given by Coach determines whether menus (e.g. for parameters) are
available. The type of command menu can be chosen in the When the user selects this
command part of the dialog box. The following options are available:
Default command menu - select this option only for standard commands (loop commands
or conditional statements).
Adapted command menu (Use the Edit Menu button) - with help from the wizard, an
Author puts together a command menu.
No command menu - select this option for commands without parameters.
Comment - by selecting this option, the item in the list is regarded as a comment only. This
is useful e.g. to create subtitles in the list. Also blank lines have this setting. Clicking a
comment in the list during programming does not lead to any action.
6. After selecting Adapted command menu, click the Edit Menu button. This will start the
wizard that helps to create command menu (selection list and/or fields for typing values) and
command conditions.
Submenus for procedures and functions with 1 or 2 parameters
For procedures and functions with 1 or 2 parameters Coach opens the Menu Wizard which
allows creating the selections list or typing fields per parameter. For each parameter:
• Type the title of the submenu.
• Mark one of the options:
- Type a value - user has to type a value; or
- Selection list - user has to select an item from the list.
• After the Selection list option is marked, type in the items of the list.
• Click OK when submenus for all parameters are ready.
Conditions for Conditional and Loop statements
For conditional statements (If…Then… EndIf) and loop statements (Repeat… Unitl,
While… Do… EndDo) users create conditional expressions via submenus. For these
commands wizard allows creating a conditional expression by defining separate submenus on
the right side of the operators for each item on the left side (Submenu per item marked), or
to make one submenu which appears for all items on the left side (Submenu per item not
marked). Only expressions with relational operators can be created.
Left side of the conditional expression
• Type a title for the first selection list.
226
• If you mark the Submenu per item check box then each item on the left has its own list
on the right, if you do not mark this check box then all items on the left will have the
same submenu.
• Type the names of functions and variables. When a function has parameters, a Menu
button appears. Click the Menu button to enter submenus for the parameters.
Relational operators of the expression
• Mark relational operators that will appear in the selection list.
Right side of the conditional expression
• Select a function or variable at the left side by marking a radio button at the left side of
the name. Enter the item(s) to which it has to be compared at the right side. Again you
have possibility to select between 'Type value' or 'Selection list' option.
• Click OK when submenus for all items at the left are defined. Remember if you do not
mark the Submenu per item check box at the left side then you have to create only one
submenu at the right side.
Editing an existing command
• Right click a command in the command list and select Properties.
• In the Edit Menu Item dialog edit properties of the command in the similar way as
described in the previous chapter.
Examples of modifying the command list
Adding a new command
Imagine a system consisting of 4 small lamps (3V bulbs) which can be connected to the outputs
of CoachLab II/II+ to be turned on and off. To control lamps a procedure Lamp must be defined.
Procedure Lamp(n;m)
If m=On Then
Set(n)
Else
Reset(n)
EndIf
EndProcedure
This procedure uses 2 parameters; the first parameter gives information which output should be
activated; the second parameter informs or the selected output should be turned on or off.
1.
2.
3.
4.
5.
6.
Type in the procedure Lamp in
the Procedure window.
Right click a command or
empty space in the command
list and select Insert.
Type in the name Lamp. Coach
recognizes that this is a
procedure with 2 parameters.
Mark Adapted submenu.
Click the Edit Menu.
For this command two menus
are required, the first to select
Figure 160. Add New Main-menu Item dialog; Coach recognizes
procedure Lamp as Procedure with 2 parameters.
227
the lamp output, and the second
to select the state of the lamp.
The submenu for the first
parameter (selection of the
output) is done in the left part
of the Submenu wizard. Give a
title of the first submenu: Select
output.
7. Mark the option Selection list.
The user will select the output
from the command list.
8. Type list items: A, B, C, D.25
9. Define the submenu for the
second parameter.
10. Mark the option Selection list.
11. Type list items: On, Off.26
Figure 161. The Submenu Wizard.
Redefinition of structural statements
A structural statement, like a conditional statement If… Then… EndIf, always needs a logical
expression to be evaluated. By default you build a structural statement from lists that pop-up as
soon as you select the opening word, e.g. If. This structure can not be modified. A micro-world
must use either the standard structural command or a replacement submenu, designed by the
author of the micro-world. Below you find an example of creating a replacement submenu of a
conditional statement.
Imagine a system that reacts on the light intensity measured by a light sensor connected to one of
the inputs of CoachLab II/II+ (an automatic shop window illumination). To read a value
measured by the light sensor a function Light_Intensity must be defined:
Function Light_Intensity(p)
Light_Intensity = Level(p)
EndFunction
1.
2.
3.
4.
5.
6.
7.
Type in the Procedure window the function Light_Intensity.
Right click the If command in the command list and select Properties.
Mark Adapted submenu.
Click the Edit Menu button.
In this window you have to
create a condition.
Remove all settings that are
placed in the fields at the left
side of the window.
Type in a new title for the first
selection list.
Figure 162. The Edit main menu dialog.
25
When you use variables A, B, C, D instead of the default output numbers, then you have to declare them explicitly
in the Procedure window. For CoachLab I these declaration are: A=1 B=2 C=3 D=4, for CoachLab II these
declaration are: A=1 B=3 C=5 D=7.
26
On, Off are standard Coach Language commands, you do not have to define them in the Procedure window.
228
8.
9.
10.
11.
12.
13.
14.
15.
16.
Type in the function name
Light_Intensity in the first field.
The function Light_Intensity has
one parameter that allows
selecting the input of the light
sensor. For this parameter the
submenu can be created. To
create a list of inputs that can be
selected click the Menu button.
Select the Selection list option.
Type in the inputs: 1, 2, 3, 4 and
click OK.
Mark the operators used in the
condition ‘<’ and ‘>’. (If
necessary remove all default
settings).
Figure 163. Create a condition dialog.
Finally define the right side of
the condition. User will have to type a value of the light
intensity. (If necessary remove all default settings).
Type a title of this part for example Type value.
Select the Type value option.
Click OK. Your new condition is ready.
Figure 164. The Submenu Wizard.
6.4. Advanced programming
Senior-student users can program freely by selecting commands from the complete list of
available Coach Language commands or by typing commands directly in the program editor. It is
also possible to create own commands and add these to the list with programming commands.
229
230
XI. Utility Programs
Table of Contents
1. RCX CONTROL PANEL ...................................................................................................................................... 232
2. FIRMWARE UPDATE ........................................................................................................................................... 234
2.1. Updating firmware .................................................................................................................................... 235
2.2. Updating of ULAB sensor library.............................................................................................................. 234
3. ULAB VIEW ...................................................................................................................................................... 237
231
1. RCX Control Panel
In order to be able to communicate with the computer, the LEGO Dacta RCX must contain
system software, which consists of two components:
- the firmware (general system software), which takes care of the communication between the
computer and the RCX and reserves in the RCX five positions for downloading control
programs.
- Specific system software for communication with Coach. After adjusting the RCX for use by
Coach, the first three program positions are filled with a standard test program, while
positions 4 and 5 are reserved for user control programs.
The utility program RCX Control is used to send both components to the RCX. This has to be
done before the RCX can be used in Coach.
To start RCX Control program go to Windows Start Menu > All Programs > CMA Coach 6 >
Utilities > RCX Control.
In the upper part of the RCX Control Panel the Tower icon, the
Beam icon and the RCX icon are displayed. A red cross through
an icon means that there is something wrong with this element –
see the icon’s tool tip for more details.
Below the icons a drop-down selection box allows to select the
COM port used by the Tower. If the RCX is connected to USB
port then setting of the COM port is not necessary.
Two buttons Download Firmware and Prepare for Coach allow
downloading the firmware and the specific system software for
communication with Coach. The status bar gives information
about the status of the RCX.
To download the system software into the RCX
• Place the RCX directly opposite the IR Transmitter.
• Connect the IR Transmitter to a serial port or USB port of the
computer.
Figure 165. RCX Control.
• Start the RCX Control program.
• Select the COM-port assigned to the IR transmitter. If the USB port is used then this is not
necessary.
• Click the Download Firmware button. Downloading takes roughly 4 minutes. The progress
of the download process is indicated clearly both on the screen of the RCX and the
computer. When the process is finished, the RCX plays a little melody.
• Click the Prepare for Coach button to prepare the RCX for Coach. The preparation takes
about 1 minute.
Notes:
- Take care that no conflicts arise with other devices in the computer also using a COM port (e.g. an
internal modem, some network cards or a Serial mouse). The setting is saved at the moment the
RCX Control program is closed.
- Prepare for Coach can only be executed after Download Firmware.
- If the RCX has been without power for longer than 2 minutes (i.e. when the batteries are removed
without connection to mains supply), the commands Download firmware and Prepare for Coach
have to be executed again.
- Coach should use the same COM-port as the RCX Control.
- After the RCX has been used by students, it may be better to reset it.
232
To set up an IR range
Both the IR Transmitter and the RCX can be set up for long range or short range communication.
A range for the IR Transmitter can be selected with a switch on the tower. The range of the RCX
has to be set up in the RCX Control by clicking the Beam icon to switch between short and long
range. It is recommended to select short range communication (narrow beam).
Note: Both the Tower and RCX should be set to the same range.
To reset the RCX to its initial state
By resetting the RCX to its initial state, all programs in the RCX are erased and the three test
programs are reloaded into program positions 1, 2, and 3.
• Press the Prepare for Coach button in the RCX Control.
Loading programs by Authors
Authors can fill all five-program positions with self-made control programs. In this case, the user
has the possibility to download a program in each of the five program positions. To this end, first
start the RCX Control and only then start Coach. Keeping this order, you will be able to fill
position 1 to 3 with a program.
• First, start the RCX Control Panel.
• Then start Coach.
• Select the desired program position by pressing the Prgm button on the RCX. If one of the
position 1-3 is selected the existing test program will be overwritten.
• Load the program to the RCX by pressing the Send Settings button.
Loading programs by Student users
In general, student users should use Coach without the RCX Control. They can only
download/overwrite a program at positions 4 and 5. If the RCX is set to program position 1, 2 or
3, it automatically jumps to position 4. If the program for position 4 is so large that there is no
space left for a program on position 5, an error message appears at an attempt to fill position 5.
Students now can either limit the size for the program for position 5 or overwrite the program in
position 4.
• Start Coach.
• Select program position 4 or 5 by pressing the Prgm button on the RCX.
• Load the program to the RCX by pressing the Send Settings button.
Memory space for programs
A maximum of 5 programs can be stored in the RCX with a total of 1500 commands. Only part
of the memory space (32 kB) of the RCX is available for Coach control programs:
- A part of the memory is occupied by the operating system (the firmware) of the RCX (16kB).
- In the future, the operating system will undergo changes as new functions are added to the
RCX (10kB is already reserved for this purpose).
- The remaining part of the memory is available for transmitting control programs made in
Coach (32kB - 26kB = 6kB).
- For each Coach Program, another 0.3 kB is reserved for system software. In this way, the
RCX has 6 kB - 5 x 0.3 kB = 4.5 kB available for self-made control programs.
This space can be occupied either by one large program or by several smaller ones.
The three test programs, which are automatically downloaded into the RCX on initialization,
occupy 0.9 kB.
233
2. Firmware Update
Firmware Update is a program to update the internal operating
system software (firmware) of CMA interfaces.
For working with Coach 6.3 a new firmware is needed for ULAB,
CoachLab II+, €Lab and €Sense. Coach recognizes automatically when
a connected interface need to be updated and offers direct update.
For the ULAB interface next to updating the internal operating system
software is possible to update its internal Sensor Library.
2.1. Updating firmware
To update firmware when working with Coach
• When Coach 6.3 recognizes that a connected interface need to be updated then the following
message is displayed.
•
•
Click Yes to start the Firmware Update program for the connected interface.
Next steps are similar to updating with the Firmware Update and described below.
To update firmware with Update Firmware program
• Start the Firmware Update program via Start > All Programs > CMA Coach 6 > Utilities >
Firmware Update.
• Select the interface for updating by pressing the button with the desired interface. Notice
that the CoachLab II+ and ULAB interfaces should be powered during this process.
For CoachLab II+, €Lab and €Sense
• Press Update to start the update process.
• From the list of available firmware files
select the latest firmware (file name#*.hx2)27.
• Click OK.
• Pressing Yes starts the update process. At
the end of this process the connected
interface will reset itself.
• When the firmware is updated successfully
then the message appears: The firmware
has been update to version #.
• Click OK to accept.
27
name – the short interface name, # - the firmware version number; * - the firmware language
234
Note: In rare cases the reset of €Lab/€Sense will not work properly, the interface LED remains on and
there is no communication between the computer and the interface. In that case you have to
restart computer to continue working with €Lab/€Sense.
For ULAB
• Under Communication port select the port to which the datalogger is connected (USB or
COM port).
• Press the Firmware Update button.
• From the list of available firmware files select the downloaded
firmware file ULAB#-*.hx228.
• The following message appears Updating the firmware clears all
data in ULAB’s memory. Update the ULAB firmware using ULAB.
hx2?
• Pressing Yes starts the update process. At the end of this process
ULAB will reset itself.
• When the firmware is updated successfully then the message
appears: The firmware update process has been completed
successfully. ULAB is updated to firmware version #.
• Click to close the window.
The newest version of the firmware files can be downloaded from the CMA website:
http://www.cma.science.uva.nl under Support > Hardware > Interfaces.
2.2. Updating ULAB Sensor Library
By default internal ULAB Sensor Library consists of approximately 40 of the most used CMA
sensors. This local library can be modified; sensors can be deleted or replaced by new sensors
with the ULAB Update program.
To update ULAB Sensor Library
• Connect the power supply to ULAB and plug into the outlet.
• Connect ULAB to the computer and turn it on.
• Start the Firmware Update program via Start > All Programs > CMA Coach 6 > Utilities >
Firmware Update.
• Click the ULAB button.
• Under Communication port select the port to which the datalogger is connected (USB or
COM port).
• Press the Library Update button. The Library Update dialog opens.
28
# - the firmware version number; * - the firmware language
235
Figure 166. ULAB Library Update.
•
•
•
•
Select CMA Library or User Library under Sensors available in Coach Library.
The CMA Library consists of pre-defined CMA sensors, the User Library consists of
sensors defined by users in Coach. The sensors from the selected library are listed in the
upper pane. The lower pane displays the sensors currently stored in the local ULAB library.
Modify the ULAB library.
- To remove a sensor from in the ULAB library, select a sensor in the lower pane and
click the Delete button. The sensor is removed from the list.
- To add a sensor to the ULAB library, select a sensor in the upper pane and click the Add
button. The sensor is added to the list in the lower pane. The ULAB name is created
from the short sensor name and sensor ID. This name will be displayed in the ULAB. To
change this name press the Rename button or click the sensor ULAB name. Type in a
new name. The name can have maximal 12 characters.
Press the Update button to update the ULAB library.
By pressing the Restore Default Library button the current ULAB library is restored to its
default Factory library.
236
3. ULAB View
ULAB View is a program which sends the image of the ULAB screen to the computer screen. In
this way all students can easily follow teacher demonstrations.
To use ULAB view
• Connect ULAB to the computer and turn it on.
• Start ULAB view program via Start Menu > CMA
Coach 6 > Utilities > ULAB View or by clicking
ULABView.exe file in the Coach 6 folder.
• The program automatically displays the current
ULAB screen.
• Such a screen display can be captured and saved as a
bitmap file (*.bmp) by pressing the <F2> key or by
left clicking. A Save as… dialog appears to store the BMP. This feature is very useful for
creating teaching materials.
• Close the program by clicking the Close button in the upper right corner of the ULABView
window.
237
238
Appendix I. Interface panels
The following interface panels are supported in Coach:
Panel picture
Panel specifications
CMA CoachLab and
CoachLab with
sensor detection
Both panels are used for measurement and control with the CMA CoachLab
interface.
Panel specifications
- 2 Analog inputs (1, 2)
- 2 Special Analog inputs for CoachLab Microphone (3,4)
- 4 Digital Outputs (1,2,3,4)
- Maximally 50000 measurement points (limited by Coach software)
- Maximum sample frequency 200 Hz (supports only USB cable).
The CoachLab with sensor detection panel recognizes the standard CoachLab
sensors: Temperature (0511), Light (0513) and Microphone (056). As soon as one
of these sensors is connected to the real interface the corresponding sensor icon
automatically appears on the same input of the screen panel.
CMA CoachLab II/II+
This panel is used for measurement and control with the CMA CoachLab II and
CoachLab II+ interfaces.
Panel specifications
- 4 Analog inputs (1, 2, 3, 4)
- 2 Digital/Sonic inputs (5, 6)
- 4 Analog outputs (A, B, C, D).
- Maximally 2 Analog input can be used as a Counter input.
- Maximally 16380 for measurement points for CoachLab II (for one channel).
and 32768 for CoachLab II+ with firmware lower than 1.1
- For CoachLab II+ with firmware 1.1 and higher cyclic filling of memory buffer is
implemented: i.e. there is no longer a hardware limit on the number of
measurement points for measurement frequencies up to 10,000Hz.
- Maximum sample frequency 40 kHz for CoachLab II and 100 kHz for CoachLab
II+ (when using one channel).
CoachLab II+ recognizes CMA intelligent sensors. As soon as such sensor is
connected to the real interface the corresponding sensor icon automatically
appears on the same input of the screen panel.
CMA Crossroads
CMA €Lab
This panel is used for control with CMA Crossroads model (only via USB cable).
This panel is used for measurement with the CMA €Lab interface.
Panel specifications
- 2 Analog inputs (1, 2)
- Maximally 1 Analog input can be used as a Counter input.
- Unrestricted number of measurement points for sampling interval ≥ 0.063 s
otherwise maximally 16380 measurement points (one channel).
- Maximum sample frequency 40 kHz.
€Lab recognizes CMA intelligent sensors. As soon as such sensor is connected to
the real interface the corresponding sensor icon automatically appears on the
same input of the screen panel.
239
CMA €Lab + €Motion
CMA €Motion
This panel is used for combined measurements with CMA €Lab and €Motion.
- Maximum sample frequency for €Lab: see specifcations of €Lab
- Maximum sample frequency for €Motion: always 15 Hz (does not depend on
€Lab settings)
This panel is used for measurements with CMA €Motion.
€Motion is directly connected to the USB port of the computer.
Panel specifications
- Maximally 50000 measurement points (limited by Coach software)
- Maximum sample frequency: 50 Hz,
CMA €Sense
This panel is used for measurement with the CMA €Sense.
Panel specifications
- 4 sensor inputs for €Sense built-in sensor Sound, Temperature and Light
sensors and for external Temperature sensor
- 2 Actuator output for built-in LED and Buzzer
- Maximally 1 Analog input can be used as a Counter input.
- Unrestricted number of measurement points for sampling interval ≥ 0.063 s
otherwise maximally 16380 measurement points (one channel).
- Maximum sample frequency 40 kHz.
CMA ULAB
This panel is used for measurements with the CMA ULAB datalogger.
Panel specifications
- 4 Analog inputs (1, 2, 3, 4)
- 2 Digital/Sonic (5, 6)
- Maximally 1 Analog input can be used as a Counter input.
- Maximally 250 000 measurement points (1 channel) (hardware-limited).
- Maximum sample frequency 100000 (when using one channel).
ULAB recognizes CMA intelligent sensors. As soon as such sensor is connected
to the real interface the corresponding sensor icon automatically appears on the
same input of the screen panel.
LEGO Dacta
Interface
This panel is used for control with LEGO DACTA Interface.
Panel specifications
- 8 Analog inputs (1, 2, 3, 4, 5, 6, 7, 8)
- 8 Digital outputs (A, B, C, D, E, F, G, H).
- Only LEGO DACTA sensors and actuators can be connected to this panel.
- Maximally 2000 Measurement points (software- limited)
- Maximum sample frequency 100 Hz.
240
LEGO Dacta RCX
This panel is used for control with LEGO DACTA RCX.
Panel specifications
- 3 Analog inputs (1, 2, 3)
- 3 Analog outputs (A, B, C).
- Only LEGO DACTA sensors and actuators can be connected to this panel.
- Maximally 20000 Measurement points in on-line mode and 500 Measurement
points (depending on the program size) in off-line mode (hardware- limited).
- Maximum sample frequency 2 Hz in on-line mode and 10 Hz in off-line mode.
LEGO Dacta NXT
This panel is used for control with LEGO DACTA NXT.
Panel specifications
- 4 Analog inputs (1, 2, 3, 4)
- 3 Analog outputs (A, B, C).
- Only LEGO DACTA sensors and actuators can be connected to this panel.
- Maximally 50000 measurement points (limited by Coach software)
- Maximum sample frequency 20 Hz as well in on-line as in off-line mode.
For use of the LEGO NXT the installations of LEGO MINDSTORMS Education
NXT v2.0 driver software (not delivered by CMA) and Microsoft .NET 2.0 are
required (Win 2000 and Win XP only).
TI CBL
TI CBL2
This panel is used for on-line and off-line time-based measurements with the
Texas Instruments CBL Datalogger.
Panel specifications
- 3 Analog inputs (CH1, CH2, CH 3) and
- 1 Sonic input (SONIC).
- Maximally 512 measurement points (hardware limited)
- Maximum sample frequency for:
• time-based on-line measurements: 5 Hz (through one channel only),
• time-based off-line: 10000 Hz (only one channel and with triggering).
• with other settings, the sample frequency will be automatically adapted by
Coach.
This panel is used for on-line and off-line time-based measurements with Texas
Instruments CBL2 Datalogger.
Panel specifications
- 3 Analog inputs (CH1, CH2, CH 3)
- 1 Sonic input (SONIC).
- Maximally 10 000 measurement points (hardware limited)
- Maximum sample frequency for:
• Time - based on-line measurements: 5 Hz (one channel only),
• Time - based off-line: 50000 Hz (when using one channel).
TI CBR/CBR2
This panel is used for on-line and off-line time-based measurements with Texas
Instruments CBR Datalogger. CBR is directly connected to the USB port of the
computer.
Panel specifications
- Maximally 512 measurement points (hardware limited)
- Maximum sample frequency for:
• Time - based on-line measurements: 5 Hz,
• Time - based off-line: 200 Hz.
241
Vernier LabPro
This panel is used for on-line and off-line time-based measurements with Vernier
LabPro Datalogger.
Panel specifications
- 4 Analog inputs (CH1, CH2, CH3, CH4)
- 2 Digital/Sonic inputs (SONIC1, SONIC2)
- Maximally 10 000 measurement points (hardware limited)
- Maximum sample frequency for:
• Time - based on-line measurements: 50 Hz (one channel only),
• Time - based off-line: 50000 Hz (when using one channel).
For use of the Vernier LabPro the installation of LabQuest and LabPro USB
device driver (Win XP/Win Vista/Win 7) or LabPro USB device driver (Win 2000) is
required.
Vernier LabPro +
DCU
This panel is used for control with Vernier LabPro Datalogger and Vernier Digital
Control Unit (DCU).
Panel specifications
- 4 Analog inputs (CH1, CH2, CH3, CH4)
- 1 Digital input where the DCU with 6 1-bit outputs is connected (1, 2, 3, 4, 5, 6).
- 1 Sonic input (SONIC2).
Other settings see description for LabPro panel.
242
Appendix II. Coach Shortcuts
Shortcuts are special key combinations or key-button combinations which can be used to
accelerate certain actions in Coach.
Shortcuts for menu items
<Ctrl>+<O> or <F3>
Open…
<Ctrl>+<N>
New…
<Ctrl>+<S> or <F2>
Save
<Ctrl>+<W>
Close
<Ctrl>+<P>
Print
F1
Help
F9
Start (Green button)
<Shift>+
Erase all values and Start a new run
<Shift>+
Erase all values and receive data from datalogger
<Shift>+
Open the Activity-options dialog (Advanced users only)
<Ctrl>+<F9>
Start > Execute in Quick mode
<Ctrl>+
Open the Diagram settings in a Diagram window
<Ctrl>+
Open the Table settings in a Table window
<Ctrl>+
Re-scales the vertical direction only
<Shift>+
Open the Diagram Style in a Diagram window
<Shift>+<F9>
Start > Execute and Erases all values
<Ctrl>+<Z>
Undo the last edit (in a Table also to undo the last Processing
action or Analyze action)
<Ctrl>+<A>
<Esc>
Select all (e.g. in a Table or Text window)
The Escape key can be used to cancel any action.
Data Video shortcuts
<→>
one frame forward among the selected frames
<←>
one frame backward among the selected frames
<PgDn>
one frame forward among all frames
<PgUp>
one frame backward among all frames
<Ins>
add current frame to the selection of measured frames
<Del>
delete current fame from the selection of measured fames
243
<Backspace>
remove data associated with the selected frames
<Shift> + <cursor keys> selecting a sequence of frames
<↑>
maximize the video screen
<↓>
reset the video screen to its original size
<Shift>+
Erase all values and start a new Video measurement (or
<Shift>+<F9>)
Modeling shortcuts
Undo or <Ctrl>+<Z>
the last performed action is cancelled
<Ctrl>+<A>
the whole model is selected
<Shift> +<cursor keys>
- moves the canvas of the Model window in Graphical mode
- select variables in Equation mode
<Ctrl> + <click>
select more equations in Equation mode
<PgUp>, <PgDown>
move an equation to another location in Equation mode
<Shift>+
Erase all values and start a new Model run (or <Shift>+<F9>)
General Windows shortcuts
<Ctrl>+<X>
Cut
<Ctrl>+<C>
Copy
Paste
<Ctrl>+<V>
In addition to these shortcuts you can invoke the action on a button by <Alt> + underlined letter,
e.g. <Alt> + <N> for New.
244
Appendix III.
Conversion of Coach 5 Materials
The conversion from Coach 5 to Coach 6 takes three steps.
1) Convert the (cryptic) Coach 5 file names of Activities, Results and projects to long file
names with the program CoachNames5to6.exe
2) Convert the Coach 5 project by editing the existing project information and clicking OK.
3) Convert Activities and Results by opening and saving them in Coach 6.
Important!
Make sure you have a backup copy of your Coach 5 Activities and Results. After
conversion (even of only the names), they can no longer be run in Coach 5.
You can copy the projects you want to convert to a new folder, e.g. ‘My Coach 6 Projects’.
When browsing in Coach to this folder, you can add it to the Favorite-locations list by pressing
the Favorites button and selecting Add current.
1. Conversion of the Coach 5 file names
1. Convert the names of Projects/Activities/Results with the program CoachNames5to6.exe.
This program is located in the Coach 6 installation folder (C:\Program
Files\CMA\Coach6\Utils).
2. Double-click CoachNames5to6.exe.
3. If necessary mark the option Recurse subfolders.
4. Press the button Select folder to select the folder where the projects are located.
The folder name will be changed to the name of the project, the cryptic filenames of
Activities/Results will be changed to the names of the Activities/Results.
245
2. Conversion of the Coach 5 project
Coach 6 is able to read the Coach 5 project information, but it will store this information in a
different format and include the project title picture in the new file.
1. Open Coach 6 in Author mode.
2. It is recommended to go to the menu Tools and unmark the option Activate hardware.
3. Click the Open button. Browse in the dialog to the Coach project you want to convert.
4. Click the button Coach Project in the File open dialog and select Edit Coach Project and
click OK.
Note: If this option is not in the menu, the current folder has no Coach project information. If you want to
make the current folder to a Coach project, please select Convert this Folder to a Coach
Project.
3. Conversion of Coach 5 Activities/Results
Coach 6 is not able to store Activities/Results in Coach 5 format. However, it can read these
files. Upon saving they will be automatically converted to Coach 6 format. Coach 5 Activities
will be automatically saved as ‘*.cma’ files, while Results will be saved as ‘*.cmr’ files.
1. Open Coach 6 in Author mode.
2. It is recommended to go to the menu Tools and unmark the option Activate hardware.
3. Click Open.
4. Set Files of Type to Coach 5 Activities & Results.
5. Open the first Activity/Result
6. Click the Save button in the toolbar.
7. Open the next Activity/Result, click Save, etc.
4. Deleting old Coach 5 files
After the whole project and its activities are converted as described above the old Coach 5 files
can be deleted. To do this proceed as follows:
1. Open the project in Windows Explorer.
2. Select View > Details. Click the column Date Modified. All older files are listed together,
this makes selection of the old files easier. Files which should be kept are:
• *.cma (icon: Coach Activity window with red C);
• *.cmr (icon: Coach Activity window with green C and 2 yellow panes);
• cmaproject.cms
• desktop.ini (hidden file)
• folder.ico (hidden file)
• All files which are referenced via links in the Web pages list or text panes.
All other files can be deleted.
246