Building Mathematical Expressions Smath Studio Tutorial 3
Building Mathematical Expressions Smath Studio Tutorial 3
Savage
Important Functions: The examples above include some particular character sequences,
namely:
sqrt to enter the square root symbol
<Cntl+G> to enter Greek letters
<space bar> to select wider expressions or expressions between parentheses.
Another important typing sequence is the use of the right-arrow key in your keyboard. Its action is
similar to that of the space bar, namely, to select wider expressions or expressions between
parentheses.
The above action will make your use of SMath simpler over the long term.
t <Cntl+G> : t <Cntl+G>.0+a <Cntl+G>.c * (T.f-T.0 <space bar> <space bar> / sqrt(1+ abs( D
<Cntl+G> T /b <Cntl+G> <space bar> <space bar> ^3 <space bar> <space bar> <space bar>
<space bar> ^ 3/2
This example shows the use of Greek letters (Cntl+G), parentheses, space bar, subscripted
variables, sqrt (square root), and abs (absolute value) in a 2D mathematical expressions. With
practice you will learn to build complex 2D mathematics in SMath Studio. Here is what your
equation should look like:
Change Tf to vf and DT to v2
Research Science Methods 12 Mr. C. Savage
Using the Boolean equal sign: The example above is an assignment statement. The variables
in the right-hand side of the assignment statement should be available beforehand in order for
this statement to produce a result. In this example those variables are undefined. If you click on
the expression d= to the right the message "d.0 – not defined" will be shown.
Sometimes you need to type an expression not with the purpose of evaluating it, but with the
purpose of documenting an assignment or report. In such case, you can use the Boolean equal
sign (first sign in the "Boolean" palette in the right-hand side panel in the SMath Studio interface,
also entered by using Cntl+=) to build your non-evaluating mathematical expression. Thus, you
could type, for example:
t <Cntl+G> <Cntl+=> t <Cntl+G>.0+a <Cntl+G>.c * (T.f-T.0 <space bar> <space bar> / sqrt(1+
abs( D <Cntl+G> T /b <Cntl+G> <space bar> <space bar> ^3 <space bar> <space bar> <space
bar> <space bar> ^ 3/2
Using the Boolean equal sign with function "solve": One other use of the Boolean equal sign
is to build a mathematical equation to be solved using function "solve". For example, the
quadratic equation (follow along by entering these equations on your worksheet):
Now use the equals sign to find the answer you should get, clearly not the answer we want:
To get the correct answer we are looking for we need to tell SMath to give you the real roots of
the expression. To do this click on the button in the menu bar and find solve (2) function, take
a second to read the description. Click insert and replace arg1 and arg 2 with x and x
respectively. You are telling SMath to use the expression defined as x and solve for variable x.
Than x= will return the answer we are looking for, see below (you are not including the arrows or
comments).
We now have three types of equal signs each with a different meaning:
= the Boolean equality that returns no action
:= will define a variable or equation
= which will return an answer
We also have a modifier to = in the form of “solve (arg1, arg2) that will return real roots.
Alternative uses of the function solve(2) and solve(4): An alternative way to solve the quadratic
equation used above, namely, 2𝑥 2 + 5𝑥 − 6 = 0 is to use function "solve". Here we show two different
ways to call function "solve", which was introduced above enter the following into your worksheet:
2 - Using function "solve" with four arguments, limiting the range of the solution:
In both cases above note the use of the Boolean equals sign as you are just giving an equation. One
outputs the two roots. Whereas in two we have restricted the answer to only those between 0 and 10
therefore, the negative root is not displayed. If you want to display the negative root you would enter the
following:
I hope that you are starting to see that the functionality of SMath requires some practice and
understanding of how the program works as well as the mathematical functions you are using. If you are
missing one of these understandings SMath becomes useless to the operator.
An alternative way to use function "solve" is to assign the function call to a variable, try entering the
following:
then find the answer by typing x:=, note that both roots are
given.
The "solve" function call can be assigned to another variable, try the following:
then find the answer. Note that is found in the symbols
pallet.
Once you are done this tutorial please email me your worksheet to receive credit. Then start on
assignment 3.