Getting Started with qdCAS Accessible and jaws on the Pacmate Author: Peter torpey Date: October 30, 2004 This document provides a brief tutorial on using qdCAS Accessible with Jaws running on the Pacmate. The purpose is to describe the interface, use of the Jaws hot-keys, and illustrate how the program can be used to perform symbolic math calculations. The qdCAS application itself is sparsely documented (mostly in French), and many users may not be experienced in using symbolic math programs. The following paragraphs, however, describe the general syntax, several useful commands, and how to learn more. This document is not intended to be a comprehensive user's manual, but should be enough to get started. See the README.txt file for more details on qdCAS Accessible, the Jaws scripts for qdCAS Accessible, and the Pacmate. SYMBOLIC MATH Symbolic math programs such as qdCAS Accessible are used to perform mathematical computations on symbolic expressions. Numerical or approximagte results can also be obtained if desired. Some of the useful capabilities of such programs include performing algebraic simplifications, factoring and expanding polynomials, calculus, solving equations, etc. Some typical examples of using the program are given below. The user is encouraged to learn more about the power of qdCAS by using the help system, reading the documentation, and comparing this with similar symbolic math programs such as Maple (www.maplesoft.com). THE INTERFACE The program has two main windows: 1. The Input Display - Mathematical expressions are entered in this window by the user. QX users press Alt + I to get to the bottom of the Input Display, BX users press q-Chord i. 2. The Output Display - The results of computations are displayed in the Output window. For QX press Alt + O, BX press q-Chord o, to get to the top of the Output Display. There are also four buttons across the bottom of the application window. Each button can be activated by a separate jaws Hot-Key. These buttons and associated Hot-Keys are: 1. Compute - use QX: Alt + C, BX: q-Chord c - to compute the result of all expressions currently appearing in the Input Display. After the computation, the user is automatically placed at the top of the Output Display. 2. Load - QX Use Control + L, BX q-Chord l - to bring up an edit field in which the user can specify a file to be loaded into the Input Display. 3. Save - QX Use Control + S, BX q-Chord s - to save a file. 4. Menu - QX use Control + M, BX F2 - to bring up a menu of mathematical operations and other options. When finished here, hit for QX Alt + I or BX q-Chord i to return to the Input Display. OTHER HOT-KEYS AND HELP One other useful Jaws Hot-Key is QX: Control + D, BX: q-Chord d-Chord. This will clear all input from the Input Display and place the user in the Input window so that new expressions can be entered. The list of jaws Hot-Keys can be brought up from within the qdCAS Accessible application in the usual way by hitting QX: F1 followed by H, BX: dots 1456-Chord h. A comprehensive list of qdCAS modules along with associated syntax and examples is contained in the file aid_cas.txt. PERFORMING SIMPLE SYMBOLIC MATH COMPUTATIONS As a very simple example, hit Alt + I on the QX, or q-Chord i on the BX, to go to the input window and type: x*x + 2*2 Now hit Alt + C on the QX, or q-Chord C on the BX, to compute the result. When the computation is complete, the users's cursor is moved to the top of the Output Display. The first part of the output simply repeats the input expression (preceded by "//"). Arrow down to see the actual computed output, which is: x^2+4 To perform another computation, hit control + D on the QX, or q-Chord d on the BX, to clear the Input display and bring the cursor to the Input Display so that another expression, or several expressions can be entered. Several useful functions include: simplify, expand, and factor. As an example, go to the Input Display by hitting Alt + I on the QX, or q-Chord i on the BX, and enter the three commands: simplify((x+1)^2/(x+1)) expand(a*(x+1)) factor(x^2-4) After hitting Alt + C on the QX, or q-Chord c on the BX, to compute these expressions, the cursor is moved to the Output Display which shows: // simplify(((x+1)^2)/(x+1)) x+1 // expand(a*(x+1)) x*a+a // factor(x^2-4) (x-2)*(x+2) More detailed help for these or any other commands, including syntax and examples, can be obtained by typing a question mark followed by the command name in the Input Display and then hitting Alt + C on the QX, or q-Chord c on the BX. The program supports many mathematical functions including sqrt, sin, cos, ln, etc. Complex numbers are also supported so that the result of computing sqrt(-1) is i, and computing simplify(i*i) gives the result -1. Note, it is a good idea to simplify results since this is not always done automatically by the program. One more important feature of the program is the ability to perform approximate math (i.e., output a numerical result). this can be done with the evalf function. For example, input: evalf(sqrt(2)) evalf(pi) evalf(sin(pi/4)) and compute the result to give: // evalf(sqrt(2)) 1.4142135623731 // evalf(pi) 3.1415926535898 // evalf(sin(pi/4)) 0.70710678118655 Note that the program already knows about many mathematical constants such as pi, i, e, etc. OTHER SYNTAX AND ADVANCED FEATURES There are many advanced features of qdCAS, and only a sampling can be given here. Some of the more common mathematical functions which a more advanced user might use are outlined here. Again, use the syntax ?command to obtain more help and examples. here are SEVERAL EXAMPLES FROM CALCULUS. The input: diff(a*x^2+b*x+c,x) diff(sin(x),x) integrate(1/x,x) limit((x^2-1)/(x-1),x=1) produces the output: // diff(a*x^2+b*x+c,x) 2*a*x+b // diff(sin(x),x) cos(x) // integrate(1/x,x) log(abs(x)) // limit((x^2-1)/(x-1),x=1) 2 Other useful functions used for series calculations and expansions include taylor, series, and sum. Perform help on these and other commands to learn their full functionality. The program can also be used to solve algebraic as well as differential equations. For example, the input: solve( x^2-5*x+6 = 0 ) solve( [x+y=3,x-y=1], [x,y] ) simplify( dsolve( diff(y(x),x,x)=const, y ) ) produces the output: // solve(x^2-5*x+6=0) [2,3] // solve([x+y=3,x-y=1],[x,y]) [[2,1]] // simplify(dsolve(diff(y(x),x,x)=const,y)) x^2*const/2+x*c_1+c_0 Here, the automatically generated variables _c0 and _c1 are constants of integration. The above examples illustrate the use of the = operator, longer names for variables or symbols, and the left and right brackets for producing a list of items (such as equations). Note that variable and function names are case sensitive. The left and right brackets can also be used to perform vector operations such as: [1,2,3]*[4,5,6] which produces the dot product of the two vectors, 32. Cross products of vectors can be computed using the cross function. One other very important operator is the := operator. This operator sets the value of the symbol or variable on the left equal to the expression on the right. This is different from the = operator which does not set the left-hand expression equal to the right-hand expression, but merely states the logical equivalence of the two sides. For example, the input: x = 1 y = 2 [x,y] outputs the vector in the final line as: [x,y] On the other hand, the input: x := 1 y := 2 [x,y] outputs the vecgtor in the final line as: [1,2] The := operator is particularly useful for referring to previously entered expressions and/or making substitutions. For example, in order to solve a set of two algebraic equations, the following input could be used: eq1 := x+y=3 eq2 := x-y=1 vars := [x,y] solve( [eq1,eq2],vars ) The corresponding output is: // eq1:=x+y=3 y+x=3 // eq2:=x-y=1 -y+x=1 // vars:=[x,y] [x,y] // solve([eq1,eq2],vars) [[2,1]] Variable substitution can also be performed using the subs function as in: subs( a+b=c, a=x,c=y) which produces: x+b=y