User`s Guide Coach 7 - CMA

 User's Guide www.cma-science.nl
Copyright 2017 CMA. All rights reserved.
Information in this document is subject to change without notice. The software described in this document is furnished under a license agreement or nondisclosure agreement. The software may be used or copied only in accordance with the terms of those agreements. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or any means electronic or mechanical, including photocopying and recording for any purpose other than the purchaser's personal use without the written permission of CMA.
CMA
A.J.Ernststraat 169
Amsterdam, The Netherlands
+31 20 7600920
international@cma-science.nl
CONTENTS
CHAPTER 1 Getting Started
Welcome
First Steps
Working with hardware
Activities and Results
6
7
11
13
CHAPTER 2 Measurement
The Basics
Data Collection
Setting Up an Own Experiment
Working with Sensors
Converting Analog Sensors to Digital Sensors
22
24
31
36
40
CHAPTER 3 Control
The Basics
Program Execution
Creating Programs
44
46
48
CHAPTER 4 Data Video
The Basics
Data-Video Measurement
Preparing a New Video/Image for Measurement
Editing Video/Image
54
57
63
70
CHAPTER 5 Modeling
The Basics
Model Execution
Elements Used in Graphical and Equations Modes
Modeling in Graphical Mode
Modeling in Equations Mode
Modeling in Text Mode
Executing models in Coach
76
82
84
88
92
95
98
CHAPTER 6 Animations
The Basics
Elements of Animations
Creating Animations
102
106
121
CHAPTER 7 Working with Data
Data Table
Graph
Meter
Value
Analyze and Process Tools
124
134
142
143
144
CHAPTER 8 Learning Content
Texts
Images
Videos
Web Pages
Student Texts
158
160
162
164
166
CHAPTER 9 Coach Language
Comparison with other programming languages
Variable Names
Expressions
Statements
Functions and Procedures
Error Messages
170
171
173
177
180
187
CHAPTER 10 For Authors
User Levels
Creating Activity
Author Tools
Creating a customized programming environment
INDEX
4
192
194
198
200
CHAPTER 1
Getting Started
Welcome
6
First Steps
7
Working with hardware
11
Activities and Results
13
5
Welcome
Coach 7 is a versatile Learning and Authoring Environment for Science, Technology, Engineering and Mathematics (STEM) Education.
Coach integrates ICT tools such as data-logging, control, video and image measurement, modeling and data processing. These tools are similar to the tools, which are used by professional scientists and which facilitate inquiry-based approach to education.
As authoring software Coach offers possibilities to create teaching and learning student activities filled with texts, images, videos, and web-pages. These activities can be customized to be used by students starting at primary up to undergraduate level (age 8 to 21).
6
First Steps
The topics in this chapter will help you to start Coach and get familiar with the layout and options of the Coach main screen. Starting Coach 7 (Windows)
After installation the group CMA Coach 7 will be created in the Windows Start menu and a Coach 7 icon will be placed on the desktop. The CMA Coach 7 group has the following shortcuts:
Author: This icon starts Coach 7 in Author mode. This mode is protected by the Author key. To enter Author mode, log in with the default Author key ‘0000’. This Author key can be changed for your school via the main menu option Options > Change Author Key.
Student: This icon starts Coach and opens Activities/Results in the user level specified in the Activity/Result.
Utilities:
Firmware-update: This shortcut starts the program to update internal software (firmware) of CMA interfaces.
Mount VinciLab: This shortcut starts the program, which mounts VinciLab as network location and creates the access to the VinciLab’s user folder ‘My Files’ in Windows Explorer under Network Location.
Unmount VinciLab: This shortcut starts the program, which removes the access to the VinciLab’s user folder ‘My Files’ in Windows Explorer.
To start Coach 7
Click the Coach 7 icon on the desktop. Coach starts and will open Activities in the user level specified in the Activity.
Or
Double-click a Coach Activity file (*.cma7) or a Coach Result file (*.cmr7). Coach directly opens the selected Activity or Result in the user level specified in the Activity.
Or
Click on the Start button (Windows Start menu). Select All Programs and hence CMA Coach 7. Next click on one of icons as described above.
When Coach 7 is started the first time it asks to specify:
the preferred language of the Coach user interface - select the language from the list. Notice that the user interface language can also be set in Coach via the main menu option Options > Switch Language (present only in Senior student and Author modes).
the license information - type in your License Name and License Code exactly as they appear in your License document. Confirm with OK. Notice that this is done per user; if another user will start Coach again he/she will be asked to enter the license information again.
Starting Coach 7 (MAC)
To start Coach 7
Click the Coach 7 App (by default located) in Applications.
When Coach 7 is started the first time it asks to specify:
the preferred language of the Coach user interface - select the language from the list. Notice that the user interface language can also be set in Coach via the main menu option Options > Switch
7
Language (present only in Senior student and Author modes).
the license information - type in your License Name and License Code exactly as they appear in your License document. Confirm with OK. Notice that this is done per user; if another user will start Coach again he/she will be asked to enter the license information again.
Coach starts and will open Activities in the user level specified in the Activity.
To start Coach 7 in Author mode
Start Coach 7 App.
Press the Login button in the Main toolbar.
Select Author in the user level drop-down list.
Type in the Author key. The default Author key is ‘0000’. This Author key can be changed for your school via the main menu option Coach 7 > Change Author Key.
Confirm with OK. From now on all Activities will be opened in Author mode.
To start Coach 7 in Senior Student mode
Start Coach 7 App.
Press the Login button in the Main toolbar.
Select Senior student in the user level drop-down list.
Confirm with OK. From now on all Activities will be opened in Senior student mode.
Main Screen
After opening Coach the Main Screen appears. This screen is divided into several parts:
TITLE BAR
Contains the name of the current selected folder and the name of the current opened file.
MENU BAR
Contains bar with menu options, not all options are available for all user modes. This menu is only present when Coach is opened in Author or Senior-student mode. Menu options in Coach for Windows are organized slightly different than in Coach for Mac. Options: Author
Key Settings, Preferences and Switch Language are located on Windows under the menu option Options and on Mac under the menu option Coach 7. The Quit Coach 7 option is on Windows under the menu option File and on Mac under Coach 7.
Some menu options are only available in Author mode. These are indicated with an *.
File
New – to create a new Activity *
Open – to open an Activity/Result Open CMA Coach Projects – to open one of the example Activities/Results that are distributed with Coach 7
Login – to login as Author or Senior-Student
Quit Coach 7 – to exit Coach
Options
Preferences – to set project location on starting Coach *
Author Key Settings – to change author key settings *
8
Switch Language – to switch the language of Coach interface
Tools
Hardware Settings – to specify settings for some interfaces
Activate Hardware – to activate/deactivate communication to an interface *
Help
Help – to start Coach Help (online)
CMA Website – to go to the CMA website
About Coach 7 – to show some information about Coach 7, including the version number
Author specific options are described in the part ‘For Authors’.
MAIN TOOLBAR
Appears directly under the menu bar and contains buttons for quick access of some options. The Main toolbar consists of the following buttons:
Exit – to close Coach 7
Open – to open an Activity/Result
Open CMA Coach Projects – to open one of the example Activities/Results that are distributed with Coach 7
New – to create a new Activity (only in Author mode)
Hardware Settings – to specify settings for some interfaces
Login – to login in as Senior student or Author
Help – to consult Help
STATUS BAR
Shows Coach 7 version and owner’s name and the actual selected user level (left corner).
Hardware Settings
The Hardware Settings option allows to configure the settings of some interfaces, e.g. the serial port number that an interface is connected to (older models of the CoachLab II+ interface) or an IP-address for wireless communication (the VinciLab interface).
To configure hardware settings:
Click the Hardware Settings button.
Under the header Interfaces, select the interface.
Adapt the interface settings where needed.
9
Login
Login allows forcing Coach to ignore the student-user level defined in the Activity/Result and to open Activities/Results always in Senior-student or Author mode.
To login:
Click the Login button.
In the User level drop-down list as default is shown Default Activity user level.
Select Senior student – to open Activities/Results in Senior student mode.
Select Author – to open Activities/Results in Author mode. Notice that Author mode is protected with a password key. Type in the correct Author key to enter Author mode.
You can always return to the default settings by selecting Default Activity user level.
Help
Use the Help button to obtain assistance while using Coach.
Click Help button to start the Help system.
Specific help can be found by selecting the Help option available in the Tool menus or clicking the Help button available in some Coach dialogs.
Language of the Coach user interface
It is possible to change the default language of the Coach user interface.
To switch the user-interface language:
Select the main menu option Options > Switch Language. A sub-menu appears listing all installed languages. The current used language is marked.
Check the desired language.
On Windows computers Coach automatically restarts and opens in the selected language. On Mac computers you have to manually restart Coach. 10
Working with hardware
When using Coach for data collection and control you work with hardware: interfaces, sensors and actuators. Supported Interfaces
To be able to collect data or to control devices you must connect an interface to your computer. Coach supports the following CMA interfaces:
€Sense (Windows and Mac OS)
€Lab (Windows and Mac OS)
€Motion (only Windows)
CLAB (Windows and Mac OS)
CoachLab II+ (Windows and Mac OS)
MoLab (only Windows OS)
VinciLab (Windows and Mac OS)
Starting from version Coach 7.3 Coach supports the Internal Microphone. It allows measurements on the default sound recording device on your PC or MAC. Supported Sensors
Coach supports the following types of sensors:
BT TYPES OF SENSORS
These sensors are equipped with British Telecom-style plug (a right-hand connector for analog sensors, and a left-hand connector for digital sensors) and work with €Lab, CLAB, CoachLab II+ and VinciLab. Coach supports all CMA sensors, but also many Vernier, Texas Instruments and CASIO BT sensors. Modern BT sensors are equipped with a sensor memory (EEPROM) and are automatically recognized when connected to an interface. The sensor information stored in EEPROM is by default used in Coach for these sensors. For BT sensors, which are not automatically recognized the sensor has to be manually selected from the Coach Sensor Library.
4-mm TYPES OF SENSORS
These sensors are equipped with 4-mm style banana plugs, they are older CMA sensors and can be connected directly to CoachLab II+ or via ‘4-mm to BT adapter’ to analog BT inputs of €Lab, CLAB, CoachLab II+ and VinciLab. These sensors are never automatically recognized and have to be manually selected from the Coach Sensor Library.
ML TYPES OF SENSORS
These sensors are equipped with 5-pin mini jack and work only with MoLab. These sensors are always automatically detected and the sensor information stored in the sensor memory is used in Coach.
Sensor Input Ranges
For many of the sensors defined in the Coach Sensor Library additional calibrations are present, these calibrations are called Sensor Input Ranges and can be selected if needed.
Supported Actuators
Coach supports a number of actuators (1-bit actuators, 2-bits actuators and stepper motors), which can be connected via 4-mm wires to control outputs of CoachLab II+. These actuators have to be manually selected from the Coach Actuator Library. Make sure that the selected actuator is correctly selected for the real connected 11
actuator, e.g. when you connect 3V-bulb then select 3V-lamp from the Actuator Library, selecting 12V-lamp will cause burning of the connected 3V-bulb.
Connecting an Interface
Before you start to use your interface with a computer we strongly recommend to first install the Coach program on your computer. In most cases the driver installation is automatically executed the first time your interface is connected to your computer. Wait until the information that the driver was installed successfully appears. If the driver is not automatically installed or not successfully installed the driver has to be installed manually. For details about interface driver installation consult the User’s Guide provided with your interface.
For older models of CoachLab II+ and €Motion additional low-level drivers are needed, these drivers can be downloaded from the CMA website. Most interfaces use a USB connection; some of them can also communicate wirelessly e.g. VinciLab.
To connect an interface via a USB port
If needed, connect power to your interface using its power supply.
If needed, turn on the interface.
Connect the interface to your computer using the supplied USB cable.
To connect an interface for wireless communication (e.g. VinciLab via wi-fi)
Turn the interface on.
Click the Hardware Settings button to open the Hardware Settings dialog.
Select an interface, its settings appear.
Select its wireless connection.
Provide the IP address (for Wi-Fi) or a number (for Bluetooth) of the device you want to connect to.
Click OK.
You can connect more interfaces at the same time to your computer (it is not recommended) but you can use only one interface at the time for measurement or control in Coach (with exception for €Lab and €Motion which can be used together).
12
Activities and Results
Activities (*.cma7 files) are teaching and learning materials created by Author users for Student users. Student users work with activities, perform experiments, make calculations, execute or create models and make reports. Student users cannot overwrite the Activities made by Author, they save the results of their work in Results (*.cmr7 files).
The topics in this chapter will help you to get familiar with the layout and options of the Activity/Result screen.
Opening an Activity or Result
Several example CMA Activities are stored in the folder ‘CMA Coach Projects’. Users can store their Activities/Results anywhere on the computer.
To open an Activity/Result:
Press the Open button to open any activity. Or: Press the Open CMA Coach Projects Coach 7.
button to open one of the example activities provided with Browse in the dialog to the desired Activity or Result. Click Open. Activity Screen
After opening an Activity/Result the Activity Screen appears. This screen is divided into several parts:
TITLE BAR
Shows the name of the current opened Activity/Result.
MENU BAR
Contains bar with menu options. Not all options are available for all user levels.
MAIN TOOLBAR
Appears directly under the menu bar and contains buttons for quick access.
PANES
Windows fixed in the area between the toolbar and the status bar. Different Coach objects, such as Graph, Meter, Value, Text, Animation, Image, Video, Web-page and Student text, can be placed in these panes.
APPLICATION WINDOWS
Windows, which display special Coach objects, such as Data Table, Interface, Program, Model and Data Video, with tools for doing science. These windows can be placed on the top of panes or can be docked into panes.
STATUS BAR
Shows Coach 7 version and owner’s name and the actual selected user level (left corner).
13
Activity Menu
Some menu options are only available in Author mode. These are indicated with an *.
File
New – to create a new Activity *
Open – to open an Activity/Result
Open CMA Coach Project – to open one of the example Activities/Results that are distributed with Coach 7
Close – to close an opened Activity/Result
Save – to save an opened Activity/Result
Save as – to save an opened Activity/Result to a specific location on your computer with a specific name
Save for MoLab/VinciLab – to save an opened Activity/Result in format suitable for MoLab/VinciLab. Then you can opened such activity in Coach running on MoLab/VinciLab. Print – to print the Activity/Result screen
Printer Setup – to set up a printer
Quit Coach 7 – to exit Coach
Display
Screen Layout – to change the panes layout
Graph, Meter, Value, Text, Image, Video, Web Pages, Student Text – to display a respective object in a pane
Tools
Settings – to open the Setting dialog
Activity Options – to open Activity Options dialog
View As – to view an Activity as a student user defined in the activity options *
Activate Hardware – to activate/deactivate communication to an interface *
Help
Help – to start Coach Help (online)
CMA Website – to go to the CMA website
About Coach 7 – to show some information about Coach 7, including the version number
Author specific options are described in ‘For Authors’.
Activity Toolbar
The toolbar provides quick access to main tools of Coach. Some of the buttons will appear and disappear in the toolbar depending on the User mode or Activity type. Below an overview of all buttons, which can appear in the Activity Toolbar.
Exit – to close the activity and return to Main screen
Open – to open an Activity or Result file
Open CMA Coach Projects – to open one of the example Activities/Results that are distributed with Coach 7
14
Save as – to save an Activity (Author mode, *.cma7 file) or Result (Students modes, *.cmr7). You will be prompted to enter a file name and location
New – to create a new Activity (Author mode)
Print – to print the whole Coach screen
Interface – to Show/Hide the Interface window with a screen image of the used interface. Here sensor/actuator icons of sensors/actuators connected to the interface are displayed
Program – to Show/Hide the Program window, in this window programs are edited or created
Model – to Show/Hide the Model window, in this window models are edited or created
Data Video – to Show/Hide the Data-Video window, in this window video or image measurements are made
Data Table – to Show/Hide the Data Table window, in this table all available variables and their data are displayed
Settings – to open Measurement, Control or Model Settings dialog
Send Settings – to send experiment settings to a data-logger
Start – to start a measurement, video or image measurement, program and model execution. Each time the button is pressed a new run is added to the Data Table
Stop – to stop a measurement, video or image measurement, program and model execution
Start a manual measurement – to start a manual event
Stop a manual measurement – to stop a manual event
Replay – to replay the latest run at a selected rate
Get Data – to upload the measurement data from a data-logger to Coach
Graph – to select a graph for display, or to add a new empty graph
Meter – to select a meter for display
Value – to select a value for display
Text – to select a text for display, or to add a new empty text (only Author mode)
Image – to select an image for display or to add a new Image
15
Video – to select a video for display, or to add a new video
Webpage – to select a webpage for display or to add a new webpage
Student Text – to select a student text for display, or to add a new empty student text
Help – to open a help item
Activity Panes
Panes take up most of the Activity screen. They are located between the toolbar and status bar. A Pane can be empty or it can display a Coach object. It has its own Tool menu available via the Tool menu button or by right-clicking the pane.
To resize a pane
Place the cursor over a vertical pane divider, the shape of the cursor changes into tical line left or right, the pane will adjust accordingly.
. Drag the ver-
Place the cursor over a horizontal pane divider, the shape of the cursor changes into horizontal line up or down, the pane will adjust accordingly.
Each pane can be maximized to fill the whole screen by using its Maximize . Drag the button.
To create a new pane or to remove a pane
Place the cursor over the upper horizontal line (the line between the toolbar and panes), the shape of the cursor changes into . Drag the horizontal line downwards to create a new pane.
Place the cursor over the bottom horizontal line (the line between the panes and the status bar), the shape of the cursor changes into . Drag the horizontal line upwards to create a new pane.
Place the cursor over the left vertical border line, the shape of the cursor changes into vertical line rightwards to create a new pane.
Place the cursor over the right vertical border line, the shape of the cursor changes into vertical line leftwards to create a new pane.
. Drag the . Drag the If a pane divider is dragged back towards the borders of the Coach screen, the pane disappears.
To change panes layout
You can change your panes layout manually on the screen by resizing panes, creating new or removing not needed panes.
Coach offers a selection of predefined layouts: click the menu option Display > Screen Layout and select a desired layout.
To move a pane content into another pane
Click a caption of the pane, which content you want to move.
16
Start to drag the caption, the cursor changes into an object icon, drag the icon further into a pane, in which you want to display the content, until the pane is selected. Release the icon.
To fill an empty pane
Right-click an empty pane and select an object you want to display. or
Click an object toolbar button (Graph, Meter, Value, Animation, Text, Image, Video, Web-page, Student text). All predefined items of the selected object will be listed.
Select the desired item.
The cursor changes into the object icon, drag the icon into a pane, in which you want to display it and click this pane.
To replace the content of a pane
Click an object toolbar button (Graph, Meter, Value, Animation, Text, Image, Video, Web-page, Student text). All predefined items of the selected object will be listed.
Select the desired item.
The cursor changes into the object icon, drag the icon into a pane, in which you want to display it and click this pane.
or
Move an object from another pane into the pane.
To copy a pane content into the clipboard
Right-click a pane which content you want to copy or click its Tool menu button and select Clipboard Copy.
When copying a graph to the clipboard its zoom information, scan information and comments are copied along. A graph is always exported as a picture.
When copying the data 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.
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 can also be copied to the clipboard using text edit options or keys (Cut (<Ctrl>+<X>), Copy (<Ctrl>+<C>) and Paste (<Ctrl>+<V>).
To print a pane
Right-click a pane to be printed or click its Tool menu button and select Print.
When printing a video, only the current, visible, frame is printed.
You can also print the whole Coach screen by using the Print button or <Ctrl>+<P>.
To empty a pane
Click the Close button (cross in right corner of the pane caption). 17
Application Windows
Application windows are windows, which offer special Coach objects with tools for doing science. The following objects are available:
Data Table – this window is present in all types of activities and displays activity variables and their data.
Interface – this window is present in the Measurement and Control types of Activities and displays the interface image to which sensors and actuator icons are connected.
Program – this window is present in the Control and Measurement (with Program) types of Activities and offers a programming environment for working with programs.
Data Video – this window is present in the Data-Video type of activities and offers the tools to make video or image measurements.
Model – this window is present in the Modeling type of Activities and offers a modeling environment for working with models. The application windows can be toggled on/off by using their respective activity toolbar buttons. By default the application windows are undocked and are displayed on the top of panes. However these windows can be docked into panes.
To dock/undock an application window:
Right-click an undock application window (Data-Table, Interface, Program, Model or Data-Video) and select Dock. Undock windows do not have the Tool button, you have to right-click an undock window to open its Tool menu.
The cursor changes into the icon of the selected object. Move the icon above a pane in which you want to place it and click it.
To undock the window select its Tool menu option Undock.
Activity Objects
Coach offers the following objects, which can be divided into three groups.
I. Objects, which offer tools:
Interface – to measure with sensors via a connected interface
Program – to create and use programs, including programs which control actuators via connected interfaces
Data Video – to measure on videos and images
Model – to create and use dynamical models
Animations – to create and use animations.
II. Objects, which allow to work with data:
Data Table – to display and process data in the table (only one global table per activity)
Graphs – to display and process data in graphs
Meters – to display data on meters
Values – to display data as large digits.
III. Objects, which help to create multimedia learning content:
Texts – to display texts prepared by Authors for Students
Images – to display images
Videos – to display videos
18
Web-pages – to display Web-pages or other documents like pdf or word
Student texts – to write notes and reports by students.
Managing Results
A Coach Result (*.cmr7 file) 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 etc.
To open a Result file
Press the Open button.
Browse to the desired Result (*.cmr7) file.
Click Open.
To save a Result file
Press the Save as button.
Enter the name of your Result file.
Click Save.
Author and Senior-student users can also open or save a Result via the File menu option..
To delete a Result file
Delete the file in your computer. or Click the Open button.
Browse in the dialog to the desired Result (*.cmr7) file.
Delete the file.
19
20
CHAPTER 2
Measurement
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 measurement results.
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 the 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, the most often used are time-based measurements, in which data are collected at regular time intervals defined by the sampling frequency. Other methods of measuring are event-based measurement, in which data are collected each time a pulse (event) is received on a sensor input, and manual measurement, in which a single data point is collected every time the user presses a button. This method also allows to type in data via the keyboard.
Coach is also able to do measurements of time intervals, counting and frequency. This is accomplished by means of a special mode in which analog sensors are ‘converted’ into digital sensors to measure pulses or time-intervals.
The Basics
22
Data Collection
24
Setting Up an Own Experiment
31
Working with Sensors
36
Converting Analog Sensors to Digital Sensors
40
21
The Basics
The topics in this chapter will help you to get familiar with the Interface window. Interface Window
The Interface window displays the screen image of the used interface and offers options to work with sensors and actuators. There is only one such window in a Coach Activity/Result and it is available not only in Measurement but also in Control Activity.
To display/hide the Interface window
Click the activity toolbar button Interface
to show the Interface window.
Click the activity toolbar button Interface
to hide the Interface window.
By default the Interface window is placed on top of the Coach panes.
Interface Screen Image
The screen image of the interface is a clickable image of the used interface. It shows inputs for sensors, and for some interfaces, like CoachLab II+, outputs for actuators, just like the connectors on the real interface. These areas are sensitive (called hot spots) and can be clicked to open specific .Tool menus.
Interface Tool Menu
The Interface Tool menu is available after clicking the Tool menu button in the Interface window (only when the Interface window is docked). Also some areas of the Interface are sensitive (hotspots) and show a different tool menu.
Tool menu or any other area of the Interface window but not a hotspot
Sensor Settings – to open Sensor Settings which gives an overview of all sensor connections
Change Interface – to change an interface used for measurement, here only detected interfaces are displayed
Reset Interface – to renew the communication to the interface
Dock/Undock – to dock and undock the Interface window
Print – to print the Interface window Clipboard Copy – to copy the interface (image) to the clipboard
Help – to consult a help system
Hotspot: an empty sensor input
Display as > Graph, Meter, Value – to display measured sensor values on a standard graph, meter or value
Sensor Settings – to open the Sensor Settings dialog, which gives an overview of all sensor connections
Choose a Sensor – to manually select a sensor from the Sensor Library
Create a New Sensor > 0 .. 5 V, -10 .. 10 V (present only for analog sensor inputs) – to create a new sensor, the correct sensor voltage range should be selected
Enable (present only for internal sensors) – to enable an internal sensor
Hotspot: a sensor icon connected to an input
Display as > Graph, Meter, Value – to display measured sensor values on a standard graph, meter or value
22
Sensor Settings – to open the Sensor Settings dialog which gives an overview of all sensor connections
Set Input Range – to set a sensor input range (calibration)
Set to > Zero or Value) – to set an actual measured value to zero or to another value
Calibrate – to calibrate a sensor
Remove – to remove a sensor Exchange (present only when another than predefined sensor is detected) – to change a predefined sensor to a detected sensor
Replace (present only when sensor is detected or if is a sensor defined) – opens the Coach Sensor Library to allows selecting a sensor from the library. Help – to consult a help system
23
Data Collection
The topics in this chapter will help you to learn how to connect interface and sensors, how to modify measurement settings, and how to perform different types of measurements. How to connect an interface
Before you start the data collection you have to connect your interface to your computer and, if needed (for example for a wireless communication), configure the software to the hardware settings via the Hardware Settings option.
Automatic Interface Detection
Measurement and Control Activities/Results store information about the interface with which the Activity/Result is made. This ‘’default’’ interface is initialized during opening of an Activity/Result. When Coach is not able to communicate with this default interface then it automatically checks if any other interfaces are connected to the computer. If:
A. one other interface is detected then the Activity/Result opens and converts the default interface to the detected interface and tries to match the sensor connections.
B. more than one interface is detected the last one used in Coach will be chosen. In case there is no ‘’last one’’ a list with all detected interfaces is shown with the question which interface should be used. After selecting the desired interface the Activity/Result opens and converts the default interface to the selected interface and tries to match the sensor connections. Note: in case you want to change the interface used, right-click the interface image in the Interface window and select the option Change Interface. Select the desired interface from the list of detected interfaces.
In case the sensor connections cannot be matched, e.g. the default interface uses 3 sensor inputs but the detected interface has only 2 inputs, or the detected interface offers less measurement possibilities, then Coach will warn about possible problems and you probably have to make some adaptations.
In case an Activity/Result consists of data the automatic interface adjustment is not executed. Coach only tries communication to the default interface and when this interface is not detected then its behavior is as described below.
When Coach is not able to detect any interface then a communication error message is displayed which shows three or four buttons.
Abort – click to cancel opening the Activity/Result.
Retry – click to retry to activate the interface again.
Ignore – click to open the Activity/Result in which the default interface will be inactive. In this situation real measurement and control are not possible, no values and states are shown on sensor and actuator icons, but it is possible to work with data.
Select Other – click to select another interface (this button is not always available).
Lost Communication
The communication between the interface may also be lost while 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.
To reset the interface
Right-click the interface image (but not on its inputs and outputs) and select Reset Interface.
24
If this does not help, first hard reset the interface (for CoachLab II/II+, disconnect and reconnect the power supply) and try Reset Interface again.
If this does not help, close and open the Activity again.
How to manage sensors
In Coach sensors are represented by the sensor icons. In some Measurement Activities/Results sensors are already set-up for measurement, their sensor icons are placed on the sensor inputs. After opening and successfully communicating with an interface Coach checks if the sensors, which icons are set are physically connected to the interface. If this is not the case Coach tries to match the sensors as good as possible .
Selecting Sensors from the Sensor Library
Sensors which are not detected, e.g. older type of sensors, can be selected from the Sensor Library.
To select a sensor icon manually
Click an empty sensor input on the screen interface and select Choose a Sensor.
Select the desired sensor from the sensor list and click OK to accept it. Since the list consists of many sensors you can sort them on their name or brand name.
The sensor icon will be placed on the input and the actual data measured by the sensor will be displayed on the icon.
Additionally in the Sensor Library there are two sensor icons which do not correspond to real sensors: Voltmeter (0 .. 5 V), and Voltmeter (-10 .. 10 V). These Voltmeter icons are kind of "generic" sensors, which measure a (un-calibrated) voltage signal. Please notice that when using CMA Adapter 0519, only voltages between 0 .. 5 V can be measured.
Connecting Sensors
After a sensor is physically connected to the "active" interface then the following can happen:
1. When a sensor input of the interface image in Coach is empty, then:
A sensor icon automatically appears on the sensor input where Coach identifies the connected sensor.
Nothing changes because Coach is not able to identify the connected sensor e.g. it is an older CMA sensor not equipped with Auto-ID resistor or EEPROM memory. For such sensor its sensor icon has to be selected manually from the Sensor Library.
2. When a sensor input of the interface image in Coach is not empty because a predefined sensor is already set up, then:
When the physically connected sensor is the same as the predefined sensor icon then live readings appear on the sensor icon.
When the physically connected sensor belongs to the same family of sensors as the predefined sensor then Coach automatically adapts the sensor icon to the icon of the sensor, which is physically connected. For example if the predefined sensor is Temperature sensor 0511 but the real connected sensor is Temperature sensor BT84i then the icon of 0511 will be automatically replaced by the BT84i sensor icon. This is because both sensors belong to the same family of temperature sensors; they both measure temperature.
When the physically connected sensor is different then the predefined sensor icon and Coach is able to identify the connected sensor, then the sensor icon does not show any live readings. The yellow tip shows information that the identified sensor is different than the predefined sensor. In such case connect the defined sensor or change the predefined sensor into the detected sensor by selecting Exchange.
25
When the physically connected sensor is different then the predefined sensor, and Coach is not able to identify it, then the sensor icon does not show any live readings. The yellow tip shows information that there is no sensor connected. In such case connect the defined sensor or remove the predefined sensor by selecting Remove.
When a sensor icon is present on an input the sensor info is displayed in the yellow tool tip when the mouse cursor is placed over the sensor icon. This tool tip displays the sensor’s name, article number, brand, the measurement range e.g. Temperature sensor (BT84i) (CMA) (-18 .. 110°C).
When a sensor is successfully connected its sensor icon shows live data measured by the sensor. These live readings are not stored in the Coach.
Disconnecting Sensors
After a sensor is physically disconnected from the "active" interface the following can happen:
The detected sensor automatically disappears.
The manually selected icon remains on the input and stops to display live readings. The sensor icon has to be manually removed.
To remove a manually selected sensor icon
Click the icon of the manually selected sensor and select Remove.
The sensor icon will be removed from the input (in case no sensor is detected).
Setting up Internal Sensors
This is only available for interfaces that have internal, built-in sensors.
To enable an internal sensor click its empty sensor input on the screen interface and select Enable [name of the sensor].
To disable an internal (built-in) sensor click its sensor icon and select Disable.
Overview of Sensor Connections
The screen image of the interface uses icons to visually show the sensor connection. Another way to get a complete overview of sensor connections is the option Sensor Settings. This option gives an overview of sensor inputs, displays the sensor settings and allows sensor setup of connected sensors. The dialog has tabs for each sensor input, and if an interface has built-in sensors, also for its internal sensors.
When a sensor is automatically detected or selected from the Sensor Library then all its settings are automatically loaded and displayed on the respective sensor input tab.
To edit sensor settings
Click a sensor tab, e.g. A1 for VinciLab, to display the current settings of the sensor connected to the sensor input A1.
Sensor: displays the name of the connected sensor or None if there is no sensor connected or identified. To manually set up the sensor click Choose and select a sensor from the Sensor Library.
Enabled (appears only for internal sensor):
Select Enabled when you want to activate the sensor.
Deselect Enabled when you do not want to measure with the sensor.
Range: displays the default input range (calibration) of the sensor. Many sensors have multiple ranges. 26
Click the drop down list to choose another range. The calibration stored in the sensor’s memory is indicated by ‘EEPROM’.
Use as: displays the mode in which the sensor works. The following modes available: Analog sensor, Counter, Digital sensor (1-bit), Frequency meter and Time-interval meter. Most sensors are used by default in Analog mode.
To change the sensor mode click the drop down list and select the desired mode.
Specify the conversion settings where needed.
Use Set to zero or Set to value to shift the provided sensor calibration.
Use Calibrate to calibrate the sensor. Via Reset the user calibration will be reset to the original calibration.
Current value: displays the actual value measured by the sensor.
Note: Some options might be not available for certain interfaces, e.g. €Lab does not support Frequency meter and Time-interval meter. See Users’ Manuals of respective interfaces.
How to modify measurement settings
The exemplary measurement activities provided by CMA are ready for measurements. The measurement time interval, sampling frequency or the number of samples, are already set up for data collection. However these parameters can be modified.
To modify measurement settings
Click the activity toolbar button Measurement Settings .
For the Time-based measurement type:
Enter the Measuring time, type in the duration of the measurement and select the unit from the dropdown list (default 10 s).
Enter the frequency of the measurement. Type in the sampling rate and select the unit from the dropdown list (default 50 per s).
The Number of samples is automatically calculated from the settings of the fields above. The actual measured number of samples is usually the shown number plus 1, because the measurement starts at time t=0. It is also possible to enter the desired number of measurements. In this case the measuring time will be adapted. The maximum number of points in Coach is 500,000.
For the Event-based measurement type:
Enter the Number of samples.
If needed re-define the threshold and the direction of the signal. For the Manual measurement type:
Enter the Number of samples.
How to do a measurement
After a Measurement Activity/Result has been opened, the interface is active and the sensors are properly connected/identified/manually selected - their live readings are shown on the sensor icons, you are ready to start a measurement. The measurement will be executed according to the measurement settings.
27
Click the activity toolbar button Measurement Settings to check the measurement settings. They will depend upon the type of measurement selected for the activity. If desired change the default settings.
To start collecting data click the activity toolbar button Start .
In most cases, Coach directly starts the measurement and data are displayed in the Data Table and on predefined Graphs, Meters and Values.
If triggering is enabled then the measurement is started automatically when the trigger conditions are met. To manually start the measurement when Waiting for trigger conditions click Trigger . When the type of measurement is set to Manual then the Manual Start button appears in the activity toolbar. Press this button to collect a single measurement. When a keyboard input is specified then the value of one or more quantities has to be typed in. When a counter is used, pulses can be counted during a certain time interval after a button press.
The measurement stops when the specified measurement time or specified number of samples has been reached. If you want to interrupt the measurement process click the activity toolbar button Stop
.
To replay measurement click the activity toolbar button Replay , set the replay speed (default real-
time) or specify the time interval in which the measurement should be replayed and click Start Each time you click the activity toolbar button Start measurement run is added to the.Data Table. .
, the data collection starts again and a new Once you have collected your data you can analyze and process the data.
Save your results via the activity toolbar button Save As .
If you have already collected data, then disconnecting a sensor from the interface will bring up a question about what to do with the collected data. If you want to keep the data, answer the question with Yes, then data are not deleted from the table, but the "inactive" sensor icon remains on the screen interface. Answering with No will definitely delete all data.
How to do off-line measurement
Off-line measurement mode allows you to set up a data-logger such as CLAB for collecting data away from the computer. After performing the data collection you have to reconnect the data-logger to your computer to retrieve the data.
In the Activities for off-line measurement the activity toolbar shows two extra buttons: the Send Settings button and the Get Data button .
Open an Activity/Result for off-line measurement e.g. when working with the CLAB data-logger.
Click the Send Settings button to send the experiment settings to the data-logger.
Now you can disconnect the data-logger from the computer and perform your measurement. The collected data are stored in the data-logger.
When the measurement is finished reconnect the data-logger to the computer.
28
Open the Coach Activity from which the experiment settings were sent.
Click the Get Data button to transfer the collected experiment data into Coach.
How to do a measurement together with video capturing
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 real-time. The capturing is done in a Video pane available through the 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.
The video capture can be synchronized with the measurement i.e., it starts automatically when the Start button is pressed, and stops when the measurement is finished or the Stop button is pressed. When the Synchronized Capture option is not marked then the measurement and capture process are started separately.
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 (by default off). Notice that the Record button becomes disabled.
Specify the capture settings. The maximal capturing time is disabled. This time depends on the selected type of measurement and is set automatically.
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 Start button to start the measurement/capture process.Coach measures and 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 Stop button or press <Esc>. The measurement/capture stops when the measurement process is finished. Then the Video-Capturing window is automatically closed and the recorded file with the name REC# is placed in the Video pane. Depends on the video size this process may take a few moments.
For recorded 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. 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.
The measurement activity can consists of more videos but only one video can be synchronized with the latest measurement run. When a new measurement run with synchronized capture is performed (the Capture option has to be selected again) then a new video together with a new measurement run are registered. The previously recorded video is added to the list of videos available in the activity.
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 of selected deselect Synchronized Capture.
29
Specify the capture settings. Click the Record button to start the capture and click the Start button 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.
How to replay a measurement synchronized with a video
After a measurement is completed, it is possible to replay it. The replay of the measurement can be synchronized with a video located in a Video pane.
To replay a measurement synchronized with video
Click the Video button and select the desired video or use a captured 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 video click the Adjust Synchronization option and specify the time interval between the beginning of the video and the moment when the first measurement sample is collected. Mark after video starts if your video starts the given time interval after the measurement is started or mark before the video starts 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.
To replay measurement click the activity toolbar button Replay
, set the replay speed (default realtime). 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 graph (via the Scan option) Coach shows the corresponding video frames of the connected video.
30
Setting Up an Own Experiment
Before you can set up your own experiment you need to: 1. and depending on the selected mode setup your measurement 1. connect an interface,
2. connect sensors,
3. select an appropriate measurement mode, 4. and depending on the selected mode setup your measurement: a time-based measurement, an event-based measurement or a manual measurement.
In this chapter all these steps are described in details. Selecting Appropriate Measurement Mode
Coach offers three methods of measurement: time-based, event-based, and manual. Select an appropriate method for your experiment.
TIME-BASED MEASUREMENT
During the time-based measurement, measurements are taken at regular time intervals according to the defined sampling frequency rate. A measurement is started with the activity toolbar button Start. A measurement is finished when its measurement time interval has elapsed. Most measurements are of this type.
Examples of time-based measurements are:
measurement with a temperature sensor of 100 values during 10 seconds (i.e. a sampling frequency of 10 Hz, or
measurement with a sound sensor 0.2 s long with a sampling frequency of 40,000Hz.
This measurement type can also be used with sensors converted into counters or time-interval meters.
For very short measurements or when you want to start a measurement under specific conditions (e.g. when it becomes dark), you can start the measurement automatically by using the triggering option. The trigger conditions (the trigger level and direction) determine the state of the signal on the trigger channel to automatically start the measurement. Sometimes the signal just before the moment of triggering is also relevant. Registration of this part is possible when a pretrigger time is used.
The trigger conditions are indicated by an arrow on all graphs axes to which a trigger channel has been attributed. The data obtained during the pretrigger time is also displayed.
Additionally a time-based measurement may be executed off-line. This means that during the data collection the interface may be disconnected from the computer.
EVENT-BASED MEASUREMENT
During an event-based measurement, data are taken each time a pulse (event) is received on a sensor input. A measurement is started with the activity toolbar button Start. A measurement is finished when the given number of samples has been reached.
Examples of event-based measurements:
Titrations: the droplets falling through a light gate generate pulses, the pH is measured;
Measuring distance with a smart pulley: the spokes of the smart pulley generate pulses, the distance and/or time is measured;
Measuring time intervals of a falling ladder with equidistant holes.
Use a light sensor converted to time-interval meter. Adjust the threshold to a suitable value and set the 31
interval type to 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 time-interval 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.
MANUAL MEASUREMENT
During manual measurement a single measurement is taken every time the button is pressed. This includes the following type of measurements:
Measurement with sensors – the sensor readings are taken when the Manual Start button pressed.
is Measurement with keyboard input - the values of one or more quantities have to be entered when the Manual Start button is pressed.
Measurements with sensors and keyboard input (combination of 1 and 2) – the sensor readings are taken and the values of one or more quantities have to be entered when the Manual Start button pressed.
is Measurement with a counter - pulses can be counted during a certain time interval after Manual Start button is pressed.
Examples of manually triggered measurements:
Boyle’s law – measuring the pressure value with a pressure sensor and typing in the respective volume value
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.
Setting up a Time-Based Measurement
1. Click the activity toolbar button Settings and select the Time-based type of measurement.
2. 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).
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. The actual measured number of samples is usually the shown number plus 1, because of the measurement at time t=0. It is also possible to enter the desired number of measurements. In this case the measuring time will be adapted. The maximum number of points in Coach is 500,000.
A message Triggering is enabled shows up 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 32
sample time interval (specified by the frequency). This option (default off) is not available for offline measurements.
3. 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 at which the computer automatically starts a measurement.
Select the Trigger channel. This channel will be checked for the 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.
4. If you want to repeat your measurement automatically 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 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).
Notice that when "repeat" is used, the resulting data set 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.
Setting up an Event-Based Measurement
1. Click the activity toolbar button Settings
and select the Event-based type of measurement.
2. In the tab Method:
Enter the Number of samples, which will be measured. This number also determines when an event-based measurement will stop.
Select the Event source - the sensor input, which delivers the pulses. By default the lowest numbered input is chosen which has a counter connected to it. If no counter is connected then the lowest numbered input, which has an analog sensor connected to it, is chosen.
The Threshold option is active if the event source is an analog sensor; the default threshold is 50% of the calibrated scale. If the source is already an analog sensor used as counter or as 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:
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.
33
a digital sensor, the default threshold is set at the state which approximates 50% of the state values and direction is up.
3. The More button reveals a pane with the following advanced options:
When t=0 at first event is checked 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 one out of every five events results in a measurement.
4. If you want to repeat your measurement automatically 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 used.
will be 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.
Notice that when a repeat is used, the resulting data set 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.
Setting up a Manual Measurement
1. Click the activity toolbar button Settings
and select Manual type of measurement.
2. In the tab Method:
Enter the Number of samples that 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 activity toolbar button Start will become the first measured point (default=on). If unchecked, no measurement will be taken upon pressing this button, but only on pressing the Manual Start button .
3. The More button reveals a pane with the following advanced options:
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 the 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.
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.
4. If you want to use the keyboard input during the measurement click the Input tab and define the keyboard inputs.
34
Select the number of variables for the keyboard input(s) (maximum 4).
Specify Quantity, Unit and number of Decimals for each variable.
Click OK. The variables defined for the keyboard inputs will be automatically added to theData Table.
Setting Appropriate Measurement Settings
Sampling frequency
Several factors usually compete for selecting an appropriate sampling rate. Your aim is to sample fast enough to capture important changes in the measured signal. Few examples:
1. The temperature signal changes rather slowly, a sampling frequency of 4 Hz or 2 Hz (4 or 2 times per second) is sufficient for temperature measurements.
2. Such low sampling frequency will be absolutely not sufficient for a rapidly changing sound signal. Here the sampling frequency of 20,000 or 40,000 measurements per second is needed otherwise important signal information may be lost.
Another limitation for the sampling frequency is the used interface. Each interface has its own maximum sampling frequency, which also might depend on the number of channels used during the data collection. For example for the CLAB interface, for measurement via one channel the maximum sampling frequency is 100,000 Hz (samples/second), for measurement via two channels simultaneously 60,000 Hz, and via three channels 40,000 Hz. For detailed information about maximum sampling frequency consult User’s Manuals of respective interfaces.
Number of points/measurement time
You want to sample fast enough but you do not want to generate an excessive number of measured points because it slows down the performance of your computer especially if your data have to be processed.
The maximum number of points in Coach itself is 500,000 points. High sampling frequency produces a large number of measured points – shorter measuring time should be selected.
But also an interface might limit the maximum number of data points. For detailed information consult User’s Manuals of respective interfaces.
Notice that when "repeat" is used, the resulting data set 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.
35
Working with Sensors
The topics in this chapter will help you to work with sensors. Sensor Input Ranges
Modern sensors are equipped with EEPROM memory, which stores the factory calibration of the sensor. For these sensors Coach uses as default this EEPROM calibration. For other sensors the calibration stored in the Coach Sensor Library is used as the default calibration.
For many sensors not only the default but also a few more calibrations, so called input ranges, are offered, e.g. a temperature sensor by default uses the °C range but it can also be set to measure °F.
To change the input range of the sensor
Click or right-click a sensor icon and select Set Input Range.
A list of all available sensor ranges appears. The abbreviation ‘EEPROM’ indicates the calibration stored in the sensor memory.
Select the desired range.
The readings of the sensor will be adjusted accordingly.
Set to Zero
For some experiments it can be useful to quickly reset the sensor value to zero. For example:
When you 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.
When you reset the reading of a temperature sensor to zero at room temperature, then temperature differences with respect to room temperature can be measured.
To reset the sensor value to zero
Click or right-click a sensor icon and select Set To > Zero.
The readings of the sensor will be adjusted.
Click or right-click a sensor icon and select Set To > Reset when you want to remove the new calibration.
Set to Value
If the value measured by the sensor is too high or too low, you can shift the sensor calibration through a third point defined by a value. This feature can be used for example to improve the sensor’s accuracy when the sensor’s factory calibration measures a different value than expected.
To set the sensor value to another value
Click or right-click a sensor icon and select Set To > Value
Type in a value and confirm with OK.
The readings of the sensor will be adjusted accordingly.
Click or right-click a sensor icon and select Set To > Reset when you want to remove the new calibration.
Calibrating a Sensor
Most sensors do not need to be calibrated. Their calibrations are provided by the sensors themselves (stored in the sensor's EEPROM memory) and by the Coach software (included in the Sensor Library). For better 36
accuracy these calibrations can be improved or new calibrations can be made and added as new input sensor ranges.
The sensor calibration in Coach provides the sensor name, its measurement range and the mathematical relation between the voltage values produced by the sensor and the values of the physical quantity measured. There are two ways to perform a calibration:
By providing a calibration function: method Function. For this method the type of calibration function has to be selected (Linear, Quadratic orLogarithmic function), and the required calibration's function coefficients are typed in. The resulting calibration is drawn in the calibration graph. Most sensors in Coach are calibrated via a function.
By providing calibration points: method Points. For this method calibration points are added to a calibration table. These points can be:
measured, the actual sensor voltage value is measured and the value of the corresponding quantity is typed. In this case the sensor has to be connected to the active interface. Such a calibration is the most accurate calibration.
typed, both the actual sensor voltage value and the value of the corresponding quantity are typed.
To connect the calibration points in a curve, approximating function (Linear, Quadratic orLogarithmic) should be used. The best function fit, through the calibration points, is calculated according to the leastsquares method. The calibration function will be then extrapolated to cover the whole range.
To perform calibration
Notice that by default sensors, equipped with the EEPROM memory, use the calibration information stored in the EEPROM. To add a new calibration for such sensor first click or right-click the sensor icon and switch to a non-EEPROM sensor input range otherwise you will enter an EEPROM calibration.
Click a sensor icon and select Calibrate.
The Calibration dialog shows the sensor name, calibration settings and a calibration graph. In most cases on the calibration graph the sensor voltage value V (in volts) is displayed along the x-axis and the measured quantity along the y-axis (with the exception of temperature sensors using an NTC thermistor and Stein¬hart-Hart calibration function).
The sensor info, its name, number, brand and measurement range is displayed in the non-editable Sensor field. This info cannot be changed.
In the Range ID enter the new input range name. This name will be added, as a new user input range, to the list of sensor input ranges.
Select the calibration method: Function or Points. When the method Points is selected the tab Points with a respective calibration table is added.
If desired change the scaling information: Quantity, Unit, Minimum and Maximum of the new sensor range.
Select the desired function-fit type.
Perform the calibration:
for the Function method
Type the function coefficients in the Coefficients fields.
The calibration graph is drawn.
for the Points method
Click the Points tab.
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.).
37
The small digital display below the calibration graph/table continuously displays the actual measured sensor voltage. If necessary wait for the voltage to stabilize.
As soon as you press the Add Row button the measured voltage value appears in the Voltage field. If Coach is running without an active panel then the voltage value will not appear. In this case this value has to be typed in.
Click the Quantity field and type the corresponding value of the quantity. Click OK to accept.
Repeat the above steps until a sufficient number of calibration points have been obtained.
To delete a calibration point click Delete Row. Click Yes to confirm that you want to delete the calibration point.
To delete all calibration points click Delete All. Click Yes to confirm that you want to delete all calibration points.
Click the Test button to perform a calibration test. During the test Coach shows the actual voltage and the calibrated quantity value.
Click Save to finish calibration process. To store your new calibration in the User Sensor Library select Yes. In this case your calibration will be available globally and you can use it in any Coach Activity. To store your new calibration in the opened Activity select No. In this case the new calibration will be available locally only in this activity.
To remove a user made calibration (a user input range)
Click a sensor icon and select Set Input Range.
A list of all available sensor ranges appears.
Only sensor calibrations – input ranges added by users can be deleted.
Select the desired user input range.
Storing a New Calibration in the sensor memory (EEPROM)
For sensors equipped with EEPROM memory it is also possible to modify the factory calibration and replace the factory calibration by a new calibration made in Coach. This allows making an accurate calibration per physical sensor. Next time such a sensor will be connected and detected its new calibration will be used. This is a very useful feature for example for pH sensors.
The new calibration does not really overwrite the factory calibration of the sensor and if needed its factory calibration can be restored.
Note: not all interfaces and sensors support this feature; consult User’s Manuals of respective interfaces and sensors.
To change existing EEPROM calibration and store it in the sensor memory
Click a sensor icon and select Set Input Range.
A list of all available sensor ranges appears. Select the EEPROM range.
Click the sensor icon again and select Calibrate.
The EEPROM Calibration dialog looks similar to a standard Calibration dialog however some of the options are disabled. It is not possible to edit quantity, minimum and maximum of the sensor range and function type. This is because the EEPROM calibration has a specific format.
Perform the calibration in a similar way to a standard calibration.
Click Save to store the new calibration in the sensor memory.
The question ‘Do you want to replace the calibration in the sensor memory (EEPROM)?’ appears. Click OK to accept.
To restore the factory calibration
38
Right-click a sensor icon and select Set Input Range.
A list of all available sensor ranges appears. Select the EEPROM range.
Right-click the sensor icon again and select Calibrate.
In the Calibration dialog click Reset calibration to factory settings. Click OK to confirm that you want to reset the calibration.
After the reset is performed successfully the message ‘The calibration has been reset’ appears.
Creating a New Sensor
Users can create their own sensors and add them for use in Coach. Since analog inputs of CMA interfaces measure voltage signal in two ranges, between 0 .. 5 V or -10 .. 10 V, it is important to indicate which voltage range is used by a new sensor.
To create a new sensor
Click an empty sensor input on the screen interface, select Create a New Sensor and select the voltage range used by your new sensor.
By default the sensor settings are filled like for a Voltage sensor. Enter the sensor information adequate to your sensor.
Perform the sensor calibration by providing a function by typing/measuring the calibration points in the same way as described for the standard calibration.
Click Save to finish the calibration process.
A question where to store your new calibration appears. To store your new calibration in the User Sensor Library select Yes. In this case your calibration will be available globally and you can use it in any Coach Activity.
To store your new calibration in the Activity select No. In this case the new calibration will be available locally only in this activity.
39
Converting Analog Sensors to Digital Sensors
Analog sensors generate a voltage signal and use a provided calibration to convert the measured voltage values into a measured quantity.
Any analog sensor can be turned into a digital sensor by defining its digital threshold. When a sensor measures above the defined threshold value then the value is treated as digital 1 (true or on), when a sensor measures below the defined threshold value then the value is treated as digital 0 (false or off).
Based upon such assumptions any analog sensor can be converted in Coach into a:
Digital (1-bit) sensor
Counter
Frequency meter
Time-interval meter
Some options might not be available for certain interfaces, e.g. €Lab does not support Frequency meter and Time-interval meter. See User’s Manuals of respective interfaces.
Converted sensor icons can be recognized by their color, they are lilac. 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 description of the sensor icon has a suffix ‘as counter’, ‘as 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 very useful as pulse source for event-based measurements.
Use as a Digital (1-bit) Sensor
A 1-bit digital sensor only assumes two values: 0 and 1. 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)
Click a sensor icon and select Sensor Properties.
Select Use as: Digital sensor (1).
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.
Click OK to confirm.
Converted sensor icons can be recognized by their it color, they are lilac. Moreover the 1-bit digital sensor displays a state name for each of its two states. Also the tooltip description of the sensor icon has a suffix ‘as digital (1). The input is internally monitored at 10 kHz, which puts a limit on the maximum frequency (5 kHz) or count rate (5000 counts/s).
To stop using an analog sensor as a digital (1-bit) sensor:
Right-click the converted sensor icon and select Sensor Properties.
Select Use as: Analog.
40
Use as a Counter
A counter counts the number of pulses. In order to count, the sensor should generate pulses (an oscillating signal). Each time the signal passes the threshold value in the indicated direction, the counter value is increased by 1.
Some sensors in Coach are already set by default in the counter mode; these are for example Photogate or Radiation sensor.
To convert an analog sensor into a counter
Click a sensor icon and select Sensor Properties.
Select 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, which the signal should pass to be counted as a pulse. When Both is selected, a pulse is detected when the signal passes the threshold upwards and when it passes the threshold downwards.
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.
Converted sensor icons can be recognized by their color, they are lilac. Moreover, the counter, has a set-tozero button. Also the tooltip description of the sensor icon has a suffix ‘as counter’. 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 very useful as pulse source for event-based measurements.
To stop using an analog sensor as a counter:
Right-click the converted sensor icon and select Sensor Properties.
Select Use as: Analog.
Use as a Frequency Meter
A frequency meter displays the number of pulses per time unit. In order to measure the frequency of a signal, the sensor should generate pulses (an oscillating signal). 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
Click a sensor icon and select Sensor Properties.
Select 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.
In the Sensor definition section, enter the properties for the frequency sensor: the Minimum, Maximum, Quantity and Unit and the number of Decimals.
Click OK to confirm.
Converted sensor icons can be recognized by their color, they are lilac. Moreover, the frequency meter has a set-to-zero button. Also the tooltip description of the sensor icon has a suffix ‘as frequency meter’. The input is internally monitored at 10 kHz, which puts a limit on the maximum frequency (5 kHz) or count rate (5000 counts/s).
41
To stop using an analog sensor as a frequency meter:
Right-click the converted sensor icon and select Sensor Properties.
Select Use as: Analog.
Use as a Time-interval Meter
A time interval meter in general measures length of a pulse.
There are a few types of measurement possible.
1. Time Interval Up-Up (default): time intervals between successive signal up flanks.
2. Time interval Down- Down: time intervals between successive signal down flanks.
3. Time interval Up – Down (High): time intervals between successive signal up and down flanks.
4. Time interval Down – Up (Low): time intervals between successive signal down and up flanks.
5. Time interval Up – Down & Down- Up, (High &
Low): time intervals between both signal up and down and signal down and up flanks.
There are five different interval types in the drop-down list, but not all types are available for all interfaces e.g. CoachLab II+ supports all five types. If fewer types are supported, then only these are shown in the list.
To use an analog sensor as a Time-interval meter
Right-click a sensor icon and select Sensor Properties.
Select 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.
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.
Converted sensor icons can be recognized by their color, they are lilac. Moreover, the time-interval meter has a set-to-zero button. Also the tooltip description of the sensor icon has a suffix ‘as time-interval 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).
To stop using an analog sensor as a time-interval meter :
Right-click the converted sensor icon and select Sensor Properties.
Select Use as: Analog.
42
CHAPTER 3
Control
The Control Activities are used to create and execute measurement and control programs.
The Program window offers a variety of options for design of such programs in an easy programming language - Coach Language.
Control supports interfaces that have output ports, which can be controlled manually or by means of control programs e.g. the CoachLab II/II+ interface. Examples of control programs are: an automated temperature control system used in a greenhouse or a controllable robot-arm. Through an interface, Coach collects data via sensors built in the system/ These sensors provide feedback on the state of the system, and perform actions by controlling outputs to which the actuators (such as buzzers, lights, motors, pumps, or relays) are connected. This makes control both straightforward and flexible.
The Basics
44
Program Execution
46
Creating Programs
48
43
The Basics
The topics in this chapter will help you to get familiar with the layout of the Program window and the Interface window for use in Control. Program Window
The Program window is the place for creating, editing and displaying programs. A program in Coach is a sequence of commands in Coach Language. There is only one control program. With such a program:
control tasks are executed automatically. 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.
measurements can be controlled: e.g. create beeps at random to which the user must react as quickly as possible by pressing a button.
The Program window can consists of up to three areas:
the Buttons area, where programming buttons are located,
the Editor area, where the lines of the program appear,
the Commands area, with the list of programming commands.
In most cases only one or two areas of the Program window are available, depending upon the choices of the Author.
To display/hide the Program window
Click the activity toolbar button Program to open the Program window. Click the activity toolbar button Program .
Program Tool Menu
The Program Tool menu is available after clicking the Tool menu button
in the Program window (only when the Program window is docked). Also some areas of the Program window are sensitive (hotspots) and show a different tool menu (here only Student not Author options are present).
Tool menu or editor area of the Program Window
Monitor – to execute a program in the Monitor mode
Own Commands (only if own commands are present) – to list and manage own commands
Text Zoom – to zoom text in the program window Text Edit – to edit the program text
Erase Program – to remove the program (only of program present) Import Program – to import a program from another Coach Activity/Result
Select Variables... - to select variables used in the program, which will be added to the Data Table and available for Graphs, Meters, Values and Animations
Dock/Undock – to undock/dock the Program window Print Program – to print a program
Clipboard Copy – to copy a program into the clipboard
44
Help – to consult a help system
Hotspot: a command in the command list
Insert (before or after) – to insert an own command
Delete – to delete an own command (only when an own command present)
Cut – to cut an own command (only when an own command present)
Copy – to copy an own command (only when an own command present)
Edit Own Command – to edit an own command (only when an own command present)
Rename Own Command – to rename an own command (only when an own command present)
Delete Own Command – to delete an own command (only when an own command present)
Help – to consult a help system
Hotspot: an own command editor
Back to Program – to return to a program
Own Commands – to list and manage own commands
Erase Own Command – to delete an own command (only when an own command present)
Print Own Command – to print an own command (only when an own command present)
Text Edit – to edit the command text
Import Program – to import a program from another Coach Activity/Result
Interface Window
In Control Activities/Results the Interface window is exactly the same as in Measurement Activities/Results. Interfaces, which are suitable for connecting actuators, have outputs to which actuator icons can be connected. Some areas of the interface image are sensitive (hot spots) and show a different tool menu. Some of these menus are specific for Control and Actuators.
Click or right-click a hot spot to evoke the respective menu.
Hot spot: an empty actuator input
Display as > Graph, Meter, Value – to display an actuator values on a standard graph, meter or value
Choose an Actuator – to manually select an actuator from the Actuator Library
Hot spot: an actuator icon connected to an input
Display as > Graph, Meter, Value – to display an actuator values on a standard graph, meter or value
Remove – to remove a sensor selected from a sensor library
45
Program Execution
The topics in this chapter will help you to work with actuators and to run a program. How to manage actuators
In Coach actuators are represented via actuator icons. In some Control Activities/Results actuators are already set-up, their actuator icons are placed on actuator outputs. After opening and successfully communicating to an interface actuator icons show the state of the physically connected actuators and interface's outputs can be manually controlled.
Connecting Actuators
After an actuator is physically connected to the "active" interface:
Click an empty actuator output on the screen interface and select Choose Actuator.
Select the desired actuator from the list and confirm with OK.
The actuator icon will be placed on the output and the actual state of the actuator will be displayed on the icon.
If an actuator icon is present on an output its info 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 (i.e. a measure for the number of different states the actuator can have), e.g. Lamp (12V) (062) (CMA) (1).
Actuator Library
In the Actuator Library actuators, actuators sold by CMA (Actuator set) and Generic are offered. Actuators are digital, 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.
Additionally step motors are offered. 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
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.
Disconnecting Actuators
After an actuator is physically disconnected from the "active" interface:
Click the icon of this actuator and select Remove.
The actuator icon will be removed from the output.
46
Manual Control of Actuators
With manual control you can turn outputs, to which actuators are connected, on and off. This mode offers a convenient way to check the effects of certain connections and actions and can be useful while designing a control program.
To manually control an actuator
Click the LED next to an actuator icon to turn it on or off. It works only when an actuator icon is placed on the output.
A 1-bit actuator can be set into two states e.g. a lamp can be set on or off. Here only one LED is clickable.
A 2-bit actuator can be set into four states e.g. a motor can be set on-left, on-right, stop or off. Here two LED's are clickable, the left (green when on) and the right (red when on). The actuator states are indicated on the real interface by different colors, e.g. the LED of the CoachLab II+ interface can be off, green, orange and red.
A 4-bit actuator, used for step-motors only, can be set in more positions. Such actuator makes use of two actuator outputs. LEDs of both outputs (in total 4) are clickable.
To control actuator power
For some actuators 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 lamp.
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.
How to run a program
Once your control program has been written it can be run by clicking on the activity toolbar button Start. During program execution the computer carries out all instructions of the program. This can be done slowly line-byline in the Monitor mode or fast.
To execute a program in the Monitor mode
Check the Monitor option in the Tool menu of the Program window (default this option is on).
Click the activity toolbar button Start
to start program execution. The Monitor window opens.
To carefully monitor what the commands of the program are doing you can use the monitor bar button 1, each time you click this button a single line of the program is executed.
Click the monitor bar button Start to run a program line-by-line.
Adjust the execution speed with the slider (this also can be done during program execution).
Click the activity toolbar button Stop or keep <Esc> pressed to interrupt program execution.
To execute a program fast
Check the Monitor option in the Tool menu of the Program window (default this option is on).
Click the activity toolbar button Start
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.
47
Creating Programs
A program in Coach can be created in various ways. In general three ways are possible:
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 Coach Language commands in the Editor area.
The topics in this chapter will help you to create and work with programs.
Creating a Program via Programming 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 area but it does not have to. After pressing the Start button the recorded program is executed, Coach repeats the recorded actions.
To create a program using the programming buttons
Use the programming buttons in the Program window to perform control actions.
Some buttons require only a simple mouse-click, like Stop or Lamp_On.
Other buttons, like Wait or 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 activity toolbar button Start ded actions (will execute your recorded program).
and the computer will repeat your recor-
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.
Creating a Program 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 (according to the syntax of Coach-Language).
To create a program using the commands
Click a command in the list to place it in your program.
If a new list appears the command is not yet completed:
Select a following command e.g. an output name.
Repeat this step until the command is completed.
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.
48
If a 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.
Managing 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 insert your own command at a specific position in the command list:
Right-click the command in the command list and select Insert (before) or Insert (after).
In the Add New Command to the Command List dialog, select New Command.
Type the name of the new command, follow the rules of Coach Language and do not use spaces or reserved characters and words.
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 command and click OK. Follow therules of Coach Language and do not use spaces or reserved characters and words.
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 Program to return to your program. The created own command appears in blue in the command list.
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 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.
49
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.
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. Follow therules of Coach Language and do not use spaces or reserved characters and words.
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 (before) or 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 (before) or Insert (after).
Check New Command and enter the name.
Create your own command by selecting commands from the list.
When you are ready, right-click in the editor and select Back to Program.
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 executed. When failing to compile the program Coach will show an error message and place the cursor at the point where the error is.
Working with Programs
In Junior student 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. The user level set for the activity is displayed at the left side of the status bar.
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
50
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>).
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 to paste the text of the program.
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 erase the whole program
Right-click the program and select Erase Program.
To import a program from another Coach Activity/Result
Right-click in the editor area of the Program window and select Import program.
The new program and its command list overwrite the current program and its command list. 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 Program.
51
52
CHAPTER 4
Data Video
Data Video activities are used to collect data from digital videos and images and can be used for analyzing motion or shapes of real objects. Such activities bring real-life events into the classroom. During measurements on a video the 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 or a head. The video points measured this way can serve to calculate the locations of other points on the video screen e.g. the center of mass of a body.
During measurements on an image the position data, or position and time data for a stroboscopic image, are collected. This is useful in getting the points along a curve, for example.
The Basics
54
Data-Video Measurement
57
Preparing a New Video/Image for Measurement
63
Editing Video/Image
70
53
The Basics
The topics in this chapter will help you to get familiar with the Data-Video window. Data-Video Window
The Data-Video window is the place for video/image measurements. It consists of the video/image screen and the video control bar. The tool menu offers specific tools.
To display/hide the Data-Video window
Click the activity toolbar button Data Video Click activity toolbar button Data Video to display the Data-Video window. to hide to Data-Video window.
Data-Video Screen
The Data-Video window remain empty until a video or image is opened.
To open a video or an image click the Tool menu button
Image. and select Open > Video or Open > Single
The opened video/image is displayed in the middle of the Data-Video window.
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.
Video Control Bar
The video control bar is located at the bottom of the Data-Video window and is displayed only when a video 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 representing the video frames. Selected for measurement frames are black and non-selected grey. Every frame has a number, which is shown, at the right side of the frame controller. You can jump to an arbitrary position in the video by clicking a frame on the frame controller. The selected video frame appears in the video screen and its frame number is shown.
For playback of the video the following control buttons are available:
Start to play a video. On slower computers "large" videos may play slower than in real time. On faster computers videos should play correctly provided no perspective correction is used.
Stop to play a video.
Pause to play a video.
Go to the first frame of a video.
Go to the previous frame of a video.
Go to the next frame of a video.
54
Go to the last frame of a video.
The Slider button on the frame controller indicates the current frame. You can use also the cursor keys to step through the selected frames and use <Ctrl>+<← and → cursor>- keys (Windows) or <Cmd>+<← and →
cursor>-keys (Mac) to step through all frames.
Useful shortcuts
<Shift> +<← and → cursor>- keys - makes selection of frames
< + > – selects the current frame or selection of frames for measurement;
< - > – de-selects the current frame or a selection of frames;
<Backspace> (Windows) or <Delete> (Mac) - removes only data associated with the selected frame or a selection of frames.
Data-Video 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.
Open – to open a new video or image.
Capture – to record a video.
Close – to close the opened video/image
Change Scale – to specify the distance scale and the coordinate system position.
Time Calibration – to set the time calibration for video measurement or stroboscopic image
Co-ordinate system – to specify features of the co-ordinate system
Frames – to select frames for measurement
Video points – to define the number of video points
Point tracking (video only) – to use automatic video measurement. When checked two other options appears:
Go to Tracking Frame – to jump to the frame where the tracking marker is displayed
Point Tracking Settings – to specify tracking settings.
Adjust – to adjust the brightness, the contrast and to rotate the video/image.
Add an Annotation – to place text label on the video/image screen.
Perspective correction - to apply perspective correction.
Show – to display different elements on the video screen. The marked elements will be displayed.
Axes - to display the scale ruler(s) and the co-ordinate system.
Ruler - to display the ruler to measure distances. When marked the horizontal ruler (red by default) appears on the video screen. 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.
Protractor - to display protractor. When this option is checked the Protractor (yellow by default) appears on the video screen. Drag the protractor and its end points to match an angle between two points. The measured angle is displayed next to the protractor.
55
Angle units can be radians (default) or degrees, depending on the setting in the Activity Options.
Trace (video only) - to display markers for measured points on the video screen.
Auto fit to enlarge the video screen to its maximum size within the Data-Video window.
Playing speed (video only) – to adjust the speed of playing video. 1000% means that the video will be played 10 times faster than the default (100%) setting.
Export Video/Image – to export the video/image
Dock/Undock – to dock/undock the Data-Video window.
Print – to print the content of the Data-Video window.
Clipboard Copy – to copy the content of the Data-Video window into the Clipboard.
Copy a Frame – to copy the current video frame/image.
Help – to consult the Help system.
Video Resources
Many videos can be found on Internet, students and teachers can capture their own videos
56
Data-Video Measurement
During measurements on a video position and time data are collected in the selected video frames manually by clicking on an object, or automatically by tracking a moving object.
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.
After the video/image measurement is finished, there are a number of possibilities to modify the video/image points.
How to do manual video-measurement (by clicking)
In this basic procedure it is assumed that your Coach Data-Video Activity is ready-to-go, the video is already opened in the Data-Video window, scaled and set for measurement. This means that the measurement is performed according to the settings defined via the Frames and Video Points options, uses distance scaling defined via the Change Scale and Co-ordinate System options and time scaling defined via the Time Calibration option. CMA provides many of such ready-to-go activities.
To perform video-measurement manually
Open a ready-to-go Coach Data –Video Activity.
Start the measurement by clicking the activity toolbar button Start .
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 cross) 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 video advances to the next frame, click the next point of the object. (In this case you only measure the position of one object per frame).
2. If the first video point was set up to be the origin of the measurements for this frame, then a coordinate 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 video advances to the next frame. In this case you measure more than one video point per frame.
The data will appear in the data table and graphs.
Repeat the procedure for each frame until you reach the last selected frame of the video or press the activity toolbar button Stop to interrupt the measurement.
Once you have collected data from the video you can still add, move or delete points to the measurement run you have made.
The collected data can be used for further .analysis and processing.
When scanning the last measurement run in the graph, Coach shows the corresponding frames with video point(s) (also calculated point(s)) on the video screen. Notice that this link works only for the last run and not for previously made measurement runs.
You can replay the last video measurement run; video measurement will be shown in the Data-Video window while the graphs with data evolve. Click the activity toolbar button Replay
video measurement.
to replay the Notice that when you start the measurement again the following can happen: if your previous video measurement was not completed, e.g. you interrupted your measurement and did not collect all video points, or after the measurement was finished you have selected additional frames for measurement, then Coach continues the previous measurement 57
and adds additional data to the existing run;
if your previous video measurement was completed, then Coach asks to add a new run, and after confirming a new measurement run will be started.
How to do automatic video-measurement (by point tracking)
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.
In this basic procedure it is assumed that your Coach Data-Video Activity is ready-to-go, the video is already opened in the Data-Video window, scaled and set for measurement. This means that the measurement is performed according to the settings defined via the Frames and Video Points options, uses distance scaling defined via the Change Scale and Co-ordinate System options and time scaling defined via the Time Calibration option. CMA provides many of such ready-to-go activities.
To perform video-measurement automatically
Right-click the Data-Video window and check the tool 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 the 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.
Drag the tracking area – viewfinder over the object you want to follow, 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 there is a moving coordinate system) then there are separate tracking areas for each of these points. For Coach to be able to follow a video point – object it is important that this object stands out against the background of the video for all frames on which you want to measure.
Start the measurement by clicking the activity toolbar button Start
.
The measurement is performed automatically through the selected frames according to the given settings. When using point tracking it is best to select all frames.
The data will be displayed automatically in the data table and graphs.
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 add, move or delete points to the measurement run you have made.
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 (Windows) or <Delete>-key (Mac). Now the first selected frame without data is chosen 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.
The collected data can be used for further .analysis and processing.
When scanning the last measurement run in the graph, Coach shows the corresponding frames with video point(s) (also calculated point(s)) on the video screen. Notice that this link works only for the last run and not for previous made measurement runs.
58
You can replay the last video measurement run; video measurement will be shown in the Data-Video window while the graphs with data evolve. Click the activity toolbar button Replay
video measurement.
to replay the Notice that when you start the measurement again the following can happen:
if your previous video measurement was not completed, e.g. you interrupted your measurement and did not collect all video points, or after the measurement was finished you have selected additional frames for measurement, then Coach continues the previous measurement and adds additional data to the existing run;
if your previous video measurement was completed, then Coach asks to add a new run, and after confirming a new measurement run will be started.
Tracking Settings
The tracking settings define the search area and the tracking area for each video point.
To define tracking setting
Right click the Data-Video window and check the option Point Tracking Settings.
Define the Search area by specifying its Height, Width and Color. You should limit the search area in order to reduce computing time or to avoid ambiguity. The color is used for the search area rectangle.
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. The color is used for the track area circle.
When point tracking is turned on, the search and tracking areas are displayed by default on the first selected frame and are not displayed on other frames.
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 a 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 video
But it does not mean point tracking is not free of problems. Videos must match the following requirements for successful point tracking:
Tracked objects may not change much in size, shape, and color.
Markers are preferably of circular shape (so 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, 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 video or start over again with a larger search area.
How to do image-measurement
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.
59
To perform image-measurement
Start the measurement by clicking the activity toolbar button Start
.
Move the cursor (it changes its shape to a cross) to locate the video point.
Click to store the first video point.
Repeat for other video points.
The data will be displayed automatically in the data table and graphs.
Once you have collected data from the image you can still add, move or delete points to the measurement run you have made.
The collected data can be used for further analysis and processing.
When scanning the last measurement run in the graph, Coach shows the corresponding point on the image screen. Notice that this link works only for the last run and not for previously made measurement runs.
Notice that when you start the measurement again the following can happen:
if your previous image measurement was not completed, e.g. you interrupted your measurement and did not collect all image points, or after the measurement was finished you have selected additional points for measurement, then Coach continues the previous measurement and adds additional data to the existing run.
if your previous image measurement was completed, then Coach asks to add a new run, when confirming with yes a new measurement run will be started.
How to modify the collected video points
After the video/image measurement is finished, there is a number of possibilities to modify the video/image points.
Moving Video Points
If you are not satisfied with your marked point you can come back to a frame or an image point and move the point to another location.
To move a measured point
For video measurement: Select the point via the Scan option in the graph or click the frame on the frame controller in which the measured point must be corrected.
For image measurement: Click the point which must be corrected. This point becomes the active point and changes its color.
Drag the point to the desired location.
The data table and graphs update simultaneously.
To move 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.
The data table and graphs update simultaneously.
60
Deleting Video Points If you are not satisfied with your marked point you can come back to a frame or an image point and delete the point.
To delete a measured point
For video measurement: Select the point via the Scan option in the graph or click a frame on the frame controller in which the measured point must be deleted.
For image measurement: Click the point which must be deleted. This point becomes the active point and changes its color.
Use:
- < - >-key to deselect a frame and delete a point. The deselected frame becomes grey in the frame controller.
- <Backspace>-key (Windows) or <Delete>-key (Mac) to delete a point only, the frame remains selected.
The data table and graphs update simultaneously.
When the tracking frame is deselected then the tracking areas will be moved to the new tracking frame (next first selected frame without data).
Adding Video Points You can also add extra points after your measurement is finished.
To add extra video point(s)
Click an additional frame on the frame controller and manually select this frame by using the <+>-key. The selected frame becomes black.
For manual measurement:
Click the activity toolbar button Start
.
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 activity toolbar button Start
.
The measurement is automatically performed for all added frames only.
The data table and graphs update simultaneously.
To add extra image point(s)
Insert an empty data row in the data table in the following way:
Select the row, which you would like to add.
Right-click in the Data Table window and select Rows > Insert.
Fill the number of the first row and the last row to add. If the first and last row have the same number only one row with this number will be added. The other cells shift down.
Click OK.
Click the activity toolbar button Start
61
.
Locate a new video point.
Repeat this for all points you want to add. Rows will be filled in downward direction.
The data table and graphs update simultaneously.
62
Preparing a New Video/Image for Measurement
Before you can analyze your own video or image, you must open it and prepare it for measurements. The steps are as follows:
opening your video/image
capturing your own video
editing your video [only if needed]
scaling your video/image
adapting the time calibration [video and a stroboscopic image]
adjusting the properties of the coordinate system
specifying the number of video points to measure
selecting frames, which will be used for measurement
selecting standard video graphs After you have made these steps you are ready to start your measurement. In this chapter all the steps are described in details.
Opening Video/Image
Suitable videos or images for measurement can be found on the Internet or can be made by students and authors.
To open 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 video is not in the list, add a video to the list by clicking Add video. The selected video will be added to the list of videos available in the Activity.
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 open 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.
The selected image will be added to the list of videos available in the Activity.
Click OK.
The image appears in the Data-Video window. Notice that there is no frame controller.
To close a video/image
Select the Tool menu option Close.
Video formats accepted by Coach
Coach accepts the following video formats:
*.AVI – Audio Video Interleaved, the most common digital format for Windows.
*.MOV – QuickTime format, standard for Macintosh computers .
63
*.MPEG *.MP4 *.WMV
*.3GP
*.ASF
*.M4V
Videos in other formats should first be converted to formats accepted by Coach.
Image formats accepted by Coach
Coach accepts the following image formats:
BMP– Windows or OS/2 bitmap
GIF – Graphic Interchange Format
JPG – Abbreviation for Joint Photographic Experts Group. The standard format for compression of images. JPGs are 16-bit color images of reasonably small size.
PNG – Abbreviation for Portable Network Graphics, the most used lossless image compression format on the Internet.
Images in other formats should first be converted into formats accepted by Coach.
Capturing Video
Good to know before you start video capture
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.
To capture your own video materials you need a digital camera (a digital video camera, a digital photo camera or a web cam). Before you start to use the camera in Coach test it first with the software and the instructions that came with the camera to make sure the connection is working and you can preview/capture video using the provided with your camera software. If that software does not work, capturing in Coach will not work, either.
To capture video
Video capture is possible both in the Data-Video window and in the Video pane but not in both windows at the same time.
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).
To open the Capturing window in the Data-Video window, click its Tool menu and select the option Capture or select Open > Video and select a video capture device from the list.
To open the Capturing window in the Video pane, click its Tool menu and select the option Capture or click the Video button the Activity toolbar and select a video capture device from the list.
The Capturing window includes: a video area, which displays the live image of the camera or the recorded video, and control buttons for recording video.
To configure the way Coach will capture, use the Tool menu optionCapture Settings option.
64
By checking the Tool menu Capture information option information about the recorded video will be shown. Duration displays actual recorded time and frame rate displays actual recorded frame rate.
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.
After a video has been recorded you can view the recorded video by using the option Show >
Playback.
The recorded video file is a temporary file (with default name REC#) 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 will be added to the list of videos available in the Activity/Result.
The recorded video(s) will be embedded in the Activity/Result file after it will be saved.
Capture Settings
To configure the way Coach will capture, use the Capture Settings option.
To define capture settings
Right-click the Capturing window and select the option Capture Settings.
The Capture Settings dialog opens.
Define the following settings:
Video source
This option specify the video source used for capturing.
Video codec
This option specifies the video codec (Compressor/Decompressor) used for a recorded video. Coach displays the list of Video codecs installed on your computer.
Resolution
This option specifies the height and width of the video, 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. Coach will try to record with the given frame rate but at the moment your computer and/or your capture device will not be able to deliver the set frame rate, the rate will be lowered to avoid dropping frames. The time of recorded frames will be adjusted respectively.
Frame rate follows measurement
This option is present for video capture synchronized with measurement when the measurement frequency is 1 per second or lower. Then the frame rate of the captured video is the same as the measurement frequency.
Max. time
This option specifies the maximal time of 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.
Preview during capture
By checking this option you can turn on/off the preview area, which shows the live camera image.
65
Scaling Video/Image
The Change Scale option is used to specify which distance on the video/image corresponds to a known real distance. It is also used to set the origin of the co-ordinate system. This allows you to convert the coordinates of collected video points from screen pixels into real distance values e.g. in meters.
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 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.
In the majority of videos you can use the default setting Same scale in all directions which assumes the same scale is applicable in x and y directions. Select Different scale in horizontal and vertical direction if the scale is different in x and y directions.
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
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 measurement
Via the Data-Video Tool menu select the option Time Calibration.
There are three ways to do this:
1. By specifying the frame rate – number of frames per time unit. Usually the video frame rate (the number of frames per second) is included in the video 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.
2. By specifying the time between frames.
3. By specifying the absolute time – the 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 0110$0.0333 ).
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,
t = 0 at first selected frame,
t = # at first frame - enter time associated with the first frame; select a time unit from the dropdown list.
Click OK to confirm.
66
To set the time calibration for a stroboscopic image measurement
Open a single image if needed.
Via the Data-Video Tool menu select the option Time calibration and select Stroboscopic image.
Type in a stroboscopic frequency or stroboscopic time interval.
Co-ordinate System Settings
The option Co-ordinate System is used to define the properties of the co-ordinate system.
To specify the features of the co-ordinate system
Via the Data-Video Tool menu select the option Co-ordinate System.
Define the origin of the co-ordinate system:
select Same at all frames if the camera did not move during the recording of the video (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 a video or if you want to measure according to a moving center of mass (moving co-ordinate 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.
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.
Defining Video Points
Video points are points collected on each selected video frame during video measurement (max. 8 points per frame) or points collected on an image for image measurement.
To define the number of points for a video
Via the Data-Video Tool menu select the option Video Points.
Enter the Number of measured points per frame.
From a set of measured video points another point can be calculated, for example the center-of-mass location. Such a calculated point can be displayed directly in the video screen during a measurement. If needed enter the Number of calculated points per frame. When the chosen number is higher than 0 the Calculated points section appears in the dialog.
Select formulas to calculate X and Y co-ordinates of calculated point(s). By default the Data range connections are Empty. Formulas appear in the drop-down lists only if these formulas have been defined as variables in the data table.
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 data-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.
67
To define the number of points for an image
Via the Data-Video Tool menu select the 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.
Selecting Frames
After opening a video, by default all frames are selected. This could be a convenient setting for measurement via point tracking. To make a selection of frames on which you want to perform the measurement use Frames.
To select frames for the measurement
Via the Data-Video Tool menu select the option Frames.
The total number of frames available in the video 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 the range of frames selected with a given step.
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, the frames are equally distributed in the given frame range.
Type in as well a number of frames to select as 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 < + >-key or deselect it with the < - >-key. Selected frames are black while deselected frames are grey.
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).
Video Variables in the Data-Table and Graphs
Each video point is described by four variables: its horizontal Px and vertical Py Cartesian co-ordinates, and its angle Pangle and distance Pdist polar co-ordinates. Notice that the unit with which angles are measured can be radians or degrees, depending on the pre-defined settings in the Activity Options. All four variables are added to the Data Table when a point is selected for measurement (one point is always selected). By default variables Px and Py are visible, and Pangle and Pdist are hidden in the Data Table. The standard graphs of these variables are created automatically by Coach.
For video measurement these are plots of the Px and Py (per the selected video point) versus time.
For image measurement this is a plot of the Py versus Px.
For a stroboscopic image it is the Px and Py variables versus time.
68
To select a standard video/image graph:
Click the activity toolbar button Graph . The list of graphs appears under the button.
Select a standard graph, the icon changes into the Graph icon. Move the Graph icon above a desired pane and click the pane.
If you want to display data differently then you can edit the video graph or create new graphs. The graphs can be setup prior to starting a video measurement or after it. The advantage of preparing the graphs before is that the data are displayed during measurement.
Scanning
In Data Video Activities graphs are synchronized with the video points. When scanning in the graph, Coach shows the corresponding video points (also calculated points) on the video screen. This allows to connect the real situation with its abstract graphical representations.
Notice that when 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.
69
Editing Video/Image
Coach provides limited possibilities for editing videos. Editing options include:
removing the begin/end part of the video
adjusting brightness, contrast, rotating and flipping
placing annotations
correcting perspective distortion
In case you save the Activity after editing then the options are saved in the Activity. It is also possible to export video or image included in the Coach Activity. All these topics are described in this chapter.
Removing The Begin/End Part of a Video
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 video. 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 .
Adjusting Video/Image
To adjust a video/image use the Tool menu option Adjust. In the Adjust dialog:
Use the Brightness slider change the brightness of a video/image.
Use the Contrast change the contrast of a video/image.
Use the Rotate slider to rotate a video/image. This slider has three kinds of adjustments:
1. Raw - drag the thumb of the slider to rotate the image as needed. This can be done quickly but not very precisely.
2. Fine - click on the arrows at the ends of the slider. This will advance the slider by 5 degrees.
3. Very fine - click on the slider outside the thumb but not on the arrow buttons. This will advance the slider by 5 degrees. Hold down the mouse to achieve continuous rotation by 0.5 degree.
Mark the Flip horizontally option to flip a video/image horizontally.
Mark the Flip vertically option to flip a video/image vertically.
Use the Reset button to reset all settings to original settings.
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.
Annotating Video/Image
To place text labels on frame(s) of a video/image use the option Annotation.
To add an annotation
Right-click the Data-Video window and select the option Add an 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.
70
Check Show 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.
If needed, repeat this procedure to create more annotations.
To edit or delete an annotation right-click an annotation and select Edit or Delete.
Correcting Perspective Distortion
The perspective distortion of a plane can be corrected in Coach by using the option Perspective Correction. As an example the shape of the Golden 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.
To perform a perspective correction
Right-click the Data-Video window and check the Perspective Correction option.
A red perspective rectangle appears on the video screen.
Map the 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 71
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.
To move the perspective rectangle (translate the "view"): place the cursor inside the perspective rectangle (the cursor changes into an open hand) and drag the rectangle to a desired location.
Use <Ctrl>+<Z> (Windows) or <Cmd> + <Z> (Mac) to undo your last step.
Use the Reset option, to reset all changes and set the video to its original format.
Note: Applying perspective correction may slow down the video playing speed because the calculations are done in real-time.
What is perspective correction?
The left image shows a photograph 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 paralelism. The right image shows the perspective corrected front of the building, where the plane geome¬try is that as it would be seen if the original photograph had been taken with the camera fronto-parallel 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 be¬tween 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.
Exporting Video/Image
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.
72
To export a video/image file
Right-click the Data-Video window and select Export Video/Export Image.
The Save as dialog opens.
Type in a file name.
73
74
CHAPTER 5
Modeling
Modeling activities are used to create and analyze computational models.
Modeling in Coach is basically similar to the System Dynamics Modeling, which use a stock-flow metaphor for dynamically changing systems (approach developed by Prof. J.W. Forrester in the early 1960s). Additionally Coach modeling is enriched with elements such as the Event element that allows introducing a discrete change in continuously varying systems, and the Process element that allows to model situations in which the principle of flow balance does not hold.
The Basics
76
Model Execution
82
Elements Used in Graphical and Equations Modes
84
Modeling in Graphical Mode
88
Modeling in Equations Mode
92
Modeling in Text Mode
95
Executing models in Coach
98
75
The Basics
The topics in this chapter will help you to get familiar with the Model window. Why to use Modeling?
For creating models there are three types of modes (editors) available: graphical, equations-based and textbased. Research indicated that graphical modeling offers an easier to use and richer framework for understanding the structure of a dynamic system in comparison with text-based modeling, and that it allows to build more complex models, because you can first concentrate on qualitative specifications during initial stages of the modeling process and do quantitative, formula-based specifications at later stages.
The use of various modeling modes is flexible in the sense that you can start the creation of a model in graphical mode and then you can switch to the equation or text model and add or change the model.
Once the model is created, it is easy to investigate it by changing values of parameters. Students can use this to test a hypothesis and to compare empirical data with results obtained from a theoretical model.
Ways of using Modeling
Generally there are three possible ways of using Modeling:
1. Open an earlier prepared model, run it and discuss with the students how it works. Here modeling is used as a simulation, with this difference that the model is visible and can be changed. The Simulate option is very helpful in this case.
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. This way is useful in helping students to see how different problems relate to each other.
3. Start with nothing, and build up the desired model from scratch. This way is useful for example in modeling a phenomenon being studied in a student investigation.
Model Window
The Model window is the place for displaying, editing and creating models. It consists of a modeling area, whose design depends on the selected modeling mode.
In the graphical mode it is a canvas in which the graphical structure of the model is drawn. The variables of a model are represented by graphical symbols; connectors drawn between the symbols indicate the relations between the variables.
In the equation-based and text-based mode the window is divided into two parts showing the mathematical equations in the left part and initial values of state variables and constants in the right part.
The Model window also has its own toolbar and Tool menu that offer options specific to modeling.
To display/hide the Model window
Click the activity toolbar button Model to open the Model window, Click the activity toolbar button Model to close it.
Model Toolbar
The toolbar of the Model window may have the following buttons (not all buttons are always present):
Zoom in and out a model 76
Create a State variable (graphical and equations modes)
Create a Process variable (graphical and equations modes)
Create a Flow variable (graphical mode)
Create an Auxiliary variable (graphical and equations modes)
Create a Constant (graphical and equations modes)
Create an Event (graphical and equations modes)
Draw a connector (graphical mode)
Delete an element (graphical mode)
Show the Independent Variable (graphical and equations modes)
Add an annotation (graphical and equations modes)
Zoom model structure to fit the Model window (graphical mode)
Show model equations – to display model equations, model equations are shown but are not editable). Click to hide model equations. Open the Graphical mode (equations and text modes)
Open the Equations mode (graphical and text modes)
Open the Text mode (graphical and equations modes)
Store and open favorite models. The models listed under favorites show a mode in which they were created, graphical or text. Text models are visible only in text mode. The favorite models can replaced or can be added to the existing model.
Insert a delta symbol, Coach Language Command or open the Formula Editor (text mode)
Select Variables button (text mode) - to select variables used in the text model, which will be added to the Data Table and available for Graphs, Meters, Values and Animations. Model Tool Menus
The Model 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. The menus differ in graphical, equations and text mode. Also some areas of the Model window are sensitive (hotspots) and show a different tool menu.
GRAPHICAL MODE
77
Tool menu or empty space
Click the Tool menu button or an empty space in the Model window
Run Controller – to display the Run controller
Simulate – to display the Simulate dialog
Zoom – to zoom the model
Edit – to edit a selected part of the model
Erase Model – to erase a model
Import Model – to import a model from another Coach Activity/Result
Dock/Undock – to dock/undock the Model window
Print Model – to print a model
Clipboard Copy - to copy a model to the clipboard (as an image)
Help – to consult the help system
Hotspot: a variable symbol in the Model window
Right-click a hot spot to evoke its menu.
Edit – to edit a selected part of the model, the following options are present: Undo, Cut, Copy, Paste, Font, Select All
Display as a Graph – to display a variable in a standard graph
Display as a Meter – to display a variable in a standard meter
Display as a Value – to display a variable in a standard value
Properties – to open the Variable Properties dialog
Convert to Constant (only for an auxiliary variable) - to change a type of variable to a constant
Convert To Aux (only for a constant) - to change a type of variable to an auxiliary variable.
Hotspot: the submenu symbol in the Model window
Right-click a hot spot to evoke its menu.
Edit – to edit a model, the following options are present: Undo, Cut, Copy, Paste, Font, Select All
Properties – to open the Variable Properties dialog
Remove Subsystem – to delete a subsystem
EQUATIONS MODE
Tool menu or empty space
Click the Tool menu button or an empty space in the Model window
Run Controller – to display the Run controller
Simulate – to display the Simulate dialog
Zoom – to zoom the model
Edit – to edit a selected part of the model, the following options are present: Undo, Cut, Copy, Paste, Font, Select All
Import Model – to import a model from another Coach Activity/Result
78
Erase Model – to erase a model
Dock/Undock – to dock/undock the Model window
Print Model – to print a model
Clipboard Copy - to copy a model to the clipboard (as an image or as text)
Help – to consult the help system.
Hotspot: a variable equation in the Model window
Right-click a hot spot to evoke its menu.
Edit – to edit a model, the following options are present: Undo, Cut, Copy, Paste, Font, Select All
Display as a Graph – to display a variable in a standard graph
Display as a Meter – to display a variable in a standard meter
Display as a Value – to display a variable in a standard value
Properties – to open the Variable Properties dialog
Dock/Undock – to dock/undock the Model window
TEXT MODE
Tool menu or the left side of the Model window
Click the Tool menu button or the left side of the Model window
Monitor – to execute a model in the Monitor mode
Simulate – to display the Simulate dialog
Zoom – to zoom the model
Edit – to edit a selected part of the model, the following options are present: Undo, Cut, Copy, Paste, Constants, Select All
Import Model – to import a model from another Coach Activity/Result
Erase Model – to erase a model
Select Variables – to select variables used in the text model, which will be added to the Data Table and available for Graphs, Meters, Values and Animations
Dock/Undock – to dock/undock the Model window
Variables – to open the List of Variables dialog to select variables for display in the data table
Print Model – to print a model
Clipboard Copy - to copy a model to the clipboard (as an image and as text)
Help – to consult the help system.
Model Settings
The Model Settings dialog consists of all settings needed to run a model. For a new model Coach uses default settings. The Model Settings dialog in text mode is simpler than in graphical and equation mode and offers only a few options.
79
To change the model settings
In the activity toolbar click the Settings
button.
Adjust where needed.
In graphical and equations mode:
Start: defines the begin value of the independent variable. By default the independent variable is time t.
Stop: defines the value of the independent variable or the condition at which model execution stops.
Step interval: defines the step of the independent variable.
Save data every # steps: in case of large data sets it can be useful to save only part of the calculated data. By default data are saved every step.
Display run controller: check if you want to display the Run controller. By default this option is off.
Draw connectors automatically – check if you want to automatically draw connectors of variables used in a variable definition (formulas). By default this option is off.
Integration method: specifies the integration method used for solving differential equations in graphical and equations modes. Coach provides three iteration methods: Euler (default), Runge-Kutta 2 and RungeKutta 4.
Notation: specifies the way the differential equations are presented in the equations mode. Two ways are available: difference e.g. x = x + Δx (default) and differential e.g. dx/dt.
In text mode:
Number of Cycles: define number of time the model has to be calculated until it stops.
Save data every # cycles: in case of large data sets it can be useful to save only part of the calculated data. By default data are saved every cycle.
Managing Models
In general, models are saved together with all other Activity settings in the Coach Activity/Result file.
Importing models
In general, models are saved together with all other Activity settings in the Coach Activity/Result file.
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.
Favorite models
Favorite models (or part of a model) can be added and store in Coach so they can be available during creation of new models.
To store a favorite model
Create a model you want to store.
Click the Favorites toolbar button and select Add current.
Name your favorite model.
Click OK to confirm.
To add a favorite model to existing model
Click the Favorites toolbar button 80
and select My Models.
A list of favorite models will be given.
Select a model you want to add.
The cursor displays the Model icon. Click the location where you want to place your model.
To remove a model from the list of favorite models
Click the Favorites toolbar button and select Remove.
A list of favorite models will be given.
Select a model you want to remove.
81
Model Execution
During model execution calculations of the model variables are done based on the model, initial values and model settings. Via the Simulate option, the effect of a single parameter on the model can be studied.
To verify weather the theory matches the reality the model results can be compared with experimental data. How to execute a model
In this basic procedure it is assumed that you work with a Coach Modeling Activity with a ready-to go model.
Start the model execution by clicking the activity toolbar Start button .
Model execution starts and the data appear in the data table and graph(s).
Model execution stops when the stop value or the stop condition (in the graphical and equations modes) or the number of given cycles (in the Text mode) is reached.
To interrupt model execution use the activity toolbar button Stop
or keep <Esc> pressed.
How to control the speed of model execution
Often when executing the model via the Start button the model calculations are performed quite fast. To slow down the speed of execution of graphical or equations models the Run Controller can be used, for text models the Monitor option can be used. During slower model execution the calculated values of all model variables are shown in the Model window.
RUN CONTROLLER
The Run controller is available in graphical and equations mode. It can be placed on the screen by checking the option Display Run controller in the Model Settings dialog or the Run Controller option in the Tool menu of the Model window. The Run controller allows you to:
execute the model,
stop the model execution,
pause the model execution, and adjust the execution speed by using the Speed 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. The calculated values of all model variables are shown in yellow digital displays in the Model window. After model execution is finished, one can scroll through the independent variable values.
MONITOR WINDOW
The Monitor window is available in text mode when the Monitor option, in the Tool menu of the Model window, is checked.
After starting the model execution (clicking the activity toolbar Start button and the execution of the model can be followed line-by-line.
), the Monitor window opens Adjust the speed of the monitoring with the slider (this can also be done during execution).
Execute a single line of the model by pressing the 1-button in the Monitor bar.
Click the Start button in the Monitor bar to start line-by-line model execution. During monitoring the 82
line being calculated is indicated and all values of the variables are displayed at the right side. Click the activity toolbar button Stop or keep <Esc> pressed to interrupt model execution.
How to execute the model via the Simulate option
Another way of executing the model and at the same time investigating the effect of a single model parameter on the model is via the Simulate option.
Right-click the Model window and select the Simulate option.
Select the parameter from the drop-down-list of model variables.
Specify a parameter value by typing a value in the Value field or setting a value with the Range slider.
Click the Execute button. Model execution starts and the data appear in the data table and graph(s).
Repeat for other values of the parameter. Each time the model is executed a new run is added to the data table and graph(s). This allows easy comparison of graphs created for different parameter values.
How to compare model data to experimental data
One of the most valuable features of Modeling is hypothesis testing during which model data can be compared to experimental data from measurement or video measurement. By modifying the model or by changing the value of a parameter students can test their hypothesis and construct links between the real experiment and the theoretical model.
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 experimental graph.
If the calculated graph partially overlaps the background graph, the option Shift Background Graph enables you to shift the background graph horizontally. This option becomes available in the graph Tool menu after the background graph is placed in the diagram.
83
Elements Used in Graphical and Equations Modes
The following variables are available for creating models in graphical and equations modes:
State variable
Process Flow
Auxiliary variable
Constant Event
Independent variable.
To draw and show relations between variables in a graphical model Connectors are used . 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.
Each model variable has its own properties, which are defined in the Variable Properties dialog.
To open Variable Properties
In graphical mode – double-click a variable symbol in the Model window.
In equations mode - double-click a variable symbol placed before an Equation.
Formulas, used to define variables or conditions, can be simply typed in directly in the definition fields of model variables or the formula editor can be used. The formulas should obey the .rules of Coach Language.
In formulas new variables (not yet used in the model) can be introduced. When Coach detects such a new variable then a new graphical symbol/equation for this "unknown" variable, indicated with a question mark, is automatically created and added to the model. After that 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 its definition can be made.
State Variable
State variables are used to represent variables that change in time. State variables can represent countable, physical accumulations like the amount of water in a bathtub, the number of trees in a forest, a country population, or can represent the degree of non-physical accumulations such as knowledge or fear. State variables can also be used for more abstract variables changing in time e.g. the position or velocity of a moving object (kinematics problems).
A State variable is determined by its initial value and by the ingoing and outgoing flows. The total sum of all inflows and outflows defines the total rate of change of the state variable. The initial value is almost always specified by a value, but it may be specified by a formula.
The State variable has a default label State_# (where # denotes a number). The variable name used by Coach is displayed below the label and is not editable. If a variable label consists ofcharacters/words not allowed to use by Coach Language then Coach automatically adds square brackets around the variable name in order to interpret it correctly.
Process Variable
A Process is used to describe changes in variables that are interrelated in one process. A typical application is chemical kinetics of a reaction where the stoichiometry is such that the number of reacting species 84
differs from the number of products, for example the reaction A + B → C. The graphical model of such a 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 (the Erlenmeyer flask) represents a reaction, flows going towards 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. Therefore there is no need to use connectors from the process towards these flows.
The Process variable has a default label Process_# (where # denotes a number). The variable name used by Coach is displayed below the label and is not editable. If a variable label consists of characters/words not allowed to use by Coach Language then Coach automatically adds square brackets around the variable name in order to interpret it correctly.
Flow Variable
Flow variables are used to represent actions that lead to a 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, velocity (rate of change) of object position, etc.
For state variables: if the arrow of the flow has a direction into the 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 Flow variable has a default label Flow_# (where # denotes a number). The variable name used by Coach is displayed below the label and is not editable. If a variable label consists of characters/words not allowed to use by Coach Language then Coach automatically adds square brackets around the variable name in order to interpret it correctly.
By default a flow label is not displayed in the Model window. Check the Show label option to display the name. By checking the option Use condition, the additional fields for constructing a condition are displayed.
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 can be used for calculating the growth rate; for motion an auxiliary variable can be used for calculating forces acting on a body or body acceleration. An auxiliary variable is determined by a formula or by data, which originates from the data table. The auxiliary variable has a default label Aux_# (where # denotes a number). The variable name used by Coach is displayed below the label and is not editable. If a variable label consists of not allowed to use by characters/words not allowed to use by Coach Language then Coach automatically adds square brackets around the variable name in order to interpret it correctly.
An auxiliary variable can be defined via formula or via data.
To define an auxiliary variable by formula
In the Auxiliary Variable Properties dialog select the Formula option.
85
Type in the formula in the field behind Aux_# =. The formula should be written according to the rules of Coach Language to avoid mistakes you can use the .formula editor.
By checking the option Use condition the additional fields for constructing a condition are added.
To define an auxiliary variable by data
Before this definition can take place, a variable with desired data should be present in the data table of the Activity/Result. Such a variable can be constructed in Coach by:
using the Sketch option and drawing a graph, the Sketch variable is then added to the data table.
adding a manual variable to the data series of the data table and typing the respective data manually.
importing data from an external .csv file.
In the Auxiliary Variable Properties dialog select the Data option and click the Define button.
Specify the Run in the data table from which the data will be used.
Specify the variable whose data will be used for the dependent variable. The quantity and unit of the linked column are automatically displayed.
Specify the variable whose data will be used for the independent variable. The quantity and unit of the linked column are automatically displayed.
Click OK. Notice that the chosen data will be stored along with 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 are defined by 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 Constant has a default label Const_# (where # denotes a number). The variable name used by Coach is displayed below the label and is not editable. If a variable label consists of / not allowed to use by characters/words not allowed to use by Coach Language then Coach automatically adds square brackets around the variable name to in order to interpret it correctly.
Event
For processes with abrupt changes, the Coach modeling environment is enriched with the Event element . The event allows changing the value of a state variable once, based on a condition; this causes a discrete change in a continuously varying system. An event can be used to describe the bounce of a falling ball: when a ball reaches the ground (in Coach Language condition ‘height <=’) then the ball velocity changes its direction and because of energy dissemination also its value.
An event definition is built from two parts: a trigger condition and actions. A trigger condition is defined by entering a conditional equation. Similar to formula it should be written according to the rules of Coach Language. A list of actions is created by using the buttons Add and Remove. The actions can only be applied to state variables.
The Event has a default label name Event_# (where # denotes a number). The variable name used by Coach is displayed below the label and is not editable. If a variable label consists of not allowed to use by characters/words not allowed to use by Coach Language then Coach automatically adds square brackets around the variable name in order to interpret it correctly.
86
By default an event label is not displayed in the Model window. Check the Show label option to display the name.
Independent Variable
The Independent variable is the variable that determines the steps for the change of the state variables. By default it is time t with unit s.
The Independent variable properties dialog opens by:
clicking the Independent variable button in the Model window toolbar able symbol is not visible in the Model window, or
when the Independent vari-
double-clicking the Independent variable symbol in the Model window.
By default the independent variable graphical symbol is not shown in the Model window. Check the option Symbol visible in the Model window if you want to display it.
87
Modeling in Graphical Mode
In graphical mode models are built with graphical elements, which represent model variables: state, process, flow, auxiliary, constant variables. Discrete changes of state variables can be constructed with events. Relationships between the model variables are given by connectors.
The state and process variables together with the flows connected to it define the differential equations of the model. These mathematical equations describe the way the state and process variables change in time. Together with other variables, a graphical model represents a computer model, which provides an iterative numerical solution of the model's differential equations.
The topics in this chapter will help you to learn how to work in graphical mode. Creating a Graphical Model
1. By default variable t (time) is used as the independent variable in a new model. If you want to change it click the Independent variable symbol and specify a new independent variable.
2. Create the graphical structure of your model.
Place variable symbols in the modeling area: State, Process, Auxiliary and Constant variables: click their respective symbol buttons on the toolbar, the cursor displays a small icon of this symbol, move the cursor onto the modeling area, position it and click. Flows (in): 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. Flows (out): click the Flow button on the toolbar, the cursor displays a small flow icon. Click a state or process variable, hold and drag the cursor out of the state or process variable. Or if you want to connect it as an in-flow to another state or process variable, hold and drag the cursor out until it reaches and selects this new state or process variable, then release the mouse. Use <Shift> + <click> to make corners (only in Windows).
Rename your variables. All symbols get default names, which are located under the symbol (not displayed 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 variable properties dialog.
Draw connectors between the model variables: click the Connector button on the toolbar, the cursor displays a small connector icon, click a symbol from which the connector has to start, hold and drag the cursor to the symbol where it has to end. By default the relation arrows are drawn in red and model objects in blue. These colors can be adapted for a whole or a part of the model. To change a color select (a part of) a model and use the Tool menu option Edit > Colors > Relations or Objects. You can also change the default font used to describe the model variables. To change the font select (a part of) a model and use the Tool menu option Edit > Fonts .
3. Define the variables. The symbols which miss definition will show a question mark ‘?’.
Double-click a variable symbol; its variable properties dialog opens.
Enter mathematical formulas for flows, events and auxiliary variables. The formulas can be typed in or created with the formula editor. The formulas should obey the rules of Coach Language.
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.
88
4. Define your model settings.
Click the activity toolbar button Settings
.
Define start and stop conditions.
Choose the integration method. By default the Euler method is selected.
5. Select the way of presenting your model data. Right-click a variable symbol and select a graph, meter or a value or .create new graphs.
6. Execute your model by clicking the activity toolbar button Start or by using .Run controller.
7. ,Errors of various kinds, 'bugs', can be made during a modeling process. Some errors can be simple mistakes, like misspelling a variable name (leading to confusion with a different variable) or creating a wrong formula (not according to the rules of Coach Language). In such cases Coach gives an error message and suggests where a problem was found.
8. Some errors can be more fundamental, for example the choice of sign. 'Friction force' with the wrong sign will produce spontaneous acceleration and absurd results.
Editing a Graphical Model
To edit a variable
Double-click a symbol in the model structure. Edit the variable properties..
To make a selection
Click a variable symbol in the model symbol to select it. Use <Ctrl>+<click> (Windows) or <Cmd>+<click> (Mac) to select more symbols.
or
Drag an area in the Model window to select the symbols inside.
To move a variable symbol
Click a variable symbol in the model 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 of variable symbols
Make a selection of variable symbols.
Right-click outside of the selection and select Edit > Copy (or <Ctrl>+<C>).
Right-click the Model window and select Edit > Paste (or <Ctrl>+<V>).
Copied symbols will be placed in the Model window. Notice that the new variables automatically get new names.
To delete a variable symbol
Click the Delete button in the toolbar on a variable symbol and click it, or
(the cursor changes into a pair of scissors), place the cursor Select a variable symbol or make a selection of more symbols and press <Del> (only in Windows).
To change a color of relation arrows or model objects
Drag to select (a part of) a model in the model window or use the Tool menu option Edit > Select all to select the whole model.
Go to the Tool menu option Edit > Color > Relationsto change the color of the selected relation arrows.
89
Go to the Tool menu option Edit > Color > Objects to change the color of the selected model objects.
Select the desired color.
To change a font of model labels
Drag to select (a part of) a model in the model window or use the Tool menu option Edit > Select all to select the whole model.
Go to the Tool menu option Edit > Font and select the desired font.
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 Edit > Font, the fonts of all selected variables can be changed at once.
<Shift> + <cursor>-keys moves the whole model in the Model window.
Creating 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 variables for your subsystem.
Right-click the selected area and select the option Create Subsystem.
The subsystem Subsystem_# (where # denotes a number) is created and its symbol, a closed box, appears in the Model window.
To make the subsystem visible, 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 window opens. It allows specifying the subsystem’s name, description and display.
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 cannot be opened or closed.
To remove a subsystem
Right-click the closed or opened subsystem and select Remove Subsystem.
The variables of the subsystem will remain in the model.
Displaying a Graphical Model in Equations or Text Mode
A graphical model can be viewed and modified in equations or text mode. Changes made in equations mode will be transferred back to graphical mode.
To display a graphical model in the equations-bases editor:
Click the toolbar button Equations mode .
The graphical model is automatically converted into an equations-based model based on the model definitions.
90
Now the model can be modified. Changes made in equations mode will be transferred back to graphical mode.
To display a graphical model in the text-based editor:
Click the toolbar button Text mode
.
The graphical model is automatically converted into a text-based model based on the model definitions and selected integration method e.g. selecting Euler iteration method will create a much simpler program than selecting the Runge-Kutta method.
After a text model is modified a warning message appears after trying to change the mode. Forcing to change the mode removes all modifications made in text.
91
Modeling in Equations Mode
In Graphical mode the model is defined with mathematical equations "hidden" behind the graphical symbols. In equations mode these mathematical 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.
The topics in this chapter will help you to learn how to work in equations mode. Formats of Variable Equations
A state variable is determined by its initial value and its rate of change, which equals to the sum of flows going in and out of the variable. This results in a model differential equation. The form of this equation depends on the notation selected in the model settings.
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 cannot be typed over in equations; it can be changed only in the Independent variable properties window, which opens after clicking the Independent variable icon in the toolbar.
Difference equation notation
Differential equation notation
A 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 variable equations are added automatically to the model equations. Undefined flows display a question mark ‘?’.
Auxiliary variable equation Constant equation
Event equations are actually conditions.
92
Creating an Equations Model
1. By default variable t (time) is used as the independent variable in a new model. If you want to change it click the Independent variable symbol and specify a new independent variable.
2. Create model equations by defining variables with the variable icons available in the toolbar.
Click a variable 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 ‘?’.
The variable equations are displayed in the left part of the Model window.
Enter initial values, formulas and constants. These values are displayed in the right part of the Model window.
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 symbol and select a graph, meter or a value or .create new graphs.
5. Execute your model by clicking the activity toolbar button Start or by using .Run controller.
6. Errors of various kinds, 'bugs', can be made during a modeling process. Some errors can be simple mistakes, like misspelling a variable name (leading to confusion with a different variable) or creating a wrong formula (not according to the rules of Coach Language). In such cases Coach gives an error message and suggest where a problem was found.
7. Some errors can be more fundamental for example the choice of sign. 'Friction force' with the wrong sign will produce spontaneous acceleration and absurd results.
Editing an Equations Model
To edit an equation
Double-click an equation to open its variable properties dialog or click an equation symbol and move the cursor to the field you want to edit. You can only edit variable names, formulas and values of constants and initial values.
To make a selection of equations
Click on the small graphical symbol to select an equation.
Use <Ctrl>+<click> (Windows) or <Cmd>+<click> (Mac) to select more equations.
To move an equation
Select an equation.
93
Move the equation to another location by using the keys <PgUp> and <PgDown> (Windows) and <Fn> + <arrow up and down> (Mac).
To copy equation(s)
Make a selection of equations.
Right-click outside of 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.
To delete equation(s)
Make a selection of equations.
Delete equations by pressing <Del> (Windows) or <fn> + <backspace> or <fn> + <Delete> (Mac).
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.
To move an annotation up and down
Mac - use the arrow up and down key together with <Cmd>-key.
Windows - use the arrow up and down key together with <Alt>-key.
Useful shortcuts
With the menu option Undo or <Ctrl>+<Z> the last performed action is canceled.
With <Ctrl>+<A> the whole model is selected.
By using the menu option Edit > Font, the fonts of all selected variables can be changed at once.
Displaying an Equations Model in Graphical or Text Mode
An equations-based model can be viewed and modified in graphical or text mode.
To display an equations model in graphical mode:
Click the toolbar button Graphical mode .
The equations-based model is automatically converted into a graphical model based on model definitions.
Now the model can be modified. Changes made in graphical mode will be transferred back to equations mode.
To display an equations model in text mode:
Click the toolbar button Text mode .
The equations-based model is automatically converted into a text-based model, based on model definitions and a selected integration method e.g. selecting Euler iteration method will create a much simpler program than selecting the Runge-Kutta method.
After a Text model is modified a warning message appears after trying to change the mode. Forcing to change the mode removes all modifications made in text.
94
Modeling in Text Mode
A text model is a model constructed according to the Coach Language rules; it is actually a program that consists of equations for calculations of the model variables. A text mode does not recognize differential equations automatically, these equations have to be written by the users. The number of iterations for the model calculations is defined in the model settings.
The topics in this chapter will help you to learn how to work in text mode. Creating a Text Model
1. After opening an empty 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.
2. In the left part of the Model window 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:
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. There is a little help you to create conditional and loop statements.
Click the Coach Language Command button .
The list of Coach Language commands, which can be used in text mode opens. You can use the following conditional and loop statements:
If Conditional expression Then Statements EndIf
If Conditional expression Then StatementsElse Statements EndIf
Repeat Statements Until Conditional expression
RedoNumber Statement EndRedo
While Conditional expression Do Statements EndDo
Once Conditional expression Do Statements EndDo.
Click a command to select it; the command will be placed at the cursor position in the model.
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.
4. In the right part of the Model window type in initial values. In Text mode, initial values may also be given as an expression (provided that this expression results in a number).
5. Click the Settings button and specify the number of iterations. Default is 101.
6. To be able to display your data variables in the data table and on graphs you have to select and define these variables:
95
Right-click the Model tool menu and select Variables. Click Add, select a variable from the drop-down list.
Type in its unit, decimals, minimum and maximum.
Click OK to confirm.
7. Select the way of presenting your model data. Right-click a variable symbol and select a graph, meter or a value or . create new graphs.
8. Errors of various kinds, 'bugs', can be made during a modeling process. Some errors can be simple mistakes, like misspelling a variable name (leading to confusion with a different variable) or creating a wrong formula (not according to the rules of Coach Language). In such cases Coach gives an error message and suggest where a problem was found.
9. Some errors can be more fundamental for example the choice of sign. 'Friction force' with the wrong sign will produce spontaneous acceleration and absurd results.
Editing a Text Model
To edit a text model
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.
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.
Press <Del> (Windows) or <fn> + <backspace> or <fn> + <Delete> (Mac).
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 canceled.
With <Ctrl>+<A> the whole model is selected.
Displaying a Text Model in Graphical or Equations Mode
A model build in text mode cannot be viewed in graphical and equations mode. 96
A graphical model and equation model can be viewed and modified in text mode. As long as the text model is not changed, it is possible to switch back to graphical or equation mode via Graphical mode and Equations mode toolbar buttons. After a Text model is modified a warning message appears after trying to change the mode. Changing the mode anyway removes all modifications made in Text mode.
97
Executing models in Coach
This advance topic will help you to better understand how models are executed in Coach.
Numerical Methods for solving differential equations
There are three numerical methods for solving differential equations offered by Coach:
Euler Method
Coach uses the forward Euler method:
yn+1 = yn + h * f(xn, yn)
Second order
Runge-Kutta method
Coach uses the MidPoint method:
k1 = h * f(xn, yn)
yn+1 = yn + h * f(xn + 0.5*h, yn + 0.5*k1)
Fourth order
Coach uses the classical fourth order Runge-Kutta method:
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)
yn+1 = yn + (k1 + 2*k2+2*k3+k4)/6
Model is a Coach Language Program
A model created in graphical and equations mode is converted into a text model by Coach according to the rules of Coach Language and the selected in the model settings integration method. Such a resulting model is not visible in these modes for users but can be seen when opening the model in text mode.
A text model in Coach should be written according to Coach Language rules. Coach does not give any guidance during the creation of text models. The text model is actually a Coach program and after starting its execution it is interpreted by theCoach Language interpreter.
Executing Text Model by Coach
A text model is executed in the following way:
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 state 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.
98
<aux> := <expression>
<flow>:= <expression> 5. All variables have values and the first point is saved: SaveData. 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 its 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 RungeKutta 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> - <outflow2> etc.)
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
<state>:= <expression in case of event>
EndDo
6. 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>
7. SaveData is automatically added at the end of the loop (not visible for users).
99
100
CHAPTER 6
Animations
Presenting data in graphs or in Data Table may not be enough for students to fully understand the underlying principles of a phenomenon. Coach 7 is enriched with another way of representing the data – Animations. Animations allow to visually represent models, to interact with models and control programs, they give visual feedback to measurements. Coach animations consist of animated graphics objects, like ellipses, rectangles, vectors and images, which can be linked to model variables, program variables or sensor values 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. Parameters can be linked to control elements, like, buttons and sliders, which can be used for interactive change of conditions before or during the simulation. The Basics
102
Elements of Animations
106
Creating Animations
121
101
The Basics
The topics in this chapter will help you to get started with Animations. Animation Toolbar
Animations have two modes of working: Play mode, in which animations are executed, and Edit mode (only possible in Author and Senior Student mode), in which animations are created and edited.
Each of the modes has its own toolbar.
Play mode toolbar
Hide/Show Properties to switch between Play mode (the Properties dialog is hidden) and Edit mode (the Properties dialog is shown)
Fit to Stage to fit the animation to the size defined by the pane or by the fit markers. Edit mode toolbar
Hide/Show Properties to switch between Edit (the Properties dialog is shown) and Play mode (the Properties dialog is hidden)
Insert Ellipse object - to create an animated ellipse (also: circle)
Insert Rectangle object - to create an animated rectangle (also: square)
Insert Vector object - to create an animated vector or line
Insert an Image - to create an animated image Insert a Control Button - to add a control button Insert a Control Slider - to add a control slider Select Mode - to reposition objects on the Animation stage (either this mode or Rotate mode is operational)
Rotate Mode to rotate objects on the Animation stage (either this mode or Select mode is operational)
Insert an Annotation - to insert an annotation Fit to Stage - to fit the animation to the size defined by the pane or by the fit markers
Interpret - to interpret a model and assign (initial) values variables controlling animation objects.
102
Animation Tool Menus
The Animation Tool menu is available after clicking the Tool menu button in the Animation pane or by rightclicking the Animation pane. The menus differ in Play and Edit mode. Also some areas of the Animation pane are sensitive (hotspots) and show a different tool menu.
PLAY MODE
Tool menu or right/click the Animation pane
Click the Tool menu button or right-click in the Animation pane.
Edit Title – to edit a title of the displayed animation
Run Controller – to display the Run controller
Reset Animation – to reset animation to its starting position
Zoom (50%, 75%, 100% 125% 150% 200%) – to zoom the animation stage
Zoom to fit – to fit the animation stage to the pane size or fit markers
Print – to print an animation canvas
Clipboard Copy - to copy the animation canvas as an image to the clipboard
Help – to consult the help system.
EDIT MODE
Tool menu or right-click in the Animation pane
Click the Tool menu button or an empty space in the Animation pane.
Edit Title – to edit a title of the displayed animation
Run Controller – to display the Run controller
Edit – to Undo and Redo the last user action
Center Coordinate System – to place the animation coordinate system in the center of the animation canvas
Hide Stage Rules – to hide or display the stage rules
Use Fit Markers – to use fit markers of the animation for the zoom to fit
Zoom (50%, 75%, 100% 125% 150% 200%) – to zoom the animation stage
Zoom to fit – to fit the animation stage to the pane size or fit markers
Animation Z-order - to display and modify the Z-order of animation objects
Print – to print an animation canvas
Clipboard Copy - to copy the animation canvas as an image to the clipboard
Help – to consult the help system.
Hotspot: an animation object
Right-click a hot spot to evoke its menu.
Digital Display – to show a digital display next to a variable during the animation
Object Z-order – to modify the object's Z-order
Edit – to cut, copy or copy to Clipboard, delete and paste the object and undo and redo the last user action
103
Copy Position from – to copy the position used by another animation object.
Executing animation
Animations are executed in Play mode. To execute animation(s)
Click the activity toolbar Start button to run a model, control program or a measurement. The animation(s) will be executed as long as the model or program is executed or as long as the measurement lasts.
If desired use the Zoom to fit button to fit the animation to the size of the Animation pane. To interrupt execution use the activity toolbar button Stop
or keep <Esc> pressed.
Alternatively, the animation can also be controlled by using the Run Controller in a similar way as in Modeling. It can be placed in the screen by checking the option Run Controller in the Tool menu of the Animation pane or the Model window.
After the animation is finished you can reset it by right-clicking the Animation pane and selecting Reset
Animation.
Managing Animations
An Activity may consist of several Animations. By clicking the activity toolbar button Animation
or the arrow next to it, you can see if there are more Animations present. An Animation can appear only once; it can be displayed in a pane or listed in the Animations list.
To move an Animation to another pane
Click the caption of the Animation pane you want to move.
Start to drag the caption; the cursor displays the Animation icon.
Move the Animation icon over a pane in which you want to place the Animation and click the pane.
To select another than the displayed Animation
Click the activity toolbar button Animation
firm.
. Select an animation from the list and click OK to con-
or
Click the arrow at the right side of the button Animation and select an animation.
The cursor displays the Animation icon.
Move the Animation icon over a pane in which you want to place the animation and click the pane.
To edit an Animation title
Click the activity toolbar button Animation
. Select the desired animation and click Edit.
Click the Tool button of the Animation pane and select Edit Title.
or
Enter a title. This title will be displayed in the Animation pane caption.
104
Click OK to confirm.
Author and Senior-student users may select but also create, delete and copy animations. To add a new (empty) Animation
Click the activity toolbar button Animation
and select New Animation.
Type in an animation title and click OK.
A new animation is added to the list. Click Edit if you want to change the animation title.
Click OK to select the animation. The cursor displays the Animation icon.
Move the Animation icon over a pane in which you want to place it and click the pane.
A new (empty) animation is displayed in the pane. or
Click the arrow next to the activity toolbar button Animation
and click Add new.
Type in an animation title and click OK.
The cursor displays the Animation icon.
Move the Animation icon over a pane in which you want to place it and click the pane.
A new (empty) animation is displayed in the pane. Right-click an animation pane and select Edit title if you want to change its title.
To delete an Animation
Click the activity toolbar button Animation
Delete.
and select an animation you want to delete and click Confirm that you really want to delete the animation.
To copy an Animation
Click the activity toolbar button Animation
Copy Animation.
and select an animation you want to copy and click A duplicate animation appears in the list. 105
Elements of Animations
Coach animations are created on the . animation stage. Each animation has its background. Animations consist of: animated graphics objects, like ellipses, rectangles, vectors and images, which can be linked to model variables, program variables or sensor values to control their positions or sizes.
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 Coordinate System
Each animation has one stage coordinate system which is defined in its Background properties (in pixels or other units). Local (object) Coordinate System
Each animation 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 the initial values of the 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.
Stage Rules
The stage rulers follow the coordinate system settings and display the size of the stage in the stage coordinate system units.
To hide/show the stage rulers:
The stage rules are displayed by default in Edit mode.
To hide the stage rules, right-click the Animation pane and select the option Hide Stage Rulers.
To show the stage rules again, right-click the Animation pane and select Show Stage Rulers.
Fit Markers
With the fit markers, the creator of an animation can specify a stage area which remains visible when zoom-tofit 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 direction(s) of its motion.
To set the fit markers
To be able to set the fit markers the stage rules should be visible. Right-click the Animation pane and select the option Use Fit Markers.
Specify a ´zoom-to-fit` stage area by moving dark gray bars on the stage rulers. The light gray bars define the area. Note: After resizing the Animation pane you can have a problem to “find” the dark gray bars. To solve it first uncheck the option Use Fit Markers and then check it on again. After this action the markers adjust to the new Animation pane size and are easy to get.
106
Background
An animation always has a 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 Edit Properties dialog.
Background: Coordinate System
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 stage. By default in a new animation the origin of the stage coordinate system is placed in the middle of the stage and the unit is 1 pixel. The stage rulers follow this system and display their values in the stage coordinate unit.
Change the location of the coordinate system
Drag the origin or one of the axes of the coordinate system displayed in the Animation 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.
Or Select Background from the drop-list of the Properties sheet. Type the coordinates X, Y of the new origin in the respective X and Y fields of the Coordinate System tab.
The coordinate system origin can simply be re-centered by right-clicking the Animation stage and selecting Center Coordinate System.
Show - check if you want to display the stage coordinate system in Play mode.
Same system for all objects - check to use the stage coordinate system as the global system for all objects. It will then be not possible to define the objects’ local coordinate systems. The options regarding local coordinate systems will disappear from the objects’ properties.
Scale coordinate system - check to re-scale the stage coordinate system into other units than pixels.
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.
A ruler displaying a distance of 100 px appears on the stage. Type in a new scale and its unit (+ means that the direction is positive (from left to right), - means that the direction is negative (from right to left). You can drag the ruler on the stage to define the new distance in pixels. After this is done all information in the objects’ properties will be displayed in the new units. Also the stage rulers use the new scale.
Background: Display
Background Color
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.
Background Grid
A grid can be displayed on the background. 107
To show a 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.
Image
The Background can contain an image.
Check the option Image. Now several related options appear.
Click the Browse button and browse your computer to find a background image. Click OK.
If needed specify other related options: Has transparent color – check to indicate which color in the image becomes transparent.
Position on stage – displays the actual position of the image on the stage, the X and Y coordinates of its lower left corner in units of the stage coordinate system. To place a image in another location on the stage type the new X and Y coordinates of the lower left corner of the image or move the cursor over the image on the stage, until it changes into a cross, and drag the picture to its new location.
Size – displays the size of the image (in stage units). To change the size type new values for Width and Height. Keep aspect ratio - check (on by default) to keep the ratio between width and height of the image constant during resizing of the image. Reset - use to reset the image to its original dimensions.
Tile (Horizontally, Vertically, All directions) - check to place copies of the original background image to fill the stage (respectively in horizontal, vertical or both directions). The original image is indicated by a black frame around it.
Auto-fit - when selected then Coach resizes the image to fill the Animation stage. 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.
Background type - a background image can be displayed stationary or can move during the animation, the following is possible: stationary - the background image does not move,
looping- the background image moves in a horizontal or vertical loop,
zooming - the background image is zoomed in or out. Moving the background image in a loop
If the option Looping is selected as the Background type then the background image can move in horizontal or and/or vertical direction in a loop. This motion can be controlled by a constant-rate factor, or by a variable. This is specified in the tab Looping, which appears after the background type is set to Looping. If the background image is tiled in the chosen direction(s) then a continuously unwinding background image can be created. To make this look realistic, the image 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 motion of the background image
Select the reference point of the background image from where the motion takes place. By default the center of the image is taken.
108
Make a connection by selecting a constant rate or a variable from the list of available variables for the zoom.
Check Local scale to change the scaling of the 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 movement.
Zooming the background image
If the option Zooming is selected as the background type, then the size of the background image is either enlarged or diminished during the animation. This zooming motion can be controlled by a constant-rate factor, or by a variable. This is specified in the tab Zooming, which appears after the background type is set to Zooming. To control the zooming of the background image
Select the reference point of the background image from where the zooming takes place. By default the center of the image is taken.
Make a connection by selecting a constant rate or a variable from the list of available variables for the zoom.
Check Local scale to change the scaling of the 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 zooming.
Animated Objects
There are four types of objects which can be animated on the animation stage:
Ellipse,
Rectangle,
Vector, and Image.
Each Animated object has its own properties sheet which is displayed in Edit mode when the object is selected. Animation is achieved by letting the objects move across the screen, by changing their dimensions or by rotation. Ellipse
This graphic object allows you to create an animated object, which has the shape of an ellipse or a circle. 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. Reference point (Center, Left center, Top center, Right center, Bottom center) - use to set the reference point of the ellipse. By default Center is used.
Origin of local coordinate system - the X and Y coordinates of the origin of the local coordinate system are specified in terms of the stage coordinates. 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 109
above the coordinate system changes into a hand). Check Show if you want to show the local coordinate system of the object in Play mode. Click Color to change the color of the displayed object's coordinate system. Note: 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.
Connections - the options in this section allow to define the object movement on the stage during the animation. To define a screen movement in the horizontal direction select the connection (stationary or a connection to a variable) from the drop-down list under Horizontal direction.
To define a screen movement in the vertical direction select the connection (stationary or a connection to a variable) from the drop-down list under Vertical direction.
To define a rotary movement of an object around its center (only) as the reference point, select the connection (stationary or a connection to a variable) from the drop-down list under Angular direction. It is not possible to scale this connection locally; for rotation always real angles are used. : The animation uses the settings for degrees/radians as specified in the Activity Options.
1. When Stationary is selected, then the object does not move/rotate. The respective position - 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 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. 2. When a connection to a variable is made then the selected variable controls the movement of the reference point of the object. 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.
3. 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).
DIMENSION TAB
With the options on this tab it is possible to control the size of an object during the animation. Circle - select when you want use a circle instead of an ellipse. When selected some options disappear, definitions have to be done only for the circle radius.
Semimajor axis/Semiminor axis - allow controlling the dimensions of the object during the animation. To define resizing in along the semimajor axis select the connection (stationary or a connection to a variable) from the drop-down list under Semimajor axis.
To define resizing in along the semiminor axis select the connection (stationary or a connection to a variable) from the drop-down list under Semiminor axis.
1. When Stationary is selected, then the object does not change its size . The respective fixed dimension, given in terms of the local coordinate system, is specified in the field next to the drop-down list. The size can be changed by typing a new value or by resizing an object on the stage. 2. When a connection to a variable is made, the selected variable controls the length along the respective axis. 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.
3. 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 110
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).
DISPLAY TAB
This tab contains options connected to the way the object is displayed on the stage.
Name - displays the object's name. To change type in a new name.
Show name - check to display the object's name next to the object on the stage. The Font button allows changing a font of the displayed name.
Show digital display - check to display digital values of the connected variable(s) 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). Fill color - to select the inside color of the object. Check Semi-trasparent to make an object semi-trasparent. When 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 - defines 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.
Show trajectory of - by checking this option the path of the selected point (default the reference point) is displayed on the stage during the animation. This option is only active if the object has a connection. 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 checked 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 checked only the start and end position of the object are marked.
Rectangle
This graphic object allows you to create an animated object, which has the shape of a rectangle or a square. POSITION TAB
With the options on this tab it is possible to control the position of the reference point of the rectangle during animation, or to rotate it. Reference point (Center, Left center, Top center, Right center, Bottom center) - use to set the reference point of the ellipse. By default Center is used.
Origin of local coordinate system - the X and Y coordinates of the origin of the local coordinate system are specified in terms of the stage coordinates. 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). Check Show if you want to show the local coordinate system of the object in Play mode. Click Color to change the color of the displayed object's coordinate system.
111
Note: 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.
Connections - the options in this section allow to define the object movement on the stage during the animation. To define a screen movement in the horizontal direction select the connection (stationary or a connection to a variable) from the drop-down list under Horizontal direction.
To define a screen movement in the vertical direction select the connection (stationary or a connection to a variable) from the drop-down list under Vertical direction.
To define a rotary movement of an object around its center (only) as the reference point, select the connection (stationary or a connection to a variable) from the drop-down list under Angular direction. It is not possible to scale this connection locally; for rotation always real angles are used.: The animation uses the settings for degrees/radians as specified in the Activity Options.
1. When Stationary is selected, then the object does not move/rotate. The respective position - 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 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. 2. When a connection to a variable is made then the selected variable controls the movement of the reference point of the object. 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.
3. 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).
DIMENSION TAB
With the options on this tab it is possible to control the size of an object during the animation. Square - select when you want use a square instead of a rectangle. When selected some options disappear, definitions have to be done only for the square height.
Width/Height - allow controlling the dimensions of the object on the stage during the animation. To define resizing horizontally select the connection (stationary or a connection to a variable) from the drop-down list under Width.
To define resizing vertically select the connection (stationary or a connection to a variable) from the drop-down list under Height.
1. When Stationary is selected, then the object does not change its size . The respective fixed dimension, given in terms of the local coordinate system, is specified in the field next to the drop-down list. The size can be changed by typing a new value or by resizing an object on the stage. 2. When a connection to a variable is made, the selected variable controls the length along the respective axis. 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.
3. 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).
DISPLAY TAB
This tab contains options connected to the way the object is displayed on the stage.
112
Name - displays the object's name. To change type in a new name.
Show name - check to display the object's name next to the object on the stage. The Font button allows changing a font of the displayed name.
Show digital display - check to display digital values of the connected variable(s) 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). Fill color - to select the inside color of the object. Check Semi-trasparent to make an object semi-trasparent. When 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 - defines 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.
Show trajectory of - by checking this option the path of the selected point (default the reference point) is displayed on the stage during the animation. This option is only active if the object has a connection. 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 checked 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 checked only the start and end position of the object are marked.
Vector
This graphic object allows you to create an animated line or vector. The image below indicates the Begin and End points of the vector. POSITION TAB
With the options on this tab it is possible to control the movement of the begin point of a vector. Reference point - as the reference point the Begin point is used. Origin of local coordinate system - the X and Y coordinates of the origin of the local coordinate system are specified in terms of the stage coordinates. 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 113
above the coordinate system changes into a hand). Check Show if you want to show the local coordinate system of the object in Play mode. Click Color to change the color of the displayed object's coordinate system.
Note: 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.
Connections - the options in this section allow to define the movement of the vector begin point on the stage during the animation. To define a movement in the horizontal direction select the connection (stationary or a connection to a variable) from the drop-down list under Horizontal direction.
To define a movement in the vertical direction select the connection (stationary or a connection to a variable) from the drop-down list under Vertical direction.
1. When Stationary is selected, then the begin point does not move. Its position - coordinate of this 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. A vector's begin point can be relocated in its own coordinate system by typing a new value or dragging a vector to a new location on the stage. 2. When a connection to a variable is made then the selected variable controls the movement of the vector's begin point. 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.
3. 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).
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.
X-component/Y-component - allow controlling the position of the end point of the vector during animation in Cartesian coordinate system. To control the length of the vector horizontal component select the connection (stationary or a connection to a variable) from the drop-down list under X-component.
To control the length of the vector vertical component select the connection (stationary or a connection to a variable) from the drop-down list under Y-component.
1. When Stationary is selected, then the selected vector component does not change its size. Its length, given in terms of the local coordinate system, is specified in the field next to the drop-down list. The length can be changed by typing a new value or by dragging the vector's end point on the stage. 2. When a connection to a variable is made, 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. 3. 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).
Length/Angle - allow controlling the position of the end point of the vector in Polar coordinate system . To control the length of the vector select the connection (stationary or a connection to a variable) from the drop-down list under Length.
114
To control the angle of the vector select the connection (stationary or a connection to a variable) from the drop-down list under Angle. The animation uses the settings for degrees/radians as specified in the Activity Options.
1. When Stationary is selected, then the length/angle does not change. Their respective values, given in terms of the local coordinate system, 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. 2. When a connection to a variable is made then the selected variable controls the selected the vector's length and/or angle. The initial value of this variable determines the initial length/angle. This value is automatically received 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)!
3. 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).
DISPLAY TAB
This tab contains options connected to the way the object is displayed on stage.
Name - displays the object's name. To change type in a new name.
Show name - check to display the object's name next to the object on the stage. The Font button allows changing a font of the displayed name.
Show digital display - check to display digital values of the connected variable(s) 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). Show arrow - check to display (by default on) an arrow head at the end of the line.
Show components - check to display horizontal and vertical vector components. The components will be drawn in the selected color.
Line color - defines the color of the line. Line width - defines the width of the line.
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.
Show trajectory of - by checking this option the path of the Begin point or End point is displayed on the stage during the animation. 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 checked 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 checked only the start and end position of the object are marked.
Image
This graphic object allows to create an animated image. A desired image is selected via the Open file dialog.
POSITION TAB
With the options on this tab it is possible to control the position of the reference point of the ellipse during 115
animation, or to rotate it. Reference point (Center, Left center, Top center, Right center, Bottom center) - use to set the reference point of the ellipse. By default Center is used.
Origin of local coordinate system - the X and Y coordinates of the origin of the local coordinate system are specified in terms of the stage coordinates. 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 hand). Check Show if you want to show the local coordinate system of the object in Play mode. Click Color to change the color of the displayed object's coordinate system.
Note: 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.
Connections - the options in this section allow to define the image movement on the stage during the animation. To define a movement in the horizontal direction select the connection (stationary or a connection to a variable) from the drop-down list under Horizontal direction.
To define a movement in the vertical direction select the connection (stationary or a connection to a variable) from the drop-down list under Vertical direction.
To define a rotary movement of an object around its center (only) as the reference point select the connection (stationary or a connection to a variable) from the drop-down list under Angular direction. It is not possible to scale this connection locally, for rotation always real angles are used.
The animation makes use of settings of degrees/radians specified in the Activity Options.
1. When Stationary is selected, then the image does not move/rotate. The respective position - 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 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. 2. When a connection to a variable is made then the selected variable controls the movement of the reference point of the object. 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.
3. 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).
DIMENSION TAB
With the options on this tab it is possible to control the size of an object during the animation. Width/Length - allows controlling the dimensions of the image on the stage during the animation. To control the width of the image select the connection (stationary or a connection to a variable) from the drop-down list under Width.
To control the length of the object select the connection (stationary or a connection to a variable) from the drop-down list under Length.
1. When Stationary is selected, then the image does not change its size . The respective fixed dimension, given in terms of the local coordinate system, is specified in the field next to the drop-down list. The size can be changed by typing a new value or by resizing an object on the stage. 2. When a connection to a variable is made then the selected variable controls the length along the respective axis. The initial value of this variable determines the initial dimension. This value is automatically 116
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.
3. 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).
Lock aspect ratio – check to keep the ratio between the width and height of the image constant when resizing the image (default on). Use the Reset button to reset the image to its original dimensions.
DISPLAY TAB
This tab contains options connected to the way the object is displayed on stage.
Image file name - displays the name of the picture file. If the name is too long, a tooltip displays the full name (and path). Use the Browse button to replace the existing image by another image.
Has transparent color - check to define a transparent color in the image.
Name - displays the object's name. To change type in a new name.
Show name - check to display the object's name next to the object on the stage. The Font button allows changing a font of the displayed name.
Show digital display - check to display digital values of the connected variable(s) 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). 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.
Show trajectory of - by checking this option the path of the selected point (default the reference point) is displayed on the stage during the animation. This option is only active if the object has a connection. 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 checked 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 checked only the start and end position of the object are marked.
Control Objects
Parameters 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, and Slider. Each Control object has its own properties sheet which is displayed in Edit mode when the object is selected. Button
This graphic object allows you to create a Control button, which has the shape of a button, a checkbox, a switch or a radio button. Such Control button can have two value states e.g. On and Off. Specific values are assigned to these two states. DEFINITION TAB
117
Shape - use to select the shape of the control button. There are four shapes available: Button - not pressed /pressed Checkbox - not checked Switch - Off / checked / On Radio Buttons - Position on stage - the X and Y coordinates of the left bottom corner point of the button are specified in terms of the stage coordinates. To relocate the control button type in the new X and Y coordinates of the left bottom corner point in terms of the stage coordinates or select the button on the stage, press and hold <Ctrl> and drag it to another location. Dimensions - the width and height of the control button are specified in terms of the stage coordinates. To change the control button size type in new values of Width and Height in the indicated unit or select the control button on the stage and drag to re-size it. Check Keep aspect ratio to keep the ratio between the width and height of button constant during resizing.
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 Range properties, State 0 (Off) and State 1 (On) appear. Select a state value field and type in the value which should be used for the selected state. DISPLAY TAB
This tab contains options connected to the way the object is displayed on stage.
Name - displays the object's name. To change type in a new name.
Show name - check to display the object's name next to the object on the stage. The Font button allows changing a font of the displayed name.
Show state names - check to display (by default on) the names of the states on the control object on stage. The Font button allows changing the font of the displayed states. If needed drag to a desired position. Show value - check to display the current state value next to the control object on the stage. The Font button allows changing a font of the displayed value. If needed drag to a desired position. Slider
This graphic object allows you to create a Control slider, which has the shape of a slider, a bar, a spinner, radio buttons or a drop-down list. Such Control slider can have ‘multiple states’ to which values are assigned in a continues or a discrete way (only up to 25 values).
DEFINITION TAB
Shape - use to select the shape of the control slider. There are five shapes available: 118
Slider - Bar - Spinner - Radio buttons - Drop-down list - Position on stage - the X and Y coordinates of the left bottom corner point of the slider are specified in terms of the stage coordinates. To relocate the control slider type in the new X and Y coordinates of the left bottom corner point in terms of the stage coordinates or select the slider on the stage, press and hold <Ctrl> and drag it to another location. Dimensions - the width and height of the control slider are specified in terms of the stage coordinates. To change the control slider size type in new values of Width and Height in the indicated unit or select the control slider on the stage and drag to re-size it. Check Keep aspect ratio to keep the ratio between the width and height of button constant during resizing.
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. Use Continues if your slider needs to have many steps e.g. 100 steps and Discrete if only few states are needed e.g. 5 steps. For Radio buttons and Drop-down list shapes only Discrete type is possible. For Continues specify the slider minimum value, maximum value, number of steps or step size used in the slider, and the number of decimals which will be used on its display. For Discrete specify the number of steps (max. 25) and a value for each step. DISPLAY TAB
This tab contains options connected to the way the object is displayed on stage.
Name - displays the object's name. To change type in a new name.
Show name - check to display the object's name next to the object on the stage. The Font button allows changing a font of the displayed name.
Show state names/Show range - check to display (by default on) the names of the states/ on the control object on stage. The Font button allows changing the font of the displayed states. If needed drag to a desired position. 119
Show value - check to display the current state value next to the control object on the stage. The Font button allows changing a font of the displayed value. If needed drag to a desired position. Orientation - to select Horizontal or Vertical orientation of the control slider (not available for Radio buttons and Drop-down list shapes).
Empty color, Full color and Pointer color - can be defined for the Bar shape.
Color can be defined for the Drop-down list shape.
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 secondly 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 list 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.
Note: Placing objects behind the background assigns them a negative Z-order value. This can be useful if the background image covers only part of the stage.
120
Creating Animations
Creating an Animation
Animations are created in Edit mode. To open an animation in Edit mode : In Play mode click the Hide/Show Properties button .
The animation pane displays extended Toolbar and the Edit properties dialog.
Note: A newly created animation is opened in Edit mode. Constructing an animation is an easy process: in general, define the animation background, choose the desired graphical objects, place them on the animation stage and assign their properties to define the way they are displayed and animated. Add additional interactive control objects and assign their propertied. These control objects will allow altering parameter variables during the execution of the animation to interact with the system and to see the effect of those changes. The steps below describe this process in detail: 1. Click the arrow next to the Animation button and select Add new or click the Animation button and click New Animation (present 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 construct and modify an animation. The Properties dialog for the Background is displayed directly on the screen.
5. Define theAnimation stage. 6. Define the Background: the location of the stage coordinate system (default the center of the pane), color, grid, movement etc. 7. Place animated objects on the stage and connect them to a variable(s) to animate it:
Ellipse and Rectangle: Click the Ellipse button or the Rectangle button , the cursor shape changes into the small ellipse or 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 button , 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.
Image: Click the Image button , in the Open file dialog select the desired image file and click Open, the cursor shape changes into a small image symbol, move the cursor into the Animation pane, position it and click. The picture gets the default name Image 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.
121
8. Define the properties of all .animated objects.
Note: 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 already defined object from the list. 9. Place or ),Place control objects, (Button or Slider), on the stage. Click a control button or control slider , 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. 10. Define the properties of all control objects.
Editing an Animation
To open an Animation in Edit mode
Click the Hide/Show Properties button in the Animation toolbar. To select an object and display its properties
Click an object on the animation stage or select the object’s name from the drop-down list in the Properties dialog.
To edit an object properties
Select the object on the animation stage.
Edit its properties in the Properties dialog.
To move an animated object (Ellipse, Rectangle, Vector or Image) on the stage
Select the animated object on the stage.
Drag the object to its new position or type its new coordinates in the Properties dialog.
To move a control object (Button and Slider) on the 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 coordinates in the Properties sheet.
To delete an object on the stage
Select an object on the stage.
Press <Del> - key to delete it.
Useful shortcuts
With the menu option Undo or <Ctrl>+<Z> the last performed action is canceled.
122
CHAPTER 7
Working with Data
Data collected from measurements with sensors, video or image measurements, models and programs can be displayed in: Data collected from measurements with sensors, video or image measurements, models and programs can be displayed in: Data Table, Graph(s), Meter(s) and Value(s) and processed with the help of advanced analysis and processing tools. Data Table
124
Graph
134
Meter
142
Value
143
Analyze and Process Tools
144
123
Data Table
Coach automatically creates variables for the data collected via sensors, actuators, video measurements, generated by models, mathematical functions or entered manually. The data of these variables are stored in columns of the Data Table. There is only one Data Table in an Activity/Result.
The Data Table remains empty as long as no run is performed. On starting a data collection, video measurement or a model the table is filled with data. The number of variables (data column) is not limited in the Data Table. A Run can maximally contain 500,000 rows of data. A new Run is added in the Data Table after each new run.
To display the Data Table
Contains the name of the currently selected folder.
Click the Data Table button to show or to hide the Data Table pane.
By default the Data Table pane is placed on the top of Coach panes. To dock the window right-click the Data Table and select Dock. To undock right-click the Data Table or click its Tool menu and select Undock.
If the Data Table pane is too small to display all the columns, use the horizontal scroll bar at the bottom of the window to see each column or zoom the text in the table by using the Tool menu option Text Zoom.
To move through the rows of data, use the vertical scroll bar on the right side of the table.
The Basics
The topics in this chapter will help you to get familiar with the Data Table window. Data Table organization
A Data Table is organized in the following way:
LEFT PART - displays Run Series, by default the run number and its name. Also variables interpreted as run parameters (having one value per run), are displayed at this side of the table. Such variables are for example constant variables from a model or variables whose value is manually typed in. By default these parameter variables are hidden in the Data Table.
RIGHT PART - displays Data Series, often Time Series.
MIDDLE PART – links the left and right parts of the table and visualizes the connection between the run and its data.
Click the ‘+’ button to expand the selected run to show all its data rows.
Click the ‘-‘ button to close it and to display the total number of data rows.
Move the horizontal divider to make the left side of the table wider.
Click the ‘+’ button on the top to expand all runs, and the ‘-‘ button on the top to close all runs.
Tool Menu
Show Variable - to show/hide a variable in Run or Data Series.
Add a New Variable - to add a new Variable into Run or Data Series.
Delete Variable – to delete a variable (only possible for variables added by users) added by a user.
Data Rows - to sort, delete and insert empty rows into a data series. This option is active only when the data series is selected.
124
Runs - to delete, import, export and insert new runs.
Text Zoom - to zoom the fonts used in the table. Select the percentage of zooming.
Dock/Undock - to dock/undock the Data Table window.
Print – to print the visible part of the table.
Clipboard copy - to copy the image of the visible part of the table.
Help – to consult Help.
Editing Data Table
To select a run
Click a run number on the left side of the Data Table.
To open/close a data series
Click the ‘+’ button to expand the selected Run to show all its data rows.
Click the ‘-‘ button to close it and to display the total number of data rows.
To select a data series
If a data series is closed click a row with information about the number of data rows on the right side of the Data Table.
If a data series is opened click a cell in a data cell.
To make a selection
Click and drag the mouse pointer across ranges of cells in a table.
To select a data row in a data series
Click the ‘+’ button to expand a run in which you want to select data row.
Click the data row you want to select.
To select and edit a cell
To select a single cell click in the cell.
When possible, e.g. for manual variables, edit the cell.
To move a variable column
Click the variable heading of the column you would like to move.
Drag the variable icon to the border between the two variables columns. The area where to drop it is highlighted by the blue rectangle.
Drop the icon. The variable will be placed between the two columns.
Working with Variable Columns
Displaying and Hiding Variables
Variables automatically generated by Coach cannot be deleted from the table. For better visibility you can hide variables in the table. For this reason by default some variables, such as Flow and Constant model variables, are hidden in the table.
125
To hide/show a variable in the table
Right-click the Data Table window or click its Tool menu.
Select Show Variable and depending on the position of the variable in the table select in Run Series or in Data Series.
A list of all variables is displayed; the visible variables are indicated by the check symbol.
Check a Variable which you want to show, or uncheck a Variable, which you want to hide.
The table will be adjusted accordingly.
Variables in Run Series (Run parameters)
Variables displayed under Run Series at the left side of the Data Table are interpreted as run parameters (having a one value per run). Such variables are for example constant variables from a model or variables which value is manually typed in. By default these parameters are hidden in the Data Table.
For example in your experiment you measure voltage during the process of discharging a capacitor. In each measurement run you change the capacitor (capacitance value). Then you can add a manual variable ‘Capacitance’ to your Data Table and manually enter the capacitance value for each of your measurement runs.
Or you model the motion of a parachute jump and you simulate the motion depending on the parachute diameter. If the parachute diameter is defined in the model as a constant variable then it is interpreted as run parameter (by default not shown in the table). You can use Simulate option, available via the Tool menu of the Model window, and execute your model for different values of the parachute diameter. For each value of the parameter a new run is added to the table with the respective diameter value inserted into the table.
To add a variable – run parameter
Right-click the Data Table or click its Tool menu.
Select Add a new Variable into Run Series.
Select: Manual.
Fill in the properties of the new variable.
Confirm with OK, a new variable will be added.
Type in a value for each of your measurement runs.
Variables Properties
Each variable has its default properties: its connection, label, unit, number of decimals and color.
To change variable properties
Click the heading variable at the top of the column. The Variable Properties dialog opens.
Specify the variable properties: Connection: The Connection shows to which data source the variable is coupled. This field cannot be edited. Label: The unique variable name used in the column headings, graph axis labels and dialogs.
Unit: The Unit follows the Label in the column heading and in graph axis labels. For some variables their units are defined via connected data and cannot be edited here e.g. the clock, sensor values or model variables.
Decimals: The number of decimals used to display data in the table.
Scientific notation: If checked then data in the table are displayed in scientific notation.
Color: The Color applies to the column heading, variable data in the table, graph axis labels/units and markers/line style used in graphs. Runs of the same variable are indicated by different shades of the selected color.
Click OK to confirm or Cancel to cancel the changes.
126
Types of data sources used in Connections
The Coach program automatically creates new variables for storing data and adds them to the Data Table. Depending on the type of Activity there can be different types of data connected.
Clock: The clock is the connection type which represents time data in Measurement, Control and Data-Video Activities.
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.
Interface inputs and outputs: These connections depend on the used panel inputs/sensors and panel outputs/actuators. For example connection A1: Light sensor represents the data measured through the light sensor connected to input 1 of the interface.
Data-video points: These connections are linked to video or image points. For example connection P1X represents the x coordinate of the video point P1.
Variables: These connections are linked to variables from a model or a program. For the text model and the control program only variables defined in the List of Variables are displayed.
Manual input: This connection type is used for:
1. manual type of measurements, Coach prompts to type the variable values each time the Manual Measurement button is pressed.
2. direct typing of the values in the cells of a column.
3. furthermore, variables with imported data or variables, generated via some processing tools like Signal Analysis or Histogram, are automatically set to manual input.
Formula: This connection type is used to assign a formula to a variable and to perform calculations on data. To create a formula you can type in a formula directly (for experienced users) or you can use the Formula Editor.
Adding and Deleting Variables
Adding a New Calculated Variable
A new variable calculated based on a formula e.g. Derivative(X;Y), can be added to the right part of the data table. In such a case the new variable is calculated for all data rows in a series, and where possible, for all runs in the table. New formula variables can be added at any time before or after collecting or entering data.
To add a formula variable
Right-click the Data Table window or click its Tool menu.
Select Add a new Variable and select Data Series.
Select the type of new variable: Formula.
Fill in the properties of the new variable.
Confirm with OK, a new variable will be added to the table and directly calculated if data of variables used in the formula are present in the table.
Adding a New Manual Variable
New variables, whose data are entered via manual input can be added to the Data Table, as well to the Run Series as to the Data Series. A manual column can be manually edited in the table. New manual variables can be added at any time before or after collecting or entering data.
To add a new manual variable
127
Right-click the Data Table window or click its Tool menu.
Select Add a new Variable and, depending on the position where you want to add the variable on the table, select in Run Series or in Data Series.
Select the type of new variable: Manual input.
Fill in the properties of the new variable.
Confirm with OK, a new variable will be added to the respective part of the table. The cells of this variable are empty. For manual measurement the new data will be added during a manual measurement, in other cases the data can be directly typed in.
Deleting a Variable
The user can only delete variables added by users.
To delete a (user) variable
Right-click the Data Table window or click its Tool menu.
Select Delete Variable.
Click Yes to definitely delete the selected variable.
Formula
A formula can be used to do calculations on data for example in the Data Table or for calculating Auxiliary variable in Modeling. To create a formula you can:
type a formula directly, the formula has to obey the Coach Language rules (recommended only for experienced users) ,
use the Formula Editor (available for Senior student and Author users),
use the Formula Wizard (available for Junior student users).
Formula Editor
To create a formula you can use the Formula Editor (Senior student and Author users).
To create a formula with the Formula Editor
When applicable click the Formula or Define button to open the Formula Editor dialog.
Create the formula by selecting variables, operations, functions, and typing numbers.
For mathematical operations which use more than one parameter, e.g. Filter(X;n) or DerivativeSmooth
(X;Y;n,), parameters are specified between brackets and are separated with semi-colon ‘;’ (special mathematical functions). By default the cursor is placed in the position to type the first parameter. It is necessary to move the cursor to the next position for entering the next parameter.
In formulas values of constants can be entered directly from Coach. The program offers a database with predefined constants, which consists of the following fields: Symbol, Value, Unit and Quantity.
Click the Constants button.
Select a symbol, value, unit or quantity of a constant and click the Select button.
The value of the constant is placed in the formula at the cursor position.
Variables defined by formulas are automatically evaluated and if possible calculated. Such variables can also be defined before a run is executed, then they are calculated in real-time during measurements. For example: position is measured against time and velocity is prepared to be calculated with Derivative(t;x) formula. During the measurement, both the position and the velocity are displayed in real-time.
128
Notes:
Formulas should obey the rules of Coach Language.
For inexperienced users, it is recommended to use the formula editor rather than free typing.
Some of the mathematical formulas are placed automatically in the Data Table as a result of using processing tools in graph e.g. Derivative, Integral, Smoothing, etc.
Formula Wizard
To create a formula you can use the Formula Wizard (Junior student users).
To create a formula with the Wizard
Click the Edit button to open the Formula Wizard dialog.
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.
Copying Variable data from one Run to another Run
Different runs of the same variable can be nicely compared in the graph, but it is a rather qualitative comparison. To be able to make comparative quantitative calculations of the variable data for different runs it is possible to copy the data of a variable from a certain run into another run.
To copy a variable column from one run to another run
Select a data series (at the right side of the table) or select a cell in a column of the data series from which you want to copy the data.
When you start to drag a variable heading of the column you want to copy e.g. T(C) the cursor changes into an icon representing the variable.
Continue dragging until you place the cursor over a run number e.g. 2 (to which you want to copy the data (at the left side of the table).
When the run number is selected release the icon. A new variable column with the heading Copied T(C) will be added to run 2. If desired you can edit the variable and change its name.
Working with Data Rows
Data series in the Data Table consist of data rows. The topics in this chapter will help you to learn how to work with data rows.
Sorting Data Rows
This option rearranges the data rows in the run according to the selected variable 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.
To sort data rows
Click the data row or make a selection of data rows in a run you want to sort.
Select the Tool menu option Data Rows > Sort.
Select a run for which the data rows should be sorted. The run in which the cursor was located is preselected.
Select a variable to be sorted. The variable in which the cursor was located is pre-selected.
129
Accept All Rows or select the data rows to be sorted. If a selection of data rows was made these rows are pre-selected under the Rows.
Select the sort order: Ascending or Descending. The sorting process of a variable defined by a formula can take some time to complete.
Other variable columns are also rearranged accordingly, so the data in the same row stays together.
Graphs, which also use the variable being sorted, are rearranged accordingly.
EXAMPLE
If the type of graph is set to Line, the points in the graph 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. As an example take the function y = x². In diagram A, this function has been drawn with its x-co-ordinates in random order. In diagram B, this function has been drawn after sorting its x co-ordinates in ascending order.
Deleting Data Rows
This option deletes a number of data rows.
To delete data rows:
Click the data row or make a selection of rows.
Select the Tool menu option Rows > Delete > Odd Rows of Run # or Even Rows of Run # to directly remove odd or even data rows from the selected run.
Select the Tool menu option Rows > Delete > User-defined rows of Run# to specify the rows you would like to delete.
Select the run for which the data rows will be deleted. The run in which the cursor was located is preselected.
Specify the first and the last row indexes. By default the indexes are taken from the selection. When desired, change the first and/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.
Mark either Delete rows (the selected rows will be deleted), or Keep rows (the non-selected rows will be deleted).
Click OK to confirm. The specified rows will be deleted from the table.
130
Inserting Data Rows
This option inserts a number of empty data rows.
To insert empty data rows
Click a cell of the row from where you want to insert empty rows or make a selection of rows at the point to insert empty rows.
Select the Tool menu option Data Rows > Insert.
Select a run for which the data rows will be added. The run in which the cursor was located is pre-selected.
Specify the first and the last row indexes. By default the indexes are taken from the selection. When desired, change the first or last row index. These will be the row numbers of the inserted rows.
Click OK to confirm. The specified data rows are inserted and the existing data rows are shifted down.
Working with Runs
The topics in this chapter will help you to learn how to work with runs in the Data Table. Renaming a Run
To change the run name
Click the Name field next to the run number and enter a name.
Delete this text and replace it with your own content.
Deleting a Run
Each time a new measurement, video or image measurement or a model is executed via the Start button a new run is added to the Run Series. Runs can be deleted via the Data Table Tool menu or via the Graph Tool menu.
To delete a run:
Right-click the Data Table window or click its Tool menu and select Runs > Delete.
Or
Right-click the Graph pane or click its Tool menu and select Delete Run.
Select the run you would like to delete. Options All and All Except Newest allow to delete all runs or all runs with exception of the latest run.
The selected run is removed from the table and the remaining runs are renumbered. Notice that this action cannot be undone and the data of the deleted run are lost.
Inserting an Empty Run
It is possible to manually add a new, empty run to the Run Series. This is useful when working with data manually.
To insert a run
Select the Tool menu option Runs > Insert.
Type in a number of rows for data in the run. Confirm with OK. The new Run with the required number of rows will be created in the Data table.
131
Importing a CSV file into a Run
With the Import CSV file option data from CSV file can be imported into a new run. A CSV file (CommaSeparated Values) is a text file.
To import a CSV file into a run
Select the Tool menu option Runs > Import CSV file.
Open the file you want to import.
Specify the file structure and then proceed with the Define CSV file dialog.
Define the Text File structure:
In the File settings section, specify the decimal separator, text qualifier and thousands separator.
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 in the file.
Press OK to confirm your settings.
The Import Data dialog opens. In this dialog information about the imported file, such as the file name, the number of rows and the number of data columns, are given.
Click the column tab e.g. C1 to display quantity, unit, minimum and maximum. In the Import as section select the variable column to which the data from this column should be imported. If you do not want to import a column, select Do not import. If you want to import to a new Variable column select New manual column. If needed edit the suggested quantity, unit and number of decimals.
Repeat these steps for all columns of the imported file.
In the Import range section specify the row indices (one setting for all columns) to be imported. 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 not-selected rows are imported).
Click OK. The specified data are imported as a new run.
Exporting a Run into a CSV file
With the option Export CSV file data from the Data Table can be exported into a CSV file.
To export a CSV file
Select the Tool menu option Runs > Export CSV file.
Specify the parameters in the Define CSV File dialog. This dialog is very similar to the dialog used for importing CSV file:
In the File settings section, specify the decimal separator.
In the Header Rows section you can specify how the first row(s) will be interpreted. The first one or two rows can be used as headers 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 in the file. 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 cor-
132
rectly by the other program. (If necessary, check your decimal separator in the Regional settings in Windows' Control Panel).
Under Run to export select a run, whose data have to be exported.
Press OK to confirm your settings.
Save the file.
Often it is much simpler to export data via Copy and Paste. First make a selection, copy it and paste it into another program e.g. Excel or Notepad.
133
Graph
A graph is used to graphically display variables data to show the relation between them. Variables can be displayed along horizontal and left/right vertical axes. Graphs are automatically updated during data collection and for each new data collection a new data set - run is added to the graph(s).
Graph objects can be placed in panes. There can be many graphs in an Activity/Result.
The topics in this chapter will help you to learn how to work with graphs. The Basics
The topics in this chapter will help you to get familiar with the Graph pane.
Displaying a Graph
Graph objects can be placed in panes. There can be many graphs in an Activity/Result.
To display a standard graph in a Measurement/Control Activity:
Sensor/Actuator not connected
to an interface yet
Sensor/Actuator connected
to an interface
Right-click an empty input/output position on the interface and select Display as a Graph.
Right-click a sensor/actuator icon located on the interface and select Display as a Graph.
Drag the Graph icon over a pane in which you want to place the graph, click this pane.
Drag the Graph icon over a pane in which you want to place the graph, click this pane.
The resulting graph is a graph with the time (clock) along the horizontal axis and an "unknown input/output quantity" along the vertical axis. As soon as a sensor/actuator is connected to the respective input/output the graph is adjusted and shows the quantity measured by the connected sensor/actuator.
The resulting graph is a graph with the time (clock) along the horizontal axis and the quantity of the sensor/actuator along the vertical axis.
For Manual type of measurements, the row index replaces time along the horizontal axis.
For Manual type of measurements, the row index replaces time along the horizontal axis.
To display a standard graph in a Data-Video Activity:
Click the Graph button in the activity toolbar.
Video graphs, graphs with Cartesian coordinates of video point(s) e.g. Px and Py against time, are listed. Select the desired graph .
Drag the Graph icon over a pane in which you want to place the graph, click this pane.
To display a standard graph in the a Modeling Activity:
Right-click on a variable symbol in the Model window and select Display as a Graph.
Drag the Graph icon over a pane in which you want to place the graph, click this pane.
134
The resulting graph is a graph with the independent variable along the horizontal axis and the selected variable along the vertical axis.
To display a ready-to-go (pre-defined) graph:
Click the activity toolbar button Graph
and select the graph from the list of all available graphs.
Drag the Graph icon over a pane in which you want to place the graph and click this pane.
Graph Toolbar
When a graph is placed in a pane, the pane offers a Graph Toolbar. This toolbar provides quick access to some useful tools.
Zoom to fit – to auto-scale the graph
Zoom out – to return to the previous graph state
Grid – to place or remove a grid on the graph
Graph Properties – to open the Graph Properties dialog
played
Sketch (on/off) – to turn on/off the sketching tool to draw a graph manually
Scan (on/off) – to turn on/off the scanning mode in which coordinates of the clicked points are dis-
Analyze/Process – to open Analyze/Process menu
Run# – to display/hide a run#
Graph Tool Menu
The graph tool menu offers options for editing graphs and tools for data analysis and processing.
Zoom to fit – to auto-scale the graph
Zoom out – to return to the previous graph state
Grid – to place or remove a grid on the graph
Graph Properties – to open the Graph Properties dialog
Show Run – to display and hide a selected run on a graph
Delete Run – to delete a selected run
Scan – to turn on the scanning mode in which coordinates of the clicked points are displayed
Stop Scanning – to turn off the scanning mode
Sketch – to turn on the sketching tool to draw a graph manually
Stop Sketching – to turn off the sketching tool
Add an Annotation – to add graph annotation(s)
135
Import Background Graph – to import a Coach Activity/Result file and place it in a graph as a background graph. When a graph is inserted as a background graph then the options to Shift Background Graph and Delete Background Graph are added
Analyze/Process – to select Analyze/Process options
Print – to print the Graph pane
Copy to Clipboard – to copy the Graph pane
Help – to consult Help
Displaying Runs
A graph can contain several measurement runs. Runs are distinguished by means of a shade of the variable color (specified in the Variable or Graph Properties dialogs). The latest Run gets the darkest shade. The Run buttons, displayed at the right side of the Graph Toolbar, indicate the number of available Runs.
To hide/show a run
Click on the active Run# button to hide the run#.
Click on the inactive Run# button to show the run#.
Working with Graphs
The topics in this chapter will help you to learn how to work with graphs.
Creating a New Graph
A new graph can be easily created via dragging variable headings from the Data Table.
To add a new graph
Click the Graph button in the activity toolbar and select Add new.
Drag the Graph icon over a pane in which you want to place the graph. Click this pane.
A "graph" with no variables assigned to its axes is created.
To assign its horizontal axis, drag a variable heading from Data Table (the cursor changes into the variable icon) to the bottom of the pane until a blue rectangle appears. Release the icon.
To assign its left vertical axis, drag a variable heading from Data Table (the cursor changes into the variable icon) to the left side of the pane until a blue rectangle appears. Release the icon.
To assign its right vertical axis, drag a variable heading from Data Table (the cursor changes into the variable icon) to the right side of the pane until a blue rectangle appears. Release the icon.
You can drag and place more variables along the left and right vertical axes, but only one variable can be used along the horizontal axis.
A created graph gets a default name Graph#. You can change the name via the Graph Properties option.
Modifying Graph Axis
To modify what is plotted on a graph move the cursor over a graph axis label, until a small rectangle appears around the label, and click the label.
To remove a variable displayed along the axis select Remove.
To replace a variable by another variable select Replace by and select a new variable from the list.
136
To add another variable displayed along the axis select Add and select a new variable from the list. Notice that this option is not present for the horizontal axis, along this axis only one variable can be selected.
Another way of adding another variable is dragging a new variable directly from Data Table.
Editing Graph Style
Each graph has its own style; you can change it via the Graph Properties option.
To edit graph properties:
Open the Graph Properties dialog:
- click the Graph Properties button in the graph toolbar, or - right-click the graph or click its Tool menu and select Graph Properties, or - click a graph axis label and select Graph Properties.
Adapt the graph properties.
Name: The graph name used in the caption of the Graph pane.
Show grid: When marked, the grid is displayed in the graph.
Identical axes ratio: When marked, the units along the horizontal and vertical axis in the graph use the same number of screen pixels. For example with the Identical axes ratio marked, a circle will be displayed as a real circular shape on the screen (rather than an ellipse).
Variables used along the graph axis are displayed via tabs. Click a tab to edit the variable properties and their style in the graph:
Label: A unique variable name. This name is shared in graphs and Data Table (linked to each other).
Min/Max: The minimum and maximum values limit the scale of the graph. Notice that the duration of a measurement is only determined by the measurement settings, not by the maximum of the time axis in the graph.
Color: The color applies to the markers and line style used in the graph. The same color is also used for the name of the variable label and unit along the axes and for the Data Table.
Marker: A marker used to mark the individual data points. Notice 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: A type (none, line, bar, block, histogram) specifies if and how individual data points are connected. When Connection type = none, data points are not connected. When Connection type = line, data points are connected by straight lines. When Connection type = bar, data points are not connected to each other but via vertical lines to the horizontal axis. When Connection type = block, data points are connected by the first horizontal line up to x position of the next point and then a vertical line. When Connection type = histogram, data points are connected to the horizontal axis by a vertical bar. The bar is positioned in the middle the data point. Line width: A thickness of the graph line. The setting of line width does not apply when Connection type = None.
Notes: If no graphs appear in the diagram, check whether both Marker and Type are set to None. With this setting, the particular graph will be invisible.
The defaults are Marker = Square 3x3, Type = Line and Line width = 1.
137
Background graph
A background graph is used to visually compare data in one graph. It is useful for instance for hypothesis testing in Modeling. A background graph can be created from the data stored in another Coach Activity/Result file. Contrary to regular graphs, the data of a background graph is not available in the Data Table: this graph is displayed as a picture only. It can be shifted horizontally, however.
To import a background graph
Right-click a graph to which you would like to add a background graph or select the Tool menu option Import Background Graph.
Open a Coach Activity/Result file in which the data are stored that you want to be displayed on a background graph.
Import Background Graph dialog opens. The Data source section displays the file name, the selected run and the number of data rows present.
Select the Run you want to use it.
Specify the variables which will be used along the horizontal and vertical axes of the background graph. If desired type in the respective variable labels. Select whether the data should be displayed along the Left or Right vertical axis.
In a similar way as for a normal graph specify the background graph style settings: its color, marker, type and line width.
Click OK. The background graph appears in the graph.
To delete the background graph select the Tool option Delete Background Graph.
To facilitate the comparison to a calculated or measured graph you can shift the background graph.
Select the Tool menu option 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 graph during the shifting process, by pressing the <Shift> key.
Select Stop Shifting Background Graph.
Simple Analysis Tools
The Graph pane has a range of tools for adjusting its display and analyzing the data. These tools are available via buttons in the toolbar of the Graph pane or via the Graph Tool menu. Some tools and options can be used only when there are data available.
The simple tools are: Grid, Zoom, Scan, Sketch, Annotating graph. Go to the 'Analyze/Process Tools' chapter to learn about advanced tools available in Coach. Grid
The option Grid is used to place a grid on the graph.
Click the Grid On button to show it and click it again to hide it.
or
Check/Uncheck the Tool menu option Grid to show/hide the grid on the graph.
138
Zoom
By zooming in an area of the diagram will be enlarged, e.g. for closer inspection. There are a couple ways of zooming.
Zoom to fit
Click the Zoom-to-fit button , or select the Tool menu option Zoom to Fit to re-scale the horizontal and vertical axes to optimally display all graphs.
Click the Zoom-out state.
button , select the Tool menu option Zoom Out to return to the previous zoom Zoom in/out a part of the graph
Move the cursor over the graph.
Click and drag a rectangle 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.
Stretch or squeeze axes scales
Point to the scale markings just below the horizontal axis. When the pointer symbol changes to a horizontal double arrow times as you like.
click and drag to stretch or squeeze the scale. You can repeat this as many In a similar way you can stretch or squeeze the vertical scale by pointing to the scale markings beside the vertical axes and dragging them up or down.
Click the Zoom-out button to return to the previous zoom state.
Scroll axes
Point in the middle just below the horizontal axis. The pointer symbol should change to crossed arrows . You can then use the mouse to drag the whole axis. A similar effect can be achieved for the vertical axis.
When the graph 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.
Scan
The option Scan is used to read co-ordinates of data points in graphs. A crosshairs in the graph marks the scanned point. The co-ordinates of all the points of active runs are displayed in a box in the upper right corner of the graph. This box can be dragged to another location.
To scan data points
Click the Scan On button in the Toolbar or select the Tool menu option Scan.
Click a point of the graph and its co-ordinates are displayed. When there are more Runs or more variables displayed along the vertical axes the co-ordinates of all Runs/Variables are displayed. Move through the data points in the graph with the mouse or with the right and left arrow keys. The following is possible:
139
Click/Drag - goes to the closest measured point in x direction.
<Alt > + click/drag goes to the closest measured point in Euclidean metrics.
<Ctrl> (on Mac <Cmd>) + click/drag allows to freely scan regardless of measured points and shows the coordinates of the cross using the first y-axis only.
Holding <Shift> key allows zooming in Scan mode.
The co-ordinates can be moved to another position by dragging.
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.
Stop scanning by clicking the Scan Off menu.
button or by selecting Stop Scanning from the Tool Sketch
The option Sketch can be used to manually draw a graph. The drawing tool allows you to create your own graphs independently of sensors or keyboard data. It can also be used to draw prediction of a measurement graph; after the measurement run is executed, the shape of the predicted graph can be compared with the measured graph. Or such graph can be used as input data for an auxiliary variable in Modeling.
To sketch a graph
Make sure only one variable is displayed along the vertical axis.
Click the Sketch On button in the Toolbar or select the Tool menu option 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. Double-click at a point in the sketched graph to erase the part of the graph beyond this point.
Stop sketching by pressing <Esc>, by clicking the Sketch Off menu option Stop Sketching.
button or by selecting the Tool A new set of data, a new run named Sketch of variable with a variable Sketch var and a new run named Sketch, are added to the table. The Sketch variable is a manual type of variable and its data may be edited directly in the Data Table. By default the sketch graph is drawn in black color.
Annotating a Graph
It is possible to place descriptive labels - annotations in a graph. They can be used to label individual graphs or to point out interesting features. Annotations are displayed in the graph, but also appear when the graph is printed or copied to the clipboard.
To add an annotation
Select the Tool menu 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 your annotation in a frame.
Click OK to confirm or Cancel to return to the original graph.
Drag the annotation to the desired position of the graph.
When desired, repeat this procedure to create more annotations.
140
To edit/delete an annotation
Right click an annotation.
Select Edit or Delete Annotation.
141
Meter
A Meter is a scaled analog display; its pointer indicates the values generated by a variable. Each variable has its own default meter display. Author and Senior student users can modify this display and store it in a Coach Activity/Result.
The topics in this chapter will help you to learn how to work with meters. Displaying a Meter
There are more methods of selecting a variable meter:
Method 1.
In a Measurement/Control Activity:
Right-click a sensor/actuator icon located on the screen interface and select Display as Meter. Drag the Meter icon over a pane in which you want to place the meter and click the pane.
In a Modeling Activity:
Right-click of a variable symbol in the Model window and select Display as Meter.
Drag the Meter icon over a pane in which you want to place the meter and click the pane.
Method 2
Click the activity toolbar button Meter meters appears below the button.
in the activity toolbar, a list of all available variable Select a variable meter from the list, the cursor changes into the Meter icon.
Drag the icon over a pane in which you want to place the Meter and click the pane.
Editing a Meter
(only possible in Author and Senior student mode)
The Meter pane offers a simple editor to modify the standard meter.
Right-click the Meter pane or click its Tool menu and select Edit.
Modify a default meter to create your own meter. Name: the name used in the Meter pane caption. Display type: the way the scale of a meter is displayed. The following display types are available: Horizontal bar, Vertical bar, Quarter circle (90°), Half circle (180°), Full circle (360°). Quantity: the variable label of the meter shown below its analog display (by default on). Unit: the unit label of the meter shown between brackets next to the Quantity label. Display: the display shown in the upper part of the Meter pane, this part is always present. Scale: the scale of the meter, by default shown on the meter. For Quantity, Unit and Display colors can be set. When the lock is closed (default) then the same color is used for all. Min., Max.: allow to define the range of the meter’s scale. For standard meters these values are read from the variable properties. The options Background color, Body color and Pointer define the meter’s colors.
Use the Reset Name button to reset the meter name to its default name.
Use the Reset button to reset your new meter into a standard meter.
142
Value
Value is a digital display, which displays values generated by a variable in large-sized numbers. Each variable has its own default value display. Author and Senior student users can modify this display and store it in a Coach Activity/Result.
The following topics will help you to learn how to work with values: Displaying a Value
There are more methods of selecting a variable value:
Method 1.
In a Measurement/Control Activity:
Right-click a sensor/actuator icon located on the screen interface and select Display as a
Value. Drag the Value icon over a pane in which you want to place the value and click the pane.
In a Modeling Activity:
Right-click of a variable symbol in the Model window and select Display as a Value.
Drag the Value icon over a pane in which you want to place the value and click the pane.
Method 2
Click the activity toolbar button Value
the button.
, a list of all available variable values appears below Select a variable value from the list, the cursor change into Value icon.
Drag the icon over a pane in which you want to place the Value and click the pane.
Editing a Value
(only possible in Author and Senior student mode)
The Value pane offers a simple editor to modify the standard value display.
Right-click the Value pane or click its Tool menu and select Edit.
Modify a default value display to create your own display. Name: the name used in the Value pane caption. Quantity: the variable label shown above its digital display (by default on). Unit: the unit label shown between brackets next to its digital display (by default on). For Quantity and Unit labels colors can be set. When the lock is closed (default) then the same color is used for both. Decimals: the number of decimals used in the display. For very large or very small values the Scientific notation can be turned on. Background color: defines the background color used in the Value pane.
Use the Reset Name button to reset the value name to its default name.
Use the Reset button to reset your new value into a standard value.
143
Analyze and Process Tools
The collected data can be processed with the help of advanced tools, which are available via the Tool menu of the Graph pane.
The Analyze/Process options work in a similar way. After selecting an option an extensive dialog that includes the graph and specific parameters is shown. The tools can be executed on one selected measurement run, and if more variables are displayed along the vertical axis, on one selected variable. At the bottom of the dialog box an explanation is given about what action is possible. The Copy Window to Clipboard button allows copying the displayed Processing dialog as an image for use in other programs.
The tools are divided into 5 groups depending on the results of these operations:
Slope
Area
Statistics
Original variable data will not be changed. The results of the calculations are temporarily shown in the Processing dialog. These results can be copied into text or other applications (e.g. MS-Word) via Copy to Clipboard. Select/Remove Data
Smooth
Original run data will not be changed. As a result a new run with (more) new data is added to the Data Table and in the graph. Function Fit
Original variable data will not be changed. As a result: a new variable, based on the resulting fit formula is added to the Data Table for the selected run,
a fit-function graph is added to the existing graph. The formula of the fit-function can be copied into text via Copy to Clipboard. Derivative
Integral
Original variable data will not be changed. As a result: a new variable, based on the resulting formula is added to the Data Table for the selected run, and when Apply to all runs is checked, the new variable is calculated for all runs,
a new graph is created. Signal Analysis
Histogram
Original variable data will not be changed. As a result: two new variables used along the axis of the new graph are added to the Data Table, a new run is added and the new variables for selected Run are added to this run, and - a new graph is created. Slope
Use the Slope option to determine the slope of the tangent at any point of the displayed graph. This can be done manually (default setting) or automatically.
To determine a slope
Select Analyze/Process> Slope.
If your graph has more runs, select a run number under Run.
The red crosshairs indicate the selected point and the coordinates of this point are displayed below the graph.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. Select the point in which you want to determine the slope. For small steps use the right and left cursor keys. A black line is drawn through the selected point.
144
To find the slope manually rotate the line with the mouse or the up and down cursor keys to approximate the tangent. When you determine the slope manually then the only way is to do it by your own judgment; Coach does not indicate which slope is ‘correct’.
To find a slope automatically click the Slope plays the correct slope.
button. The Coach program determines and dis-
The slope value is displayed in the Slope field.
Click the Copy to Clipboard
button to copy the coordinates of the selected point and its Slope value to the clipboard, for use in text or another application.
Click Close to close the Slope dialog.
Area
Use the Area option to determine an area between the graph, the horizontal axis and the two boundary lines.
To determine an area
Select Analyze/Process> Area.
The diagram shows two red boundary lines between which the area is calculated.
If your graph has more runs select a run number under Run.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. The selected graph is blue and zoomed-to-fit. The other variable graphs (if any) remain gray.
Drag the boundary lines to the required position, or type the values for the boundary lines in the Begin and End fields. The selected area is dark red.
The area value is displayed in the Area field.
Click the Copy to Clipboard button to copy the Begin, End and Area values to the clipboard for use in a text or another application.
Click Close to return to the regular Coach screen.
Statistics
Use the Statistics option to display statistical information about the variable values of a selected run.
To display statistics
Select Analyze/Process> Statistics.
If your graph has more runs, first select a run number in the Select Run dialog.
The statistical information is displayed in the Statistic dialog. For each variable:
Number: number of values
Max: maximum value Min: minimum value Average: average value Sum: sum of all values Sum sqr: sum of the squared values s(n): standard deviation based on n values s(n-1): standard deviation based on n-1 values
Click the Copy button to copy the statistical information to the clipboard for use in text or another application.
Click Close to return to the regular Coach screen.
145
Select and Remove Data
Use the Select/Remove Data option to create a new run with the reduced number of points (version 7.3 or higher). A range of data or single points can be selected for removal or retention.
To select/remove data
Select Analyze/Process > Select/Remove Data.
If your graph has more runs select a run number under Run.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. The selected graph is blue and zoomed-to-fit. The other variable graphs (if any) remain gray.
Select the selection method. Depending on the selected method red boundary lines (Range) or red crosshairs appear (Point-to point).
For the Range method: select the range by dragging the red 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. For the selection you can also use buttons: All, None, Even and Odd.
Select between Keep selected - all non-selected points will be removed or Delete selected - all selected points will be removed.
Click OK to confirm or Cancel to close the Select/Remove Data dialog without changes.
After confirmation a new run with the selected data rows will be added to the graph and data table. Smooth
Use the Smooth option to create a smooth curve that fits (interpolates) a rough or limited number of points. This option offers three techniques of approximations: Moving average, Bezier and Spline. The smoothed data are placed in a new run allowing keeping the original run in the activity (version Coach 7.3 or higher). The smoothed graph may consist of more points than the original data set (depending on the used smoothing method). The Smooth option cannot be used on variables defined by formulas. To execute smoothing
Select Analyze/Process> Smooth.
If your graph has more runs, select a run number under Run.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. The selected graph is zoomed-to-fit.
Select the smooth method: Moving average, Spline or Bezier.
Specify the smoothing parameters: - For Moving average enter the desired Filter width. - For Spline leave the Smoothing factor to Automatic or enter the factor manually by selecting Factor and typing the desired value in the field.
Click Plot to calculate and display the smoothed graph. The resulting smoothed graph is dark red. If you are not satisfied with the result, change parameter settings and press Plot again.
Choose between:
Apply to selected variable - the smoothed graph will replace only the original data of the selected variable by the recalculated values. The number of data points is kept the same. Apply to all variables (not possible for Moving average) - the smoothed graph will replace the original data of all variables in the run by the recalculated values. The number of points can be increased up to 500 000 points.
146
After confirmation for the Spline and Bezier methods specify the number of points to compute in the Replace Data dialog.
Click OK to confirm or Cancel to close the Smooth dialog without changes.
After confirmation a new run will be added to the graph and data table. EXAMPLE
An example of several types of data smoothing. The graphs in the graph below show the effect of some smoothing techniques when applied to a small data set.
Moving Average
The Moving average method 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). Moving averages are often used in time series analysis to eliminate short-term fluctuations in time series and highlight long-term trends and cycles.
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.
147
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 variable calculated based on the formulae Filter(VariableX;Interval) can also be added to the Data Table. In that case, the smoothed graph consists of the same number of data points as the source graph.
EXAMPLE
The Filter width size determines the degree of filtering.
Original Graph
Filter width=1
Filter width = 2
Original Graph
Filter width = 1
Filter width = 10
Bezier
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 the Data Series.
148
The number of resulting points after the Bezier approximation can be as high as 500000.
A variable calculated based on the formulae Bezier(VariableX;VariableY)) can also be manually added to the Data Table. In that case, the smoothed graph consists of the same number of data points as the source graph.
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 approximates 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.
When Automatic is checked then the smoothing factor that determines the best compromise between data fitting and data smoothing is automatically calculated 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.
The resulting number of points after the Spline approximation can be as high as 500000 (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. An important application of spline smoothing is the computation of derivatives that still have smooth graphs.
A variable, calculated based on the formulae Spline (VariableX;VariableY;Factor) can also be manually added to the Data Table. 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.
EXAMPLE
Smoothing factor = 0
the curve is a natural quintic spline curve through all original points.
149
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.
150
Function Fit
The Function-fit option is used to approximate the data in the graph with a standard mathematical function. You can choose from a large number of function types. The coefficients of the fit function are determined using a least-squares method. Fitting can be done automatically or manually.
To determine a function fit automatically
Select Analyze/Process> Function Fit.
When starting function fit from a zoomed diagram, Coach will only use the visible part of the data for its fit.
If your graph has more runs, select a run number under Run.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. The fit function is dark red.
Select the Function type that will be used.
Click the Estimate button, Coach automatically estimates the best initial parameter values of the function fit. In some cases this is already an optimal fit e.g., in case of linear regression.
Click the Refine button, Coach automatically refines the suggested fit (via the Levenberg-Marquardt method) to find the best function fit based on the initial parameter values. The quality of the fit, the standard deviation of the fitted function from the original data, is indicated behind Fit quality. The lower the deviation, the better the quality.
You can interrupt the automatic fit process with <Esc>. Keep it pressed until the fit process stops. This may take a short while.
The coefficients of the function fit function are displayed in the Coefficients fields. By checking the Fix check box next to a coefficient, the coefficient will be "locked" and will not be changed during calculations. When a function coefficient(s) is fixed then only the Refine button can be used, the Estimate button is disabled (grey).
When you check the Add annotation to graph box the annotation with function fit information will be added to the original graph.
Click the Copy to Clipboard button text or an other application.
to copy the function fit information to the clipboard for use in Click OK to confirm, or Cancel to close the Function-Fit dialog without changes.
After confirmation a new variable ‘Fit of variablerun#’ is added to the Data Table. The variable is calculated based on the formula of the fit function and is calculated only for the selected run.
151
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.
To determine a function fit manually
Select a point on the original graph by shifting the opened pin along the fit-function. If you cannot 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). Using the fit-function type f(x)=a*x, the pin stays fixed in the origin. In fact, this function can only be rotated.
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.
When desired, press the Refine button to finalize the fit process.
Derivative
Derivatives are a measure of the rate of change of a quantity. They are often used in science to calculate among others the speed of processes. Use the Derivative option to plot the graph of the first derivative or the second derivative.
To calculate a derivative
Select Analyze/Process> Derivative.
If your graph has more runs, select a run number under Run.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. The selected graph is zoomed-to-fit.
Select a derivative order.
Select a method of calculating the graph of the derivative. Differences method – this method uses a difference of successive values from the variable displayed along the vertical axis, divided by the difference of the corresponding values in variable displayed along the horizontal axis (differential quotient). For data sets with a few points (up to 20), a boundary effect may become noticeable. Smooth method - first a smoothing spline for the raw data is computed, followed by an exact differentiation of the spline function. In most cases this method gives 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 automatically chosen smoothing factor is not useful enough, a user has to fine-tune the smoothing manually.
When desired change the Label and/or Unit.
Click Plot to calculate the Derivative graph. The red derivative graph is added; its variable is displayed along the right vertical axis. Both, the original graph and its derivative, are displayed optimally because of the independent scales.
Select Apply to all runs if you would like to calculate a derivative of the selected variable for all runs.
Click OK to confirm or Cancel to close the Derivative dialog without changes.
152
After confirmation a new variable with the name specified under Label is added to the Data Table. When Apply to all runs is checked (default settings), the new variable is calculated for all runs, otherwise the variable is calculated only for the selected run. The new derivative graph is created and the graph icon is shown after the dialog is closed. Move the graph icon above the pane in which you want to place the graph and click the pane to place the derivative graph there.
The new variable will then 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 positiontime, velocity-time (first derivative) and acceleration-time (second derivative) graphs, while actually only the position is measured.
Notes:
A variable, calculated based on the formulae Derivative(VariableX;VariableY) or DerivativeSmooth(VariableX;VariableY;Factor) can also be manually added to the Data Table. A difference quotient, which is an approximation of the derivative, can be added manually as Deltafil(VariableY)/Delta(VariableX).
A variable, calculated based on the formulae DerivativeSecond(VariableX;VariableY) or DerivativeSecondSmooth(VariableX;VariableY;Factor) can also be manually added to the Data Table.
Integral
The Integral option 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.
To calculate an integral graph
Select Analyze/Process> Integral.
If your graph has more runs, select a run number under Run.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. The selected graph is zoomed-to-fit. The other variable graphs (if any) remain gray.
In the Initial value field enter the constant of integration. This is the value assigned to the quantity along the vertical axis for x=0.
When desired, change the Label and/or Unit.
Click Plot to calculate the integral graph. The red integral graph is added; its variable is displayed along the right vertical axis. Both, the original graph and its integral, are displayed optimally because of the independent scales.
Select Apply to all runs if you would like to calculate the integral of the selected variable for all runs.
Click OK to confirm or Cancel to close the Integral dialog without changes.
After confirmation a new variable with the name specified under Label is added to the Data Table. When Apply to all runs is checked (default settings) the new variable is calculated for all runs, otherwise the variable is calculated only for the selected run. The new integral graph is created and the graph icon is shown after the dialog is closed. Move the graph icon above the pane in which you want to place the graph and click the graph to place the integral graph.
The new variable will be then evaluated in real time! So on a next measurement run the original data will be measured and its integral will be calculated and displayed in real time.
Note:
A variable, calculated based on the formulae Integral(VariableX;VariableY;Constant) can also be manually added to the Data Table.
Signal Analysis
The Signal Analysis option is used to find the frequency spectrum of a time-based periodical signal. The resulting values are presented as amplitudes of spectral components plotted against the frequency.
153
To determine a frequency spectrum
Select Analyze/Process> Signal Analysis.
If your graph has more runs, select a run number under Run.
If your graph uses more variables along the vertical graph axis, select the desired graph under Variable. The selected graph is blue and zoomed-to-fit. The other variable graphs (if any) remain gray.
In the Function type field select the method of signal analysis: Fourier transform, Linear prediction,
R-ESPRIT or Prony.
Select Linear or Logarithmic for the intensity scale along the y-axis. A linear scale gives a good overview of the size of different signals compared to each other (not available for the R-ESPRIT and Prony methods). For a linear scale, the highest intensity has the value 1. A logarithmic scale, however, gives more information about how the sound signal will be perceived by the human ear, as the human sense of hearing has a logarithmic character. For a logarithmic scale, 0 dB corresponds to 1 mV. Specify signal parameters: - Linear Prediction (LP): 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. The number is determined by the ARMA model used in the spectral analysis and the maximum number of peaks in the spectrum. 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, or entered manually when the option Value is checked. - Prony: only enter the number of frequencies.
The value entered behind Decimals defines the number of decimals used for the frequency variable.
Click Spectrum to calculate the frequency spectrum for the specified settings. You can limit your time range dragging the red boundary lines or by typing the Begin and End values. The spectrum is drawn in dark red in a new graph. Coach automatically couples time and frequency units; if the time unit is seconds, minutes or hours, then the frequency unit will be Hz, if millisecond then the frequency unit will be kHz.
Click the Data button to return to the original graph.
Click OK to confirm or click Cancel to close the Signal Analysis dialog without changes.
After confirmation: 1. The two new variables, Frequency f and Intensity I are added into the Data Table. The calculated values of frequency and intensity are entered and the variable is treated as the manual type. The data of these variables are present only in a new run described in the next point.
2. The new run, named ‘Analysis method of variablerun#’ e.g. ‘FT of x1 (can be read as Fourier Transform of run 1 of variable x), is added to the Run series.
3. The new frequency spectrum graph is created and the graph icon is shown after the dialog is closed. Move the graph icon above the pane in which you want to place the graph and click the pane. A new graph displaying ‘Intensity’ along the vertical and ‘Frequency’ along the horizontal axis is added.
Some tips on Signal Analysis
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 Fourier Transform (FT) or Linear Prediction (LP) e.g. human voice studies, 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 spectrums 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-
154
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.
When the sample size is small only use R-ESPRIT or Prony and add the approximation to the original diagram from which the 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 will 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.
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.
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.
Histogram
The Histogram option is used to create a statistical histogram – a graph representing the distribution of the data. The range of the variable is divided into equal size bin, for which the frequency of occurrence is counted. The height of the graph bar is equal to the frequency of occurrence within the bin.
To determine a histogram
Select Analyze/Process> Histogram. - If your graph has more runs, select a run number under Run. - If your graph uses more variables along the vertical graph axis, select the desired graph under Variable.
Enter the Lower and Upper boundary values. The initially displayed boundaries are computed from the data. It is possible to type values here
Type the number of bins (default 5).
Click Plot to show the histogram graph, the red bar graph appears. If you are not satisfied with the result, change the parameters and press Plot again.
Click OK to confirm or click Cancel to close the Signal Analysis dialog without changes.
After confirmation:
1. The two new variables, labeled ‘Variable bins’ and ‘Number’, are added into the Data Table. The calculated values are entered and the variables are treated as of the manual type. The data of these 155
variables are present only in a new run, see below.
2. A new run, named ‘Histogram of variablerun#’ e.g. ‘Histogram of x1’ (which can be read as histogram of run 1 of variable x), is added to the Run series. This Run has the number of rows equal to the number of bins.
3. The new histogram graph is created and the graph icon is shown after the dialog is closed. Move the graph icon above the pane in which you want to place the graph and click the pane. The new histogram graph displaying ‘Number’ along the vertical and ‘Variable bins’ along the horizontal axis is added.
156
CHAPTER 8
Learning Content
Coach Activities can be enriched with multimedia learning content. Such learning content can be presented via the following objects: Text, Image, Video, Web page.
Additionally students can write their observations, answers and conclusions in Student Texts. These objects can be displayed in Coach panes.
Texts
158
Images
160
Videos
162
Web Pages
164
Student Texts
166
157
Texts
Texts are made by Author users for Student users and can consist of activity descriptions, instructions for students or explanations. Author users can create and edit these Texts only in Author mode. In this mode Author users can use the same text editor as for writing Student texts.
Student users cannot edit these Texts. To write their notes student users should use Student texts.
An Activity may consist of more Texts than the Text(s) shown on the activity screen. By clicking the activity toolbar button Text or the arrow next to it, you can see if there are more Texts present.
A Text can appear only once, can be displayed in a pane or listed in the Texts list.
The following topics will help you to work with texts: Managing Texts
To browse through Texts
When there are more Texts you can browse through these in the Text pane. Coach follows the numbering or alphabetical order.
Click the forward and the backward arrow buttons in the Text pane caption.
Or
Right-click the Text pane or click the Tool button and select Next or Previous Text.
To move a Text to another pane
Click the caption of the Text pane you want to move.
Start to drag the caption; the cursor displays the Text icon.
Move the Text icon over a pane in which you want to place the Text and click the pane.
To select another than displayed Text
Click the activity toolbar button Text
. Select a Text from the list and click OK to confirm.
or
Click the arrow at the right side of the button Text
and select a Text.
The cursor displays the Text icon.
Move the Text icon over a pane in which you want to place the Text and click the pane.
Text Tool Menu
The tool menu of the Text pane consists of the following options:
Next Text – to display the next Text
Previous Text – to display the previous Text
Copy – to copy the selected text
Select all – to select all text
Print – to print the Text pane (only the visible part of the text will be printed)
158
Clipboard Copy – to copy the Text pane to the clipboard
Help – to consult the Help system.
This menu is shown for Student Users. For Author Users the tool menu is extended and is the same as the Tool menu of the Student text pane.
159
Images
Images are useful to illustrate phenomena, experiments or equipment .
An Activity may consist of more Images than the Image(s) shown on the activity screen. By clicking the activity toolbar button Image
present. or the arrow next to it you can see if there are more Images The same image can be displayed in more panes.
The topics in this chapter will help you to work with images.
Managing Images
Senior-student users may select but also add and delete added images. These images will be saved in the Result file.
To move an Image to another pane
Click the caption of the Image pane you want to move.
Start to drag the caption; the cursor displays the Image icon.
Move the Image icon over a pane in which you want to place the Image and click the pane.
To select another than displayed Image
Click the activity toolbar button Image
. Select an image from the list and click OK to confirm.
or
Click the arrow at the right side of the button Image
and select an image.
The cursor displays the Image icon.
Move the Image icon over a pane in which you want to place the image and click the pane.
To edit an Image title
Click the activity toolbar button Image
. Select the desired image and click Edit.
or
Click the Tool button of the Image pane and select Edit Title.
Enter a title. This title will be displayed in the Image pane caption.
Click OK to confirm.
To add a new Image
Click the activity toolbar button Image
and select Add.
Browse to the desired image file and click Open.
A new image is added to the list. The file name is used as the title of the image. Click Edit if you want to change this title.
or
160
Click the arrow next the activity toolbar button Image
and click Add new.
Browse to the desired image file and click Open.
The cursor displays the Image icon.
Move the Image icon over a pane in which you want to place the Image and click the pane.
A new image is displayed in the pane. The file name is used as the title of the image.
Right-click an image and select Edit title if you want to change this title.
To delete an Image
Click the activity toolbar button Image
.
Select an image you want to delete and click Delete.
Confirm that you really want to delete the image.
To export an Image
Right-click or click the tool menu button of the Image pane.
Select Export Image.
Browse to the location you want to store the image.
If desired enter the file name and click Save.
Image Tool Menu
The tool menu of the Image pane consists of the following options:
Edit Title – to edit the image title
Magnify if needed – to magnify an image when the pane is maximized
Export image – to export the image
Print – to print the Image pane Clipboard Copy – to copy the Image pane to the clipboard
Copy Image – to copy the image
Help – to consult the Help system.
161
Videos
Videos are useful to illustrate phenomena, experiments or equipment, or to include different author’s or students’ podcasts.
An Activity may consist of more Videos than the Video(s) shown on the activity screen. By clicking the activity toolbar button Video or the arrow next to it, you can see if there are more videos present. The same video can be displayed in more panes.
The topics in this chapter will help you to work with videos. Managing Videos
Senior-student users may select but also add and delete added videos. The videos will be saved in the Result file.
To move a Video to another pane
Click the caption of the Video pane you want to move.
Start to drag the caption; the cursor displays the Video icon.
Move the Video icon over a pane in which you want to place the Video and click the pane.
To select another than the displayed Video
Click the activity toolbar button Video
. Select a video from the list and click OK to confirm.
or
Click the arrow at the right side of the button Video
and select a video.
The cursor displays the Video icon.
Move the Video icon over a pane in which you want to place the video and click the pane.
To edit a Video title
Click the activity toolbar button Video
. Select the desired video and click Edit.
Click the Tool button of the Video pane and select Edit Title.
or
Enter a title. This title will be displayed in the Video pane caption.
Click OK to confirm.
To add a new Video
Click the activity toolbar button Video
and click Add.
Browse to the desired video file and click Open.
A new video is added to the list. The file name is used as the title of the video. Click Edit if you want to change this title.
or
162
Click the arrow next the activity toolbar button Video and click Add new.
Browse to the desired video file and click Open.
The cursor displays the Video icon.
Move the Video icon over a pane in which you want to place the video and click the pane.
A new video is displayed in the pane. The file name is used as the title of the video.
Right-click a video and select Edit title if you want to change this title.
To delete a Video
Click the activity toolbar button Video
.
Select an video you want to delete and click Delete.
Confirm that you really want to delete the video.
To export a Video
Right-click or click the tool menu button of the Video pane.
Select Export Video.
Browse to the location you want to store the video.
If desired enter the file name and click Save.
Video Tool Menu
The tool menu of the Video pane consists of the following options:
Edit Title – to edit the video title
Adjust – to adjust the video
Playing Speed – to set the speed of playing video
Add an Annotation – to add an annotation(s) on the video frame(s)
Export Video – to export the video file
Print – to print the Video pane
Clipboard Copy – to copy the Video pane to the clipboard
Copy Frame – to copy the image of the selected frame
Help – to consult the Help system.
163
Web Pages
Web pages can offer extra teaching and learning (on-line) resources for students. The Web Page pane has a built-in simple browser.
An Activity may consist of more Web pages than the Web page(s) shown on the activity screen. By clicking the activity toolbar button Web Page present. or the arrow next to it you can see if there are more web pages The same web page can be displayed in more panes.
The topics in this chapter will help you to work with web pages. Managing Web Pages
Senior-student users may select but also add and delete added Web pages. The Web pages will be saved in the Result file.
To move a Web page to another pane
Click the caption of the Web page pane you want to move.
Start to drag the caption; the cursor displays the Web page icon.
Move the Web page icon over a pane in which you want to place the Web page and click the pane.
To edit a Web page title
Click the activity toolbar button Web page . Select a Web page.
Click Edit and enter a title. This title will be displayed in the Web page pane caption.
Click OK to confirm.
To add a new Web page
Click the activity toolbar button Web page
bar button Image and click Add new
and click Add or click the arrow next the activity tool-
There are three options present:
Internet link: select if you want to make a link to an on-line website.
Enter the webpage title.
Enter its URL web-address.
Link to a local file: select if you want to make a link to a local file (e.g. a html file or a pdf file) or a local (offline) web-site structure. Notice that if you want to share the activity, which link to a local file(s) you have to copy all linked files together with your activity.
Enter the file title.
Type in a file name including path to the file or use the Browse button to find and open the desired file. After selecting a file its name including path to the file will be placed in the File field.
The option Store file path relative to the activity location is by default checked.
Embed local file: select if you want to embed a local file (e.g. html file or a pdf file) in your activity. If you want to share your activity the file(s) will be included in the activity.
Enter the file title.
Use the Browse button to find and open the desired file.
164
Check Include files from the file’s folder and it subfolders when you want to embed not only the linked file but also other files connected to it, e.g. all files which belong to an off-line web structure.
To delete a Web page
Click the activity toolbar button Web page .
Select a Web page you want to delete and click Delete.
Confirm that you really want to delete the Web page.
To set a Web page as Home page
Click the activity toolbar button Web page .
Select the Web page.
Click Set as Home.
Web Page Toolbar
The Web page pane has its own toolbar, which consists of the following buttons:
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
Web Page Tool Menu
The tool menu of the Web page pane consists of the following options:
Back – to return to the last viewed page
Forward – view one of the last nine pages visited in this session
Home – to return to the Home page
Refresh – to refresh a Web-page
Copy URL – to copy a URL address of the displayed page
Add to Selected Pages – to add the selected page to the list web-pages present in the Activity
Print – to print the Web page pane (only its visible part will be printed)
Clipboard Copy – to copy the Web page pane to the clipboard
Help – to consult help system
Notice when you right-click the web page pane then instead of standard Coach Tool menu the Browser menu is shown.
165
Student Texts
Student texts are meant for student notes, answers and reports, etc. Students can create and edit new texts.
An Activity may consist of more Student texts than the Student text(s) shown on the activity screen. By clicking the activity toolbar button Student text or the arrow next to it you can see if there are more Student texts present. A Student text can appear only once; it can be displayed in a pane or listed in the Student texts list.
The topics in this chapter will help you to work with student texts.
Managing Student Texts
When there are more Student texts you can browse through these in the Student texts pane. Coach follows the numbering or alphabetical order.
To browse through Student texts
Click the forward and the backward arrow buttons in the Student text pane caption.
Or
Right-click the Student text pane or click its Tool button
text.
and select Next or Previous Student
To move a Student text to another pane
Click the caption of the Student text pane you want to move.
Start to drag the caption; the cursor displays the Student text icon.
Move the Student text icon over a pane in which you want to place the Student text and click the pane
To select another than the displayed Student text
Click the activity toolbar button Student text
confirm.
. Select a Student text from the list and click OK to or
Click the arrow placed at the right-hand side of the button Student text .
The cursor displays the Student text icon.
Move the Student text icon over a pane in which you want to place the Student text and click the pane.
To add a new Student text
Click the activity toolbar button Student text .
Click New Student text and type in its title. Click OK to select the new text.
or
Click the arrow placed at the right-hand side of the button Student text
Type in its title and click OK.
166
and click Add new.
The cursor displays the Student text icon.
Move the Student text icon over a pane in which you want to place the Student text and click the pane.
To delete a Student text
Click the activity toolbar button Student text
.
Select a Student text you want to delete and click Delete.
Confirm that you want really delete the selected Student text.
To edit a Student text title
Click the activity toolbar button Student text . Select a Student text and click Edit.
Click the Tool button of the Student text pane
and select Edit Title.
or Enter a title. This title will be displayed in the Student text pane caption.
Click OK to confirm.
Student Text Toolbar
For writing the text Student text pane is equipped with a simple text editor. The editing options are available via the toolbar or via the Tool menu. 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 a bold, italic and underline font style
to put text in subscript or superscript
to format text (align left, center, align right)
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 or Student text.
167
Student Text Tool Menu
The tool menu of the Student text pane consists of the following options:
Edit title – to edit the title used in the pane caption
Next Student Text – to display the next Student text
Previous Student Text – to display the previous Student text
Cut - to cut the selected text
Copy – to copy the selected text
Paste – to paste the selected text
Font – to set a font and font size for the selected text
Select all – to select all text
Undo – undo last action
Redo – redo last action
Save to File – to save text as RTF file
Print – to print the Student text pane (only its visible part will be printed)
Clipboard Copy – to copy the Student text pane to the clipboard
Help – to consult The Help system.
168
CHAPTER 9
Coach Language
Coach Language is a programming language, which is used in formulas, text models and programs. A formula consists of a variable, to which a single expression is assigned. A model or a program consists of one or more statements, which are composed of words, numbers and symbols. The 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.
Comparison with other programming languages
170
Variable Names
171
Expressions
173
Statements
177
Functions and Procedures
180
Error Messages
187
169
Comparison with other programming languages
Coach Language is a relatively simple programming language derived from Pascal. If you have some experience in languages like BASIC or Pascal, you may recognize most of the expressions and statements. Programs and Text models written in Coach Language can only be executed within Coach. To write a such a program or model in Coach Language you need to know about the order in which the words in expressions and statements should appear (syntax) and about their meaning (semantics). 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 (input/output), or handle files while running a program. On the other hand, when using Expressions, and Standard Procedures and Functions offered by Coach Language you have direct control over the 'in', 'out' ports of the interfaces.
170
Variable Names
Variable names used in formulas, text models or programs should be written according to Coach Language rules. In Graphical and Equation modeling modes labels are used to describe the variables. The labels are interpreted by Coach language and if they consist of characters or words that are not allowed to be used by Coach Language than Coach automatically adds square brackets around the label. The variable name used by Coach is displayed below the label name in the Variable Properties dialog.
The topics in this chapter will help you to learn rules which need to be followed by variable names.
Names
When composing names it is 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. W hen composing names, certain characters and words are reserved to Coach and may not be used. For these words Coach is not case-sensitive. Numbers
When composing numbers you can use characters from the set: { 0 1 2 3 4 5 6 7 8 9 + - . e E }
Notice that a number may not begin with a decimal separator.
The maximum number of significant figures is eleven. Coach uses an internal representation of numbers that can store numbers whose absolute value is either zero or lies between 3.4E-4932 and 1.1E4932.
Reserved Characters
Some characters have a special meaning in Coach. It is not allowed to use them in names of constants, variables, procedures and functions. These characters are listed below. Characters with ASCII codes: 0 .. 31
Symbols for arithmetic operators: ( ) - + ∗ / ÷ ^ = < >
Spaces and the symbols: ' . , % " : ; $ # @
Furthermore it is not allowed to use a number as the first character of a name.
Notes:
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.
The following character pairs have a special meaning (and may be used in the right place): <= >= := <>
Reserved Words
Some words have a special meaning in Coach. It is not allowed to use them as names of constants, variables, procedures and functions. These words are listed in the table below. 171
Abs
Domain
Min
Set
And
Else
Not
SetAbsolute ArcCos
EndDo
Off
SetLevel
ArcSin
EndFunction
On
Sign
ArcTan
EndIf
Once
Sin
Becomes
EndProcedure
Or
Sound
Bezier
EndRedo
Pi
Spline
Bit
Entier
Print
Sqr
ClearData
Exp
Procedure
Sqrt
Column
Fac
Pulse
Stop
Cos
Filter
Rand
Stopwatch
Count
Function
Redo
Sum
Counter
If
Repeat
Tan
Delta
Integral
RepeatedPulse
Then
DeltaFil
Interval
Reset
UnitStep
Derivative
Latched
ResetAbsolute
Unlatched
DerivativeSmooth
Level
ResetCounters
Until
DerivativeSecond
Ln
Round
Wait
DerivativeSecondSmooth
Log
RunningTime
While
Do
Max
SaveData
The reserved words On, Off and Pi [π] are the names of constants. The value of these constants is 255, 0 and 3.141592654… respectively. They can not be changed.
True and False
A condition is either True or False (logical 1 respectively Logical 0).
For True, Coach Language uses the term On.
On corresponds to terical value 255.
For False, Coach Language uses the term Off.
Off corresponds to the numerical value 0.
172
Expressions
An expression is any combination of variables, operators, constants and functions resulting in a single
value. There are two groups of expressions, simple expressions and expression with operators.
Simple Expressions
A simple expression is
a single number like 6.13 or 105
a single constant like Pi, On, Off
a variable like x, time
a call to a standard mathematical function, a special mathematical function or a standard Coach Language function. The result of a function is always a value.
Variables
A variable can be considered a label for a changing numerical value. Assigning the value of an arithmetical expression to a variable means that the value is stored in a memory position of the computer under that label, e.g. "Total := 5 + 6" means that the value "11" is stored under the label "Total". The name of the variable can be chosen freely, but must meet the rules for naming in Coach Language. 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 program.
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 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 logical and/or relational operators are also used to define conditions in statements. An expression can be used as a condition when the result is one of the Boolean values True (On) or False (Off). For example:
Temperature > 15
Brightness <> (l+1)/l
(Brightness > 20) AND (Colour <> Red)
More examples
Arithmetic Operators
Operator
Description
Priority
-
Reverse sign 1
^
Raise to the power 1
173
Operator
Description
Priority
*
Multiply 2
/
Divide 2
+
Add 3
-
Subtract
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.
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
Description
Priority
NOT
negation of logical value 1
AND
logical AND 2
OR
logical OR
3
Truth tables for the Logical operators
Note: S1 and S2 in these tables stand for statements like for instance "A>B" or "Number<1".
NOT
S1
On
NOT S1
Off
Off
On
S1
On
AND
S2
On
S1 AND S2
On
On
Off
On
Off
On
On
Off
Off
Off
S1
On
OR
S2
On
S1 OR S2
On
On
Off
On
Off
On
On
Off
Off
Off
174
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.
Complex relational expressions can be composed using logical operators. In such cases the relational expressions must always be placed between parentheses.
Operator
Equation
Priority
=
equals 4
<>
not equal 4
<
less than 4
>
greater than l
4
<=
less or equal
4
>=
greater or equal 4
Note: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.
EXAMPLES
(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.
Syntax of Expressions
Use of spaces and <Enter> (line breaks)
In a logical expression spaces must be placed to separate the logical operator from the value(s). In an arithmetical expression or a relational expression the use of spaces is optional. It is not necessary to write an expression on a single line. It may, for reasons of 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> (hard line break). When separated by spaces, it is possible to place two or more expressions on one line. When using <Enter> to separate expressions, each expression is placed on a new line.
175
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.
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
Expressions with arithmetic operators
Interpretation
A∗B^C A∗(B^C) A^-B∗C (A^(-B))∗C A^-B-C
(A^(-B))-C 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
(a3∗x^3)+(a2∗x^2)+(a1∗x)+a0
Expressions with logical operators
Interpretation
NOT Dry+1 (NOT(Dry))+1 On OR NOT(Available) On OR (NOT(Available)) Dry AND Wind OR Sun (Dry AND Wind) OR Sun Sun OR Dry AND Wind
Sun OR (Dry AND Wind)
Expressions with logical operators
Interpretation
X<Z/(Z-1) X<(Z/(Z-1)) X>=1+Y X>=(1+Y) X∗2<=Y+5 (X∗2)<=(Y+5) (A<=B) AND NOT(C>B)
(A<=B) AND (NOT(C>B))
Notes:
When comparing a logical variable with a numerical variable, keep in mind that On and Off correspond with the numerical values 255 and 0. However, a Boolean variable automatically has 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
176
Statements
A statement is a program element which can be executed independently. Here, we distinguish between simple statements and structured statements.
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 equal sign). In Coach Language you can also just use the symbol '=', or the word becomes. It is not necessary to separate the operator with spaces.
Syntax: variable := expression
Examples:
X := Y + Z
Wet becomes (rain) AND (NOT(umbrella))
Procedure call
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
Own Commands, i.e. procedures created by the end-user.
Pre-defined procedures by the author of the Activity ('Micro-world').
Structured statements
A structured statement is a statement which has a prescribed structure. There are two types of such statements in Coach Language: Conditional statements and Loop statements.
Conditional statements
This statement conditionally executes a group of statements, depending on the value of a 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. If the condition is False (Off) no statements are executed. Syntax: If Conditional expression Then Statements EndIf
Example: If x>0 Then
y:= sqrt(x) EndIf
If .. Then .. Else
If the condition is True (On), then the statements between Then and Else are executed. If the condition is 177
False (Off), then the statements between Else and EndIf are executed.
Syntax: If Conditional expression Then Statements Else Statements EndIf
Example:
If (a<2) AND (b>5) Then
a:=a + 1 b:=b – 5 Else
a:=a –1 b:=b + 3 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
Example:
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.
There are three different types of loop statement, two of which are controlled by a conditional expression. The third is an unconditional loop statement.
In a loop statement, a number of statements are executed a certain number of times.
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
Example: Repeat
Set(1)
Reset(1) Until RunningTime > 125 While .. Do .. EndDo
Repeats the statements between Do and EndDo as long as the condition behind While is True (On). If the condition is False (Off) at the start, no execution will follow.
178
Syntax: While Conditional expression Do Statements EndDo.
Example:
While r<> 3 Do
If x>1 Then
Set(2)
Else
Reset(2)
EndIf EndDo
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
Example:
Redo 10
Wait(0.5)
Set(1)
Wait(0.5)
Reset(1) EndRedo
179
Functions and Procedures
Coach Language consists of functions and procedures: standard mathematical functions,
special mathematical functions,
standard functions, and standard procedures.
Standard Mathematical Functions
The functions listed below can be used in formulas (where they use columns of one row and the result is one number that will be put in the same row as well), control programs and text models.
Note: Coach uses an internal representation of numbers that can store numbers whose absolute value is either zero or lies between 3.4E-4932 and 1.1E4932.
Function
Description
Remarks
Sin(x)
Sine of x
x in deg/rad*
Cos(x)
Cosine of x
x in deg/rad*
Tan(x)
Tangent of x
x in deg/rad*
Arcsin(x)
Inverse sine function (radians)
x in [-1;1]
Arccos(x)
Inverse cosine function (radians)
x in [-1;1]
Arctan(x)
Inverse tangent function (radians)
Exp(x)
e-power of x (ex)
Ln(x)
Natural logarithm (base e)
Log(x)
Briggs logarithm (base 10)
Sqr(x)
Square of x
Sqrt(x)
Square root of x
Abs(x)
The absolute value of x
Entier(x)
Rounds a number down
Round(x)
Rounds off a number
Fac(x) Generates (round(x))! (factorial)
Max(x ;x ;.. x )
1 2
i
Selects the largest of i parameters
Min(x ;x ;..x )
Selects the smallest of i parameters
Rand
Generates a random number in the interval [0,1]
Sign(x)
Generates: -1 for x < 0; 0 for x = 0; 1 for x > 0
1 2
i
180
* The angle unit, radians or degrees, depends on settings in the Activity Options. Special Mathematical Functions
The functions listed below can be used only in formulas inside the Data Table and they typically use several rows of the columns and sometimes they also generate more than one result (fill several cells of the target column or all cells of the target column). These functions cannot be used in Control programs.
Function
Description
Bezier(X;Y)
Calculates a polynomial approximation according to the Bezier method, based on the values of variable in the column X (x-axis) and column Y. Column(K;N)
Fills a new column with the values equal to the value from a column K and a row N e.g. Column (2;100) gives the 100th value of column 2. Delta(X)
Calculates the difference between two successive values in the variable X. Cell(n) is filled with the value of the expression Cell(n+1) - Cell(n) from the source column. The last cell in the target column remains undefined.
Deltafil(X)
Combines Delta(X) and Filter(X;n). This function is only useful if the data points in variable column X are equidistant. For the filter interval n the fixed value of 2 is taken.
Derivative(X;Y)
Calculates the numerical differentiation of the values in column Y with respect to column X. DerivativeSmooth(X;Y;n)
Calculates a smooth derivative Y with respect to X, first a spline with the smoothing factor n is computed, then numerical differentiation of the spline function.
DerivativeSecond(X;Y)
Calculates the numerical second order differentiation of the values in column Y with respect to column X.
DerivativeSecondSmooth(X;Y;n)
Calculates a smooth second derivative Y with respect to X, first a spline with the smoothing factor n is computed, then the second numerical differentiation of the spline function.
Domain(b;e)
Fills all cells of a new 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 denotes the number of rows.
Filter(X;n)
Performs filtering of the values in column X with filter interval n. The value in 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. At the boundaries, mirroring is used to obtain sufficient values.
Histogram(X;n;l,u)
Divides the value from column X in n different classes (bins) and for each class gives the frequency of occurrence. The i-th class runs from l+(i-1)*(u– l)/n to l+i* (u-l)/n where l is lower and u is upper boundary. Integral(X;Y;r)
Calculates the numerical integration of values in column Y with respect to X. r is the constant of Integration (initial value).
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.
181
Function
Description
Sum(X)
Adds the values of cells of variable X. The value in cell(n) contains the sum of all values in column X which have an index smaller or equal to n. Spline(X;Y;f) Calculates a smooth Spline approximation of the data set, based on the values in the column X and Y, and the smoothing parameter f. If the smoothing factor f is set to zero, the natural quintic spline interpolation through the data points is obtained. UnitStep (X,b)
Generates 0 for X < b and 1 for X ≥ b Standard Functions
The following standard functions can be used in programs.
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.
Example:
In an assignment: State = Bit(1)
In a conditional statement: If Bit(2) = On Then … or shorter: If Bit(2) Then …
Counter and Reset Counters
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.
Example:
In an assignment: State = Counter(1)
In a conditional statement: 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.
Example:
182
In an assignment: Brightness = Level(1)
In a conditional statement: 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.
Example:
In an assignment: State = Latched(1)
In a conditional statement: If Latched(2) = On Then …
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.
Example:
In an assignment: State = Unlatched(1)
In a conditional statement: If Unlatched(2) = On Then …
or shorter: … If Unlatched(2) Then
RunningTime
The standard function RunningTime returns the time (in seconds) which has lapsed since the start of the program.
Example:
Repeat
…
Until RunningTime > 100
or
While RunningTime < 100 Do
…
EndDo
Standard Procedures
The following standard procedures can be used in programs.
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.
Clear Data
183
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.
Example:
For an interface with four digital outputs is allowed Set(1;2;3;4) .
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 the CoachLab II/II+ interface. The standard procedure SetLevel(i,p) sets the power level of the digital output i to p. It 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. 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.
Example:
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.
Example:
For an interface with for example four digital outputs SetAbsolute(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
Example:
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 184
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 the 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
Wait
185
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.
186
Error Messages
Two kinds of errors may occur:
syntax errors which are detected during the interpretation of the program or the text model preceding the execution or preceding the selection of variables along diagram axes.
execution errors which are only detected while programs and text models are executed.
Error messages during interpretation
If an error is detected during interpretation of the program or the text model, an error message pops up. The cursor flashes behind the position in the program or the text model where the error has been detected. The error can be corrected immediately.
Error message
Cause
"Character not expected"
A character is placed where it is not expected to be.
"Number not correct"
The interpreter 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 interpreter expects a name or a symbol.
"... NOT expected"
The interpreter 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 does not contain the final assignment: function_name := function_result Examples of syntax error messages
Examples of syntax errors and corresponding error messages:
Program
Error message
a : 1
Character not expected
a 1
"Assignment" expected
a := / 1
"/" not expected
a := 1e=12
Number is not correct
If a>0 Then a:=1e12 "EndIf" expected
Repeat a:=1e12 "Until" expected
Redo a := 1e12
"Assignment" not expected
Redo a 1e12 Number not expected
187
Program
Error message
Function a(x;y)
EndFunction
"EndFunction not expected"
Function a(x;y) z=x*y EndFunction
"Function result not assigned"
Function a(x;y) a=x*y EndFunction
Procedure "This name is already in use"
a(e) w = sqrt(e)
EndProcedure
Function a(x;y) a=x*y EndFunction
a = 12 "Type conflict"
Procedure a(x;y) z = x+y EndProcedure
s = a(1;2)
"Type conflict" a(1;2;3) "")" expected" a(1) "";" expected" Procedure b
b = 12
""=" not expected"
EndProcedure
Error messages during execution
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 or the text 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
188
A program, which returns error messages when executed.
Program
Error message
a := 100 w := 100 Redo 100 a := a - 1 y := 12/a "Division by 0 (in the last loop (when a=0))" y := ln(a)
"Value not in the domain (in the last loop (when a=0))"
w := w*w EndRedo
"Number out of range (in the 6th loop)" 189
190
CHAPTER 10
For Authors
Coach is an authoring environment and allows teachers or other curriculum developers (called Authors in Coach), develop and manage Coach Activities for student users. User Levels
192
Creating Activity
194
Author Tools
198
Creating a customized programming environment
200
191
User Levels
Coach distinguishes the following user levels: Author, Senior student and Junior student .
The user level is set by the Author and is stored in the Activity.
By default Coach starts and opens Activities in the user level stored in the Activity, however Coach can be forced to open Activities in Senior-student mode or Author mode.
Author
Author users may create, edit and manage Coach Activities. This includes the possibility to:
specify the type of used tools,
set the student-user level,
decide on activity design e.g. more open student investigation, ready-to go experiments, etc.,
decide how data are presented,
provide learning content.
To make impossible for Student users to login in and work as Authors, Author mode is protected with an Author key. The default Author key is ‘0000’ (four times digit 0). This key can be changed via the main menu option Options > Author Key Settings.
To set Coach into 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’.
Confirm with OK.
From now on now all Activities will be opened in Author mode.
Senior Student
Senior-student users are the most powerful student users, they can use almost all functions of Coach excluding:
creating and saving Activity files (cma7 files), they can save only result files (cmr7),
editing Texts made by Authors,
removing objects created by Authors.
To set Coach into 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 the activity user level stored in the activity.
Junior Student
The Junior student level distinguishes between three sub-levels: Fixed, Flexible and Own Lab.
192
In Fixed mode: students cannot change the activity screen layout; only objects displayed on the activity screen are visible to students. Not all activity buttons are present, nor a Settings button. This means that Authors should provide all required objects on the activity screen.
In Flexible mode: students have a little more freedom, they can change the duration of measurements and they can change objects displayed in panes via the activity toolbar buttons. However, only those toolbar buttons are present, which have defined at least one object. For example if there are no images included then the activity toolbar button Image will be not displayed. Additionally students can also handle sensors and actuators on the interface image.
In Own-Lab mode: students can do simple calibrations and all activity toolbar buttons are present.
193
Creating Activity
Follow the steps described in this chapter to create an Activity for your students. Step 1: Starting a New Activity
An Activity can be created and modified only by Authors, not by student users. After login as an Author, the button New is added to the main and activity toolbars.
To start a new Activity
Click the main or activity toolbar button New or select File > New from the menu.
An empty activity is started and the Activity Options automatically appear on the screen.
Go to Step 2.
Step 2: Selecting an Activity Type
The Activity Options dialog displays the Activity type tab. Here you have to decide with which ofthe scientific tools students will work in this activity.
Measurement
This type is used for activities in which data are collected via interface and sensors or are manually typed in.
Select Measurement.
Select the interface from the drop-down list. Notice that when Coach has detected a connected interface then this interface is displayed as default on top of the list.
In case you want to only manually type in data you can select the No Interface option.
The Off-line option will be automatically selected when an interface, which is able to work offline, is selected e.g. CLAB. In this case two additional buttons Send Settings and Get Results, will be added to the activity toolbar.
If desired check the option With a program. This option should only be checked for Activities, in which data from sensors and/or actuators have to be stored in the data table, while a program is used to control. Program variables cannot 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 measurement settings. The advantage of this setting is that the signals are evaluated independent of the program speed. The activity toolbar button Start is available to start a measurement run and program execution. When the option With a program is checked, then the More button becomes active, click this button to see additional options. To hide these options again, press Less.
If the Program button should be hidden, for example for Junior-student users, deselect the Show
Program button. Only the button will be hidden. It is still possible to display a program on the activity screen if the Program window is visible at the moment of saving the Activity.
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).
Control
This type is used for activities in which control programs can be designed, created and executed. Such 194
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 the data table. However, the values are stored in memory (and appear in the data table) 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 (hence on the processor speed of the computer).
Select Control.
Select the interface from the drop-down list. Notice that when Coach has detected a connected interface, then this interface is displayed as default on the top of the list.
By default, the option With a program is checked. When this option is unmarked then the resulting Activity can be used for manual control of actuators connected to an interface.
If sensor signals change rapidly, it is better to use the setting Measurement with a Program. In that case, however, program variables cannot be displayed in the data table and graphs.
When the option With a program is checked, then the More button becomes active. Click this button to reveal additional options. To hide these options again, press Less.
If the Program button should be hidden, for example for Junior-student users, deselect the Show
Program Window button. Only the button will be hidden. It is still possible to display a program on the activity screen if the Program window is visible at the moment of saving the Activity.
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).
Modeling
This type is used for activities in which dynamical models can be designed, created and executed.
Select Modeling. The option No Interface becomes selected.
Click the More button to reveal additional options. To hide these options again, press Less.
If the Model button should be hidden for Junior student-users, deselect Show Model Window
button. Only the button will be hidden. It is still possible to display a model on the activity screen if the Model window is visible at the moment of saving the Activity.
Deselect Allow switching between different modes to hide the Modeling buttons to change the modeling modes.
Data Video
This type is used for activities in which video or image measurements are performed.
Select Data Video. The option No Interface is automatically selected.
Go to Step 3.
Step 3: Selecting a User Level
The next step is to set the default user level of the Activity. In general, this is the user level in which Coach runs this Activity, unless explicitly overruled by the user level login.
Click the tab User Level.
Select the user level for the Activity.
By default Senior student is selected.
The Junior level is split up into three levels: Fixed, Flexible and Own Lab. First click the Junior student and then select the sub-level from the drop-down list.
Go to Step 4. 195
Step 4: Setting Advanced Activity Options
The next step is to set the advanced activity options. Most of the options are used only in rare cases. Click the tab Advanced.
Mark the option Always run in Quick mode only when fast program execution is required. This mode is needed when your program is not reacting quickly enough for the real events because it is painting something on the screen e.g. graphs, meters, etc. Check if this option is unmarked when no data appear in diagrams or tables during a measurement.
Specify the unit for angles used in the Activity (e.g. in formulas), or measured in the Data-Video window. 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.
Select a language for Coach Language commands, the drop-down list shows all installed languages. By default the Coach user interface language is selected. This option makes possible to use for example English Coach Language in Coach which runs in "another language", for example in Dutch language. The selected language is stored in the Activity.
Click OK to close the Activity Options dialog.
Go to Step 5.
Step 5: Filling an Activity
After the activity options are set an empty Activity is opened. The activity screen displays four panes and the activity toolbar is adjusted depending on the selected activity type. Now you are ready to design your activity. Depending on the user level and the aim of your activity, the activity can be ready-to-go: many things are ready for use by students. Or can be more open: students decide how they want to measure, display and process their data.
To fill an Activity
Depending on the type of activity and the selected user level:
Prepare the measurement, for example: select sensors, select the type of measurement, specify the measurement setting, open and calibrate a video for measurement, create a model or command list in the program window, etc.
Decide how the data will be displayed in the data table, graphs, meters, etc.
Fill panes with additional learning content by writing texts, adding images and videos, linking to webpages. If needed you can add new panes to the activity screen.
During the development process, Authors can immediately view and evaluate the Activity in the selected student-user mode by using the activity menu option Tools > View as. 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.
Notee that it is possible to prepare an Activity for an interface, which is currently not connected to the computer (inactive). To avoid getting messages that the interface could not be initialized, deactivate the interface by deselecting the option Activate Hardware in the Tools menu. 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.
Finally decide on the activity screen layout. Via the menu option Display > Screen Layouts you can find a few pre-defined layouts.
Go to Step 6.
Step 6: Saving the final Activity
When you are ready with your activity you can save it. All objects used in an Activity like texts, images, videos, data and modified or newly created sensors/actuators, are stored in the Activity (*.cma7) file, similar to 196
pictures in a Word document. The current activity screen layout is also stored and this will be the layout used when student users open the activity. Student users can work without overwriting the activity. When they work with the activity, they can save it only as a Result (*.cmr7) file.
To save an Activity
Select the activity toolbar button Save as or select File > Save from the menu or press <Ctrl>+<S>. If an Activity is saved for the first time, all these commands invoke the Save as dialog.
Browse to the desired location.
Type in a descriptive activity file name.
Once an Activity is saved, the Save as button always invokes the Save as dialog. Using Save from the activity File menu or <Ctrl>+<S> immediately updates (overwrites) the current Activity.
Because all necessary files are embedded in the Activity/Result file, it is very easy to exchange activities with other users, simply by giving/sending someone a *.cma7 or *.cmr7 file. In one double-click the complete activity will start on the other computer (provided Coach 7 is installed). In a similar way, hyperlinks to CMA files can be put on a website to be downloaded and started in Coach.
197
Author Tools
Author tools are available through the Main menu via the Options and Tools menu for Windows, and Via the Coach 7 and Tools menu options for Mac. These are the available tools: Preferences, Author Key Settings and Deactivate Hardware.
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.
Author Key Settings
The option Author Key Settings allows changing the Author key. The Author key can also be disabled, i.e. upon logging in as an Author there will be no request for the Author key.
To change an Author key
Windows: In the Main menu, select Options > Author Key Settings. Mac: In the Main menu, select Coach 7 > Author Key Settings. The Author Key Settings dialog appears.
First, type in the current Author key.
Check 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.
To disable an Author key
Windows: In the Main menu, select Options > Author Key Settings. Mac: In the Main menu, select Coach 7 > Author Key Settings. The Author Key Settings dialog appears.
Enter the current Author key.
Unmark the Option Enable Author key and click OK.
Be aware that without an 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.
Lost Author key
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 7 folder. In case of a network installation the location of the file is specified during the installation.
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.
198
To deactivate the hardware
Uncheck 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.
Starting Coach via Command Line
In Windows it is possible to force Coach to start in a certain mode by extending the command line to Coach7.exe program with an extra option. The following options are possible:
/A – start in Author mode
/X – start with "activate hardware" switched off
/S – start without splash screen
With the option pair /W:number and /H:number 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, it will make Coach run in an 800x600 window.
199
Creating a customized programming environment
When creating a Control or a Measurement Activity with a Program, the Program window offers standard Coach Language programming instructions. Authors can customize this standard list and adapt it for a specific application, also called Micro-world. Such a Micro-world consists of a set of commands - functions or procedures, tuned to a particular control application. This can simplify the programming environment/language for f.i. younger students.
The topics in this chapter will help you to learn how to create a customized programming environment (microworld) for your students: Creating Procedures and Functions
The following topics will help you to learn how to create new functions and procedures for use in your programming environment (micro-world).
Opening Procedure Window
Authors can create specific (micro-world) programming commands in the Procedure window. The Procedure window is placed in the Program window and is hidden behind the program editor.
To open the Procedure window
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.
Creating New Functions
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. The syntax of function 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 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.
200
In a function it is allowed to call an already defined function.
Uppercase and lowercase names are different in Coach.
EXAMPLES
Function Mean(A; B)
C = A+B
Mean = C/2
EndFunction
Function Light
If LightIntensity > 50 Then
Light = 1 Else
Light = 0 EndIf
EndFunction
Creating New Procedures
To define a new 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 procedure 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.
EXAMPLES
Procedure Lamp
201
Set(1)
EndProcedure
Procedure Lamp(n)
Set(n) EndProcedure
Procedure Lamp(n; State)
If State = 1 Then Set(n) Else Reset(n) EndIf EndProcedure
Creating programming buttons
Students can make programs by manually controlling a system via so-called programming buttons. By clicking the 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 carries out the recorded program instructions.
When the mouse cursor is placed above a button, a tool-tip with the procedure name (indicating its action) will appear.
Note: The button area is displayed when the Program-window Tool menu option Show Programming buttons is marked.
Programming Button Types
The following button types are available:
ONE SHOT
A one-shot button executes a procedure once when it is pressed. Only procedures without parameters (standard and created in a micro world) can be selected.
Pushing the button executes the procedure once and places the procedure name in the program line.
Example:
Procedure Main_road_Red
Set(4)
Reset(5;6)
EndProcedure
PUSH/RELEASE
A push/release button executes two procedures: one when the button is pushed and one when the button is 202
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 only once 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.
Example:
These buttons can be used for example to turn a lamp or a motor on for a certain time interval.
STEPPING
A stepping button causes a procedure to be executed a number of times while the button is pressed. A parameter 'steps' is added to the procedure name.
Only procedures with one parameter can be selected. This parameter must determine the number of repetitions in the procedure.
Example:
Procedure Go_Down(Number)
Repeat
Do_a_Step
….
Until Number
EndProcedure
Managing Buttons
To add a new button
Right-click the Program window and mark the Show Programming Buttons option.
Right-click an empty place in the button area of the Program window and select New Button.
Select a button type.
Select the procedure(s) associated with this button. In the list only procedures appear, 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 icons.
Click OK. The new button is placed in the Program window.
To edit a 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.
203
The button is removed from the Program window.
Modifying 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 an Author. The command list can be adapted by deleting references to existing commands from the command list and by adding references to new 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.
The command list is displayed when the Show Command List option is marked.
Managing Command List
To edit the command list title
The command list by default has the title Command. To change this title:
Right-click the Command List and select Edit Command List Title.
Edit the title and confirm with OK.
To delete a command from the list
Right-click the command you would like to remove and select Delete.
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 a command from the list
Right-click the command you would like to cut and select Cut.
The name and corresponding submenu(s) are moved to the clipboard and can be placed elsewhere in the list with Paste.
To copy a command from the list
Right-click the command you would like to copy and select Copy.
The name and corresponding submenu(s) are copied to the clipboard and can be placed elsewhere in the list with Paste.
To paste a 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). The option Paste (before) is available only for the first position of the command list.
Creating a New 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 also type a name of the standard Coach procedure or function.
204
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 to 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 microworld 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.
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, b. 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 a 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 the 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.
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.
205
Type the names of the 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 the Type value or Selection list option.
Click OK when the 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 the properties of the command in the similar way as creating a new command
Tutorial: Adding a New Command
Imagine a system consisting of 4 small lamps (3V-bulbs) which can be connected to the outputs of the CoachLab II+ interface 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 about which output should be activated; the second parameter informs if the selected output should be turned on or off.
1. Type the above listed procedure Lamp in the Procedure window.
2. Right-click a command or empty space in the command list and select Insert.
3. Type in the name Lamp. Coach recognizes that this is a procedure with 2 parameters.
4. Mark Adapted submenu.
5. Click the Edit Menu.
6. For this command two menus are required, the first to select 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 to 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. 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 declarations are: A=1 B=2 C=3 D=4, for CoachLab II these declarations are: A=1 B=3 C=5 D=7.
206
9. Define the submenu for the second parameter.
10. Mark the option Selection list.
11. Type the list items: On, Off. On, Off are standard Coach Language commands, you do not have to define them in the Procedure window. Tutorial: Redefining a of Structural Statement
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. Type in the Procedure window the function Light_Intensity.
2. Right-click the If command in the command list and select Properties.
3. Mark Adapted submenu.
4. Click the Edit Menu button.
5. In this window you have to create a condition.
6. Remove all settings that are placed in the fields at the left side of the window.
7. Type in a new title for the first selection list.
8. Type in the function name Light_Intensity in the first field.
9. 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.
10. Select the Selection list option.
11. Type in the inputs: 1, 2, 3, 4 and click OK.
12. Mark the operators used in the condition ‘<’ and ‘>’. (If necessary remove all default settings).
13. Finally define the right side of the condition. Users will have to type a value of the light intensity. (If necessary remove all default settings).
14. Type in a title for this part, for example Type value.
15. Select the Type value option.
16. Click OK. Your new condition is ready.
207
208
INDEX
Actuator Library 46
A
Actuator Tooltip 46
Activity 13
Menu 14
Menu Bar 13
Open 13
Adding
Annotation to graph 140
Adjust
Data Video/Image 70
Panes 16
Always Run in Quick mode 196
Status Bar 13
Analyze/Process 144
Title bar 13
Area 145
Toolbar 14
Bezier 148
What is it? 13
Derivative 152
Activity Format
*.cma7 format 13
Function Fit 151-152
Histogram 155
Activity Menu 14
Integral 153
Activity Options
Moving Average 147
Always Run in Quick Mode 196
Select/Remove Data 146
Angle Units 196
Signal Analysis 153
Coach Language 196
Slope 144
Activity Panes 16
Smooth 146
Activity Screen 13
Spline 149
Application Windows 13, 18
Main Toolbar 13
Statistics 145
Animated Objects 109
Panes 13, 16
Ellipse 109
Toolbar 14
Image 115
Activity Toolbar 14
Rectangle 111
Actuator
Vector 113
Connecting 46
Animation 102
Disconnecting 46
Animated Objects 109
Library 46
Background 107
Background type looping 108
Author Key 198
Background type zooming 109
Author Tools
Control Button 117
Author Key 198
Control Slider 118
Deactivate Hardware 198
Copying 104
Preferences 198
Creating 121
Creating a New 104
B
Deleting 104
Background
Coordinate System Tab 107
Editing a Title 104
Elements 106
Background Graph 138
Ellipse 109
Background of Animation 107
Executing 104
Bezier 148
Fit Markers 106
Image 115
C
Moving to another Pane 104
Calculated Video Points 67
Object Coordinate System 106
Calibrating Sensor 36
Rectangle 111
Calibration
Selecting 104
by Function 37
Stage Coordinate System 106
By Points 37
Stage Rules 106
Storing in EEPROM 38
Tool Menus 103
Storing in Sensor Memory 38
Toolbar 102
Capture Settings 65
Vector 113
Capturing
Capture Settings 65
Z-order 120
Video 64
Animation background
Image 108
Animation Background
Change Scale 66
Closing
Video/Image in the Data-Video Window 63
Color 107
Display Tab 107
Grid 107
Co-ordinate System Settings 67
Coach Language
Animation stage 106
Arithmetic Operators 173
Animation Toolbar 102
Comarison with other languages 170
Animations 101
Conditional Statements 177
Annotating
Error Messages 187
Graph 140
Errors 187-188
Video/Image 70
Expressions 173
Application Windows 18
Expressions with Operators 173
Area 145
Functions and Procedures 180
Arithmetic Operators 173
Introduction 169
Author 192
Logical Operators 174
210
Loop Statements 178
Saving the final Activity 196
Names 171
Selecting a User Level 195
Numbers 171
Selecting an Activity Type 194
Relational Operators 175
Creating an Animation 121
Reserved Characters 171
Reserved Words 171
D
Special Mathematical Functions 181
Data Rows 129
Standard Functions 182
Deleting 130
Standard Mathematical Functions 180
Inserting 131
Standard Procedures 183
Sorting 129
Data Table 124
Statements 177
Syntax of Expressions 175
Add Calculated Variable 127
True and False 172
Add Manual Variable 127
Variable Names 171
Add Variable into Run Series 126
Variables 173
Copying data from a Run to another Run 129
Coach Panes
Delete Variable 127
Image 160
Deleting Rows 130
Student Text 166
Deleting Run 131
Text 158
Display Variable 125
Video 162
Exporting into CSV file 132
Web page 164
Hide Variable 125
Conditional statements 177
Inserting Data Rows 131
Connecting a Sensor 25, 46
Inserting Empty Run 131
Connecting an Interface 12
Organization 124
Control 43
Renaming Run\ 131
Interface Window 45
Rules for Variable Names 171
Control Objects 117
Run Parameter 126
Button 117
Sorting Rows 129
Slider 118
Tool Menu 124
Correcting Perspective Distortion 71
Variable Columns 125
Creating
Variables in Run Series 126
New Graph 136
Data Video
Creating Activity 194
Add an Annotation 70
Advanced Options 196
Adjust 70
Angle Units 196
Automatic Measurement 58
Control 194
Change Scale 66
Data Video 195
Co-ordinate System Settings 67
Filling with Learning Content 196
Control Bar 54
Measurement 194
Exporting Video/Image 72
Modeling 195
Image Formats 64
211
Manual Measurement 57
Editing an Animation 122
Perspective Correction 71
Editing Data Table 125
Point-Tracking Measurement 58
Elements of Animations 106
Removing Part of a Video 70
Equations Mode
Scaling 66
Creating Model 93
Screen 54
Editing Model 93
Selecting Frames 68
Modeling 92
Time Calibration 66
Tool Menus 77
Tool menu 55
Variable Equations 92
Video formats 63
Event-based Measurement 31
Video Points 67
Executing an animation(s) 104
Video Resources 56
Executing Programs/Text Models
Data Video Window
Show/Hide 54
Error Messages 188
Exporting
Deactivate Hardware 198
Run 132
Defining Video Points 67
Video/Image 72
Deleting
Expressions 173
Annotation 140
Example of Interpretation 176
Data Rows 130
Simple 173
Run 131
Syntax 175
Video Points 61
With Operators 173
Derivative 152
Expressions with Operators 173
Different scale in horizontal and vertical direction 66
F
Displaying
Graph 134
Meter 142
Run 136
Favorite Models 80
First point clicked at each frame 67
Fit Markers 106
Formula 128
Value 143
Video Graphs 68
Editor 128
Formula Editor 128
Formula Wizard 129
E
Editing
Annotation 140
From bottom to top 67
From left to right 67
Function Fit
Equations Model 93
Automatic 151
Graph Properties 137
Graph Style 137
Graphical Model 89
Manual 152
Functions and Procedures 180
Meter 142
Text Model 96
Value 143
212
Zoom 139
G
Graphical Mode
Graph 134
Creating Model 88
Add an Annotation 140
Creating Subsystem 90
Area 145
Editing Model 89
Background Graph 138
Modeling 88
Creating 136
Tool Menus 77
Delete an Annotation 140
Grid 138
Derivative 152
Displaying Runs 136
H
Draw Prediction 140
Hardware Settings 9
Edit an Annotation 140
Configure 9
Function Fit 151-152
Help 10
Grid 138
Histogram 155
Histogram 155
How to
Integral 153
Compare model with experimental data 83
Modyfing Axis 136
Connect Interface 24
Moving Average 147
Control the speed ofmodel execution 82
New 136
Propertiers 137
Do automatic video-measurement (by point tracking) 58
Remove Data 146
Do image-measurement 59
Scan 139
Do manual video-measurement 57
Select Data 146
Do Measurement 27
Signal Analysis 153
Do Measurement Off-line 28
Sketch 140
Slope 144
Do Measurement Synchronized with Video capture 29
Smooth 146
Execute animation 104
Smooth/Bezier 148
Execute model 82
Smooth>Spline 149
Execute model via the Simulate option 83
Statistics 145
Modify Measurement Settings 27
Style 137
Modify the collected video points 60
Tool Menu 135
Perform Sensor Calibration 36
Toolbar 135
Replay Measurement 30
Working With 136
Run a program 47
Zoom 139
To perform perspective correction 71
Graph Axis
Modifying 136
I
Graph Tools
Image 160
Scan 139-140
Adding a New Image 160
Simple 138
Deleting 160
213
Editing a Title 160
Loop Statements 178
Exporting 160
Moving to another Pane 160
M
Selecting 160
Main Screen 8
Menu Bar 8
Tool menu 161
Image formats 64
Status Bar 9
Importing
Title Bar 8
Toolbar 9
Background Graph 138
CSV file 132
Managing
Models 80
Models 80
Program 51
Results 19
Input Range 36
Manual Measurement 32
Inserting
Mathematical Functions
Data Rows 131
Special 181
Run 131
Standard 180
Integral 153
Measurement
Mode 31
Interface
Automatic Detection 24
Off-line 28
How to connect 24
Procedure 27, 29
Lost Communication 24
Measurement Mode
Overview of Sensors 26
Event-based 31
Reset 24
Manual 32
Tool menus 45
Time-based 31
Interface Window
Measurement Settings
Modifying 27
DisplayHide 22
Tool Menus 22
Menu
Activity 14
Internal sensor
Main 8
Disable 26
Enable 26
Meter 142
Displaying 142
Interpreting Programs/Text Models
Editing 142
Error Messages 187
Model
J
Auxiliary Variable 85
Junior Student 192
Connectors 84
Constant 86
L
Creating Graphically 88
Language of Coach user interface 10
Creating Textually 95
Local Coordinate System 106
Creating via Equations 93
Logical Operators 174
Event 86
Login 10
Flow Variable 85
214
Independent Variable 87
Monitor Window
Monitor Option 82
Model 82
Process Variable 84
Program 47
Simulate Option 83
Moving animation background horizontally 108
State Variable 84
Variable Properties 84
Moving animation background vertically 108
Variable Types 84
Moving Average 147
Model Execution
Monitor Window 82
O
Run Controller 82
Object Coordinate System 106
Model Settings 79
Off-line 28
Model Toolbar 76
Opening
Model Variable
Activity 13
Auxiliary 85
Image in Data-Video Window 63
Constant 86
Result 13
Event 86
Video in Data-Video Window 63
Flow 85
Operators
Independent Variable 87
Arithmetic 173
Process 84
Logical 174
Properties 84
Relational 175
State Variable 84
Own Command
Model Window
Creating 49
Display/Hide 76
Deleting 49
Monitor 82
Editing 49
Run Controller 82
Inserting 50
Tool Menus 77
Managing 49
Toolbar 76
Printing 50
Modeling 75
Renaming 50
Creating a Model 88, 93
Creating a Text Model 95
P
Editing a Graphical Model 89
Perspective Correction 71
Editing a Text Model 96
what is it? 72
Editing an Equations Model 93
Point Tracking Settings 59
Formats of Variable Equations 92
Preferences 198
in Equations Mode 92
Program
in Graphical Mode 88
Editing 50
in Text Mode 95
Importing 50
Model Settings 79
Monitor Option 47
Ways of using 76
Run 47
Why to use? 76
Run fast 47
215
Tool Menus 44
Disconnecting 26
Program Execution
EEPROM 38
Fast 47
Input Range 36
Monitor Window 47
Overview of Connections 26
Program Window 44
selecting from the Sensor Library 25
Monitor 47
Selecting manually 25
Set to Value 36
R
Set to Zero 36
Relational Operators 175
Settings 26
Removing The Begin/End Part of a Video 70
Tooltip 26
Use as a Counter 40-41
Replay Measurement 30
Result 13
Delete 19
Open 13, 19
Save 19
Use as a Frequency Meter 41-42
Sensor Settings 26
Set to Zero 36
Setting up
Event-based Measurement 33
Result Format
Manual Measurement 34
*.cmr7 13
Run
Deleting 131
Exporting into CSV file 132
Hide 136
Importing CSV file 132
Inserting 131
Name 131
Time-based Measurement 32
Setto Value 36
Signal Analysis 153
Simple Expressions 173
Sketch 140
Slope 144
Smooth 146
Bezier 148
Renaming 131
Moving Average 147
Show 136
Run Controller 82
Spline 149
Sorting
Data Rows 129
S
Same at all frames 67
Same scale in all directions 66
Scaling Video/Image 66
Scan Data 139
Select and Remove Data 146
Selecting Frames 68
Senior Student 192
Sensor
Special Mathematical Functions 181
Spline 149
Stage Coordinate System 106
Stage Rules 106
Standard Functions 182
Standard Mathematical Functions 180
Standard Procedures 183
Statements 177
Conditional 177
Calibration 36
Calibration in Memory 38
Connecting 25
Loop 178
Statistics 145
216
Student text
Model Window 77
Adding a New Student text 166
Program 44
Browsing through 166
Student Text 168
Deleting 166
Text 158
Moving to another Pane 166
Text Mode 77
Selecting 166
Video 163
Student Text 166
Web page 165
Toolbar 167
Toolbar
Subsystem 90
Activity 14
Close 90
Animation 102
Creating 90
Graph 135
Open 90
Main 9
Removing 90
Model 76
Supported Actuators 11
Student Text 167
Supported Interfaces 11
Supported Sensors 11
U
Syntax of Expressions 175
Use as a Counter 41
Use as a Digital (1-bit) Sensor 40
T
Use as a Frequency Meter 41
Text 158
Use as a Time-interval Meter 42
Browsing through 158
User Interface
Moving to another Pane 158
Languge 10
Selecting another Text 158
User Level
Text Mode
Junior Fix Mode 192
Creating Model 95
Junior Flexible Mode 192
Editing Model 96
Junior Own Lab Mode 192
Modeling 95
Junior Student 192
Tool Menus 77
User Levels 192
Time-base measurement 31
Time Calibration in Data Video 66
V
To switch the user-interface language 10
Value 143
Displaying 143
Tool Menu
Editing 143
Animation 103
Data Table 124
Variable Properties 126
Data Video 55
Connections 127
Equations Mode 77
Data Sources 127
Graph 135
Label 126
Graphical Mode 77
Unit 126
Video 162
Image 161
Adding a New Video 162
Interface Window 22
217
Deleting 162
Exporting 162
Zoom in on Frames 68
Zooming animation background 109
Moving to another Pane 162
Selecting 162
Tool Menu 163
Video Capturing 64
Video Control Bar 54
Video Formats 63
Video Graphs 68
Displaying 68
Video Points 67
Adding 61
Calculated 67
Defining 67
Deleting 61
Modifying 60
Moving 60
Video Resources 56
Video Variables 68
W
Web page 164
Adding a New Web page 164
Deleting 164
Moving to another Pane 164
Selecting 164
Setting as Home page 164
Tool Menu 165, 168
What is perspective correction? 72
Window
Data Video 54
Dock/Undock 18
Interface 22
Model 76
Program 44
Z
Z-Orderof Animation 120
Zoom
Graph 139
218
Download PDF