YFUNX PROGRAM TUTORIAL FILE The purpose of this file

---
Master Index Current Directory Index Go to SkepticTank Go to Human Rights activist Keith Henson Go to Scientology cult

Skeptic Tank!

+---------------------------------+ | | | YFUNX PROGRAM TUTORIAL FILE | | | +---------------------------------+ The purpose of this file is to provide a tutorial lesson on most of the basic features of the program called YFUNX. While it is possible to learn how to use the program by reading all the built-in help screens contained within each menu, if you are a first-time user, we suggest you read this tutorial while first running the program, and then later you can digest all the information contained in the help functions within each menu in the program. You can import this file, YFUNX.TXT, into any word processor and then print it so you can read the hard copy output while you run the program. To begin the tutorial you must have the program file YFUNX.EXE. We assume this file is in the current directory on the currently selected disk drive. PRELIMINARIES ============= KEYBOARD CONVENTIONS -------------------- As part of this tutorial we need to give directions on which keys to press on your keyboard. We will enclose in angle brackets single keystrokes that you should type. For example, if we ask you to type the first three letters of the alphabet we will show . If we ask you to press the control key, the alternate key, the backspace key, the space bar, or the enter (or return) key, we will show , , , or . Each enclosure in angle brackets should refer to exactly one keystroke or one character. On most keyboards, to type in a left or right parenthesis requires using a key in conjunction with another key. We will NOT show the shift key as a separate keystroke in this tutorial because we consider entering a parenthesis as entering a single character. Other characters like <+> or <*> can be entered in two different ways on some keyboards, one way uses the key, the other way does not. In general, we would only show the single character in angle brackets and we leave it up to you to decide whether or not the is needed to enter the character. These keyboard conventions should make clear exactly how many and which keys you press. If it is necessary to press two keys simultaneously we will show a connecting plus sign between the keystrokes. This is done primarily with the Control key , and the Alternate key . For example, when we show + it means you should press both the Control key and key W at the same time. As another example, + is used in the Main Menu to exit from the program. DISPLAY STRINGS --------------- We also need to indicate the contents of text strings you might see on the display screen. Such text parts will always be displayed in double quotes in this tutorial file. You will not see the double quotes on the screen, and the screen may contain other text parts that we do not show in this file. The double quotes are simply a convenient way to indicate parts of what you may see on the display. ADVICE FOR NOVICES AND EXPERTS ------------------------------ This tutorial file assumes you have the mathematical background required to understand the features that will be demonstrated. You may find some sections more applicable to novices than experts, or vice versa, depending on your background and experience. If you encounter an example that is beyond your understanding, you can either skip that example, or you can press the keys and view the results, even though you may not fully comprehend the output. This tutorial does not discuss techniques on how to best use or apply the available features. It only serves to demonstrate the basic features and capabilities which you can learn to apply to solve problems that are of interest to you. GETTING STARTED =============== To begin running the YFUNX program type the command: A FIRST EXAMPLE =============== You can't perform any really useful operations (except reading the Main Menu help screens) without first keying in a function. So perform the first menu item by pressing to key in a new function. An edit box will appear on the screen into which you are to type your mathematical formula. The first example function we will enter is the straight line Y = 2X + 3. The asterisk character * is used to to indicate multiplication. Note that you do not type in the Y = part of the formula since this program knows Y is a function of X. Type <2> <*> <+> <3> After pressing ENTER a brief message should appear indicating your function formula has been accepted and the new formula should now appear at the top of the Main Menu display screen. "f(X) = 2*X+3". We will now go the Graph Menu by pressing key You should see a new menu labeled as the "Graph Menu". Press key a second time and you should see the graph of a line with slope 2 and y-intercept 3. It is normal for the program to sound a short beep to indicate it is finished making a graph. After admiring the graph press either or and you should return back to the Graph Menu. Entering and graphing most functions is about as simple as this first example. To return to the Main Menu from the Graph Menu press or a second time. A SECOND EXAMPLE ================ For our second example we are going to enter the function Y = 2*SIN(X). Press key to begin entering a new function. Type in the following formula in the dialog box. <2> <*> <(> <)> A brief message should appear indicating your function formula has been accepted and the new formula should now appear at the top of the display screen. "f(X) = 2*SIN(X)". The straight line formula you entered previously has been replaced by the new formula. Although YFUNX has provisions for working with multiple functions, at any given time, there is only one currently active formula, and that formula is always displayed as the top line in any of the menu screens. Instead of going to the Graph Menu we are going to the Integration Menu. Press key and you should see a new menu labeled as the "Integration Menu". This menu contains many choices but we are only going to perform a couple of basic integration functions. The first thing we need to do is set the limits of integration. Press key and you should be prompted to enter the lower and upper limits of integration. To make the lower limit -3 type in: <-> <3> and when prompted to key in the upper limit +5, simply type: <5> We are going to integrate the function 2*SIN(X) over the closed interval [-3, 5]. The number of subintervals should already have a default value of 20 which is adequate for this first integral example. Note that the delta-x value is 0.4. Press key to approximate an area using Midpoint Riemann sums. The program should automatically go into its graphics mode and first graph the function before showing the 20 rectangles which comprise the midpoint area approximation. The program will sound a short beep sound and stop when the area approximation is complete. The two lines of text at the top and bottom of the graphics screen should show "Midpoint Riemann Sum" "Area = -2.5643710118045737" Note where the graph of the function intersects each rectangle. All points of intersection are at the middle of each top or bottom edge of each rectangle. Press either or to return to the Integration Menu and the new bottom line on the screen will repeat the numerical value shown on the graph. The reason for re-displaying the answer in the Integration Menu screen is so you can see the function formula and the limits of integration and all the other integral parameters on one screen. Press or a second time to completely return to the Integration Menu. ANOTHER AREA APPROXIMATION ========================== The second integral approximation we will make is very similar to the one just completed, except we will decrease the number of subintervals from 20 to 10. Press to change the number of subintervals, and when prompted type <1> <0> Note the new value of delta-x = 0.8. Then press key to perform the Trapezoid Rule. The next graph made should now show 10 trapezoids which approximate the signed area between the graph of the function and the X-axis. "Trapezoid Rule" "Area = -2.4099812875238253" Press or twice to return to the Integration Menu. A 3-DIMENSIONAL EXAMPLE OF VOLUME ================================= Our 3rd example continues to use the function 2*SIN(X), but now we are going to approximate the volume of the 3-dimensional solid that is generated when the graph of Y=2*SIN(X) is rotated over the horizontal line Y=0.7. Press to change the number of subintervals, and when prompted type <4> <0> Now the number of subintervals is 40 and the value of delta-x = 0.2. We need to enter the horizontal line as Y=0.7 so press key and when prompted key in <.> <7> You should see the value for the horizontal "Y=C Line" is now 0.7. Then press key to perform the volume calculation using the Disk Method. The next graph made should show 40 cross-sectional disk volume slices which approximate the volume of rotation when the area between the graph of the function and the two vertical lines X=-3 & X=5 and the horizontal line Y=0.7 is rotated over that same horizontal line. The program sounds a short beep when the graph is complete. The top and bottom lines in the graphic screen should show "Disks" "Volume = 52.8697116975071866". After admiring the graph press or two times in a row to return to the Integration Menu. A 3D VOLUME USING CYLINDRICAL SHELLS ==================================== We will keep the same function, but we are going to change the limits of integration and the method. Press and when prompted to enter new lower and upper limits type <0> <5> <2> The interval of integration should now cover the range of x-values between 0 and 2.5. Then press to change the vertical line used for the rotation. When prompted to enter a constant value for X type <-> <1> The vertical line of rotation "X=C Line" should now indicate X = -1. Finally, we will change the number of subintervals to 15. Press and when prompted type <1> <5> Note that delta-X = 0.1666666666666667. Then to perform the method of Cylindrical Shells press The program will draw the graph of the sine function, and then it will show a view of the cross-sectional slices of cylindrical shells (they look like pieces of concentric pipes cut in half) that cover the region between the graph of the function, the X-axis and the two vertical lines X=0 and X=2.5. When this area is rotated over the vertical line X=-1, the resulting volume is generated. The top and bottom text lines on the screen should show "Shells" "Volume = 55.3697761654643364" and you may note the broken vertical line in the graph corresponds to the line of rotation which is specified as X = -1. After admiring the graph press or three times in a row to return to the Main Menu. THE GRAPH/TANGENT/NORMAL TRACE MODES ==================================== When a graph is made, you can enter any one of three graph trace modes to study points along the graph or to visualize the variation in the tangent or normal lines to the graph. Press twice, the first time you should go to the Graph Menu and the second time should cause the graph to be drawn. While looking at the graph press key and you should see a tangent line drawn on the graph, starting at the X- coordinate which is the midpoint of the function's current domain. The coordinates of the current point of tangency are displayed at the bottom of the screen, and the top of the screen shows the equation of the tangent line in y=mx+b form. "Y = 1.9998338161145324*X + 0." "X = 0." "Y = 0." You may press either the left or right cursor arrow keys to cause the tangent line to move either left or right across the graph. As you move the point of tangency and the tangent line you should note the coordinates of the point of tangency at the bottom of the graphics screen get updated, as does the actual equation of the tangent line that appears at the top of the screen. In addition to using the left and right cursor keys you can also use the up and down arrow keys. Just think of these keys as increasing or decreasing X. If you use the arrow keys on your numeric keypad then pressing a shift key in conjunction with these keys causes a larger amount of movement, for each keypress. Try moving the tangent line along the curve by repeatedly pressing the right cursor arrow key with the key. Then move left by using the left arrow key. The SHIFT key only works in conjunction with the numeric keypad arrow keys. After moving the tangent line back and forth, press to switch to showing the normal lines to the graph. Then continue to move the current point back and forth using the cursor keys to view the tracking of the normal lines to the graph. You can press keys or to flip the current line between a tangent and a normal. Next, press to enter a trace mode using single points along the graph. Again, press a left or right arrow key to move the point along the graph. The point's coordinates are displayed at the bottom of the screen. Finally, or to exit from the Trace Modes. Then press or two more times to quit viewing the graph and return to the Main Menu. THE COORDINATE TRACE MODE ========================= When you use YFUNX to graph a function, the program generates the graph and then waits for you to press a key while you are looking at the graph. If the key you press is either the Esc key or the Enter key then you are simply returned immediately to the Graph Menu. If instead, you press key C, you will enter what is called the Coordinate Trace Mode. This is one of the most useful modes of the entire YFUNX program. To demonstrate this mode, we assume you still have the function formula "f(X) = 2*SIN(X)" displayed at the top of the Main Menu display screen. Press key to enter the Graph Menu and press a second time to actually make the graph of the function. The program should sound a short beep when the graph is finished. Now press key and you should be in the Coordinate Trace Mode. You will know when you are in this mode because the bottom of the graphics screen should show the X and Y coordinates of a point that is initially in the exact center of the display screen. Now, using your numeric keypad, press key <3> and you should see the point cursor move away from the origin down into the fourth quadrant. Continue pressing key <3> until the trace point is approximately near the point X=1 and Y=-1. You will probably not be able to hit this exact point, due to the limited resolution of your graphics display screen. Pressing key 3 on the numeric keypad causes the trace point to move in a southeast direction. Pressing keys 8, 2, 6, and 4 would cause movement in the north, south, east, and west directions, corresponding to the direction of the arrows on those keys. Pressing key 7 would cause a movement in the northwest direction, and pressing key 9 would make the movement northeast. Key 1 moves southwest. So the arrangement of the keys on your numeric keypad serves as a convenient way to represent movements in directions corresponding to the sides and corners of the rectangular arrangement of the keys. Pressing key 5 in the center of the numeric keypad causes the cursor to be centered on the graphics screen. Sometimes the trace point is hard to see because it overlaps some other graphic object that is already drawn on the screen. If you have a large 101-key keyboard with separate cursor arrow keys, you can use the extra arrow keys to move the trace point in a direction corresponding to the direction marked on each key. Pressing a SHIFT key in conjunction with one of direction keys causes the trace point to move 5 pixels at a time instead of one pixel at a time. This makes for a little faster movement for longer distances. This SHIFT key feature works only with any of the numeric keypad keys. As you continue to press any cursor key, the coordinate trace mode point cursor should continue to move in the direction corresponding to the key, and more important, the coordinates at the bottom of the screen will continually be updated to correspond to the position of the cursor point you see. Now we are going to try to use the trace point to find one of the x-intercepts of the graph of the function. Use the cursor keys to move the trace point over the point on the X-axis that is just to the right of X=3, but where the graph of the function crosses the X-axis. The true point of intersection should occur where X=PI=3.141592654 and Y=0, but the limited resolution of your display means you will probably not see these exact values displayed for the point's coordinates. But we can help improve matters by zooming in on this part of the graph. ZOOMING IN ON A POINT ===================== Just move the trace point as close as you can to the X-intercept of the function graph and then press the key for the lower case character z The graphics screen window should change and a new graph will be made which encompasses an area that is 1/4 of the previous graphics screen. The new center of this screen will be the old Coordinate Trace Mode point, and you will remain in the Coordinate Trace Mode. Press lower case character z a second time and you will continue to zoom in on that part of the graph near the intercept on the X-axis. Each time you zoom in, a completely new graph is drawn. Now if you move the cursor to the point of intersection you should get about 2 decimal places of accuracy in terms of the displayed X and Y coordinates. Pressing lower case z makes the new graphics window smaller and corresponds to zooming in on a smaller portion of the graph. Pressing upper case Z performs a zoom out operation that makes the size of the XY-plane window larger. You should remember the relation between the size of the letters z and Z to help you decide how to zoom in or out. In either case, the Coordinate Trace Mode point remains as the point of central focus, and in fact this point will be the new center of the new graphics screen after zooming either in or out. Now press the Escape key twice. The first time you exit the Coordinate Trace Mode, and the second time you return to the Graph Menu. Note the range of values for the current XY- plane window X & Y minimums and maximums. While looking at these values, press + and you should see the window min/max values returned to their default values where X ranges between -7 and +7 and Y ranges between -5 and +5. Then press key to make a new graph and you should see the graph has returned back to its original state before we began zooming in. ZOOMING IN USING A BOXED WINDOW =============================== Press key to re-enter the Coordinate Trace Mode. Now use the cursor keys to move the Coordinate Trace Mode point to where it is near the point X=-2 and Y=+2. The placement does not have to be exact. Then press key to mark the current point as an anchor point (either upper or lower case X will do). Whenever you are in the Coordinate Trace Mode and you press key X you mark an anchor point. Now move the cursor in a southeast direction until it is near the point X=+2 and Y=-2. As the cursor moves you should see a rectangle drawn which has the anchor point you marked as its upper left corner. The rectangle which you are defining can be used to zoom in that part of the graphics screen enclosed inside the rectangle. When the lower right corner is near X=+2 and Y=-2, press key (lower or upper case is not relevant with the boxed rectangle) and a new graphics window should be drawn which shows the interior of the rectangle, but this interior now fills the entire graphics screen. The position of the new Coordinate Trace Mode point is in the center of the new graph window, and you remain in the Coordinate Trace Mode with the point's coordinates displayed at the bottom of the screen. After marking an anchor point, but while still defining the zoom-in rectangle, you can press the Escape key to abort both the anchor point and the zoom-in rectangle. However, you remain in the Coordinate Trace Mode. Now press two times to return to the Graph Menu. Once in the Graph Menu press + to put the window back to its default position and size. USING THE LINE DRAWING MODE =========================== Now that you know about the Coordinate Trace Mode and the Tangent Line Mode we are going to try the Line Drawing Mode to manually approximate the tangent line to a graph, at a particular point on the graph. Press key to make the graph of the function 2*SIN(X) and then press key to go into the Coordinate Trace Mode. Use the cursor keys to move the trace point to the top of the peak of the first wave that is in the first quadrant. The point should be approximately X=1.57 and Y=2.0, but the point placement need not be exact. To start the Line Drawing Mode at the current cursor point, press key and you should see a line drawn on the screen through the trace point. The equation of the line, in y=mx+b form, should be at the top of the screen. When you first enter this mode, the line should have an approximate slope of m=1.0. The Coordinate Trace Mode point serves as an anchor point, through which the line is drawn. Now you can use the up and down cursor arrow keys to increase or decrease the slope of the line. The left and right cursor arrow keys can also be used to increase or decrease the slope. Try decreasing the slope of the line. Each keypress causes a change in the angle by about 1 degree, or 5 degrees if you simultaneously press a SHIFT key. This SHIFT key action only works with the numeric keypad cursor keys. Keep decreasing the slope until the line is nearly horizontal. The top point on the sine wave should have a tangent line slope that is approximately 0. Once you are satisfied with your line, press key

to cause a radical change in the line. Pressing key P makes a perpendicular line through the anchor point, i.e., the new line has a perpendicular slope compared to the line slope at the time you press key P. Now press key

a second time and the previous line should be restored. As you increase or decrease the slope of the line, the line may become nearly vertical, and the slope may abruptly change between a large positive number and a large negative number. In fact, the slope is usually calculated to be in the range between -200 and +200, both of which represent nearly vertical lines. That is about all there is to the Line Drawing Mode. If you press either or you will exit the Line Drawing Mode and you can confirm this has happened because the equation of the line at the top of the graphics screen will disappear. However, you will remain in the Coordinate Trace Mode and you should still see the coordinates of the trace point at the bottom of the screen. Press or again, and you will exit the Coordinate Trace Mode and just see the graph. So press or one more time to return to the Graph Menu. MULTIPLE GRAPHS AND FINDING POINTS OF INTERSECTION ================================================== Press key to make a new graph, and after you hear the beep when the graph is complete, press key and the picture will be saved in memory. After seeing a brief message that the graph has been saved in memory, the graph will re-appear. Press once to return to the Graph Menu. The graph of the sine function has been saved and we are now going to change the current function formula to the line: Y=X/2. A hidden feature in the menus of YFUNX is the ability to key in a new function by pressing key K at any time. Once you get past the Main Menu you can key in a new function from any other menu. You should still be in the graph menu. Press to key in a new function formula and the bottom of the screen will clear. When prompted press <2> You should see a new formula at the top of the Graph Menu screen. "f(X) = X/2" Press key to graph the straight line. You should see a line through the origin with slope 1/2. Then press to return to the Graph Menu. The graph we just made was formed on a blank background because the Background Graph should be turned off. Press key to change the Background Graph value to "On". Then press key to make a new graph and as the new graph is made, you should note that the initial graph background is the old sine graph that was saved in memory, and the new line is then graphed on top of the old background graph that was saved. We wish to find the point of intersection of the line and the sine wave that is in the first quadrant, near the point X=2.5 and Y=1.3. Press key to enter the Coordinate Trace Mode. Move the cursor to the point of intersection of the two graphs and read the coordinates at the bottom of the screen. To two decimal places the coordinates should approximate X=2.47 and Y=1.23. Now press two times to return to the Graph Menu, and once there, press to turn the Background Graph "Off", and press to make a new graph which now only shows the line. The sine graph remains saved in the background, until you quit the program, or until you save a new graph which overwrites the existing background graph. Any number of function graphs may be overlayed on top of each other and saved in the background. Now press twice to return to the Main Menu. SOLVING THE EQUATION f(x)=0 =========================== The YFUNX program has a couple of other ways to find the point of intersection of the two graphs Y=X/2 and Y=2*SIN(X). Where X/2=2*SIN(X) is where X/2-2*SIN(X)=0. Press key from the Main Menu and a new menu should appear, the "Solve f(x)=0 Menu". Press to key in a new function, and when prompted, type in <2> <-> <2> <*> <(> <)> The top of the "Solve f(x)=0 Menu" screen should show "f(X) = X/2-2*SIN(X)". We want to solve for the zero's of this function. That is, we want to find where f(X)=0. This menu controls two methods for solving equations of the form f(X)=0. One method is called Newton's Method and the other method is called the Method of Successive Bisections. We will first demonstrate the Method of Successive Bisections. To start this method we need to find two points whose y-coordinates have opposite signs. The first guess point X-coordinate should be X=1 and the corresponding Y-coordinate should be Y=-1.182941969615793. Press key <2> to change the 2nd guess point x-coordinate, and when prompted, key in <4> The Y-coordinate of the 2nd guess point will be calculated for you automatically and it should appear as Y=3.5136049906158565. Now press to start the Bisection Method. You should see the graph of the new function drawn, together with two vertical lines at X=1 and X=4 that extend from the X-axis to the graph of the function. The bottom of the graphics screen should show the coordinates of the next estimate of the solution and its corresponding function value. "x(i)= 2.5" "f = 0.053055711792087" Near the top of the screen you should see a horizontal line that covers the interval on the X-axis from 1 to 4. Press and you should see new values at the bottom of the screen, a new vertical line is drawn from the X-axis at X=1.75 down to the graph of the function, and a new horizontal line is drawn just under the previous horizontal line, but this new horizontal segment covers the left half of the previous one, namely the region between X=1 and X=2.5. The next estimate of the solution and its corresponding function value are displayed as "x(i)= 1.75" "f = -1.0929718937478738" Press again and you should see new values at the bottom of the screen, a new vertical line is drawn from the X-axis at X=2.125 to the graph of the function, and a new horizontal line is drawn which covers the right half of the previously drawn horizontal segment. This new segment covers the region on the X-axis between X=1.75 and X=2.5. The next estimate of the solution and its corresponding function value are displayed as "x(i)= 2.125" "f = -0.638139579636904" Now if you continue to repeatedly press the key you will see successive estimates of the solution, and you should see shorter and shorter horizontal segments drawn near the top of the screen. In fact, these segments become so short as to have a length that is only one screen pixel wide. Eventually these segments appear to shrink to a vertical line coming down the screen. After about 25 more presses of the key, the program will sound a beep and then you will return to the Solve Menu where you should see the message "The probable solution is x = 2.4745767880231142 f(x) = 1.3531774197E-9" f(X) is not exactly 0, but the difference isn't worth arguing about. You can abort the Bisection Method at any time by pressing the Escape key. As with the integration function, the above message appears with all the other solve parameters so you can see the function formula and its solution on one screen. Now press the key to fully return to the Solve Menu. We are going to solve the same equation with the same method, but this time we will turn off the Visual Display. Press key to turn the Visual Display "Off" and then press key to again apply the Bisection Method. This time a table of function values is created and displayed. The midpoints in this table are converging to the solution. The Left X and Right X points bracket the solution, and they also converge to the solution, but the midpoints are better approximations. The function values correspond to the midpoint x-coordinates. +------------------------------------------------------------------------------+ | | | f(X) = X/2-2*SIN(X) | | | | Left X Midpoint X Right X f(x) | | | | 1. 2.5 4. 0.053055711792087 | | 1. 1.75 2.5 -1.0929718937478738| | 1.75 2.125 2.5 -0.638139579636904 | | 2.125 2.3125 2.5 -0.3183874426692379| | 2.3125 2.40625 2.5 -0.1385576144725725| | 2.40625 2.453125 2.5 -0.0441467386005547| | 2.453125 2.4765625 2.5 0.0041155283730079 | | 2.453125 2.46484375 2.4765625 -0.0201016080918502| | 2.46484375 2.470703125 2.4765625 -0.0080143835893924| | 2.470703125 2.4736328125 2.4765625 -0.0019547438334236| | 2.4736328125 2.47509765625 2.4765625 0.0010790656818919 | | 2.4736328125 2.474365234375 2.47509765625 -0.0004381710315145| | 2.474365234375 2.4747314453125 2.47509765625 0.0003203643748343 | | 2.474365234375 2.47454833984375 2.4747314453125 -0.0000589240707524| |2.47454833984375 2.474639892578125 2.4747314453125 0.0001307149670408 | |2.47454833984375 2.4745941162109375 2.474639892578125 0.0000358941518188 | | | | Press Q to quit, or any other key to continue | | | +------------------------------------------------------------------------------+ If you press the key a second screen will show a continuation of the table. But this second screen has found a probable solution, and so the table comes to an end, and so does the Successive Bisections process. +------------------------------------------------------------------------------+ | | | f(X) = X/2-2*SIN(X) | | | | Left X Midpoint X Right X f(x) | | | | 2.47454833984375 2.4745712280273438 2.4745941162109375 -0.0000115152835576 | |2.4745712280273438 2.4745826721191406 2.4745941162109375 0.0000121893531091 | |2.4745712280273438 2.4745769500732422 2.4745826721191406 0.0000003370145202 | |2.4745712280273438 2.474574089050293 2.4745769500732422 -0.0000055891395826 | | 2.474574089050293 2.4745755195617676 2.4745769500732422 -0.0000026260637971 | |2.4745755195617676 2.4745762348175049 2.4745769500732422 -0.000001144524955 | |2.4745762348175049 2.4745765924453735 2.4745769500732422 -0.0000004037552965 | |2.4745765924453735 2.4745767712593079 2.4745769500732422 -0.0000000333704079 | |2.4745767712593079 2.474576860666275 2.4745769500732422 0.0000001518220512 | |2.4745767712593079 2.4745768159627914 2.474576860666275 0.0000000592258204 | |2.4745767712593079 2.4745767936110497 2.4745768159627914 0.0000000129277059 | |2.4745767712593079 2.4745767824351788 2.4745767936110497 -0.0000000102213511 | | | | The probable solution is x = 2.4745767880231142 | | f(x) = 1.3531774197E-9 | | | +------------------------------------------------------------------------------+ Press twice to fully return to the Solve Menu. When the Visual Display is "On" you see the graphical display, and when it is "Off" you get the table of numbers display. Now press key to turn the Visual Display back to "On". APPLYING NEWTON'S METHOD ======================== An alternative to the Bisection Method is Newton's Method. Newton's Method is sometimes simpler to apply because it requires only one starting guess point. Now press to start Newton's Method. You should see the function graph with a tangent line drawn on the graph at the 1st guess point, namely at X=1. Where the tangent line intersects the X-axis determines the next estimate of the solution. You should see two successive X-coordinates and one function value. "x(i)= 1" "f = -1.182941969615793" "x(i+1)= -1.0674588203025551" The two x-coordinates are significant. Where X=1 the tangent line is drawn on the graph, and where X=-1.0674588203025551 the tangent line crosses the X-axis. This crossing point is used to generate the next x-coordinate approximation. Press and this time the point of tangency is at the previous tangent line x-intercept, and we see the tangent line now crosses the X-axis at a point somewhere between X=1 and X=2. "x(i)= -1.0674588203025551" "f = 1.2182257725363438" "x(i+1)= 1.6079925681929923" The function value f corresponds to x(i) and the next estimate is x(i+1). Press and you should see the point of tangency move to X=1.6079925681929923. The x(i+1) point is the x-coordinate where this new tangent line crosses the X-axis. The x-coordinate of this point is between X=3 and X=4, as indicated by x(i+1) below. "x(i)= 1.6079925681929923" "f = -1.1946203150419442" "x(i+1)= 3.6312618904569593" Press six more times in a row, and as you do, note how the tangent line to the graph stabilizes and the point of tangency converges to the value where X is approximately 2.47. The program will beep when it reaches its last estimate. "x(i)= 2.4745768440155073" "f = 0.0000001173326061" "x(i+1)= 2.4745767877810711" and you may note the function value is getting closer to zero, although it is not exactly zero. The two x-coordinates are also close to one another. If you press one more time you will return to the Solve Menu with a final display of the solution value. "The probable solution is x = 2.4745767877810711 f(x) = 8.5182315986E-10" Here the function value displayed is in scientific notation. 8.5182315986E-10 = 0.00000000085182315986 but the process has ended because we have found 9 decimal places of accuracy to the true zero of the function. Newton's Method can terminate when either two successive x-estimates are sufficiently close to one another, or it can end when f(x) is sufficiently close to 0. Press one more time to completely return to the Solve Menu. Now we will again apply Newton's Method, but this time without the graphic display. Press to turn the Visual Display "Off". Then press to apply Newton's Method. You should see the following table of values. +-------------------------------------------------------+ | | | נננ Approx. X נננ נננ f(X) נננ | | 1. -1.182941969615793 | | -1.0674588203025551 1.2182257725363438 | | 1.6079925681929923 -1.1946203150419442 | | 3.6312618904569593 2.7562989837319345 | | 2.4048839690319824 -0.1412654771841863 | | 2.475609307048383 0.0021393611972495 | | 2.4745845875331365 0.0000161568478486 | | 2.4745768440155073 0.0000001173326061 | | | | | | The probable solution is x = 2.4745767877810711 | | f(x) = 8.5182315986E-10 | | | +-------------------------------------------------------+ Press three times in a row to return to the Main Menu. FINDING THE MAX/MIN EXTREMA =========================== Another feature of this program is the ability to automatically find the maxima and minima of a function over a closed interval. We assume the current function is the same as used to demonstrate the solve feature above. The top of the Main Menu screen should show "f(X) = X/2-2*SIN(X)". Press to get to the menu labeled the Extrema (Max/Min) Menu. Press key to set the limits for the search interval. You will be prompted to enter the left X-coordinate and then the right X-coordinate of the search interval. Press <-> <6> <3> The search interval for this example is [-6,3]. The visual search attribute should be turned on by default and the default number of sample points should be 500. Press to begin the search. The program should first graph the function and then it will show a trace point move across the graph, restricted to the search interval. The interval will be subdivided into 500 equally spaced points and the program will determine the absolute extrema of these sampled points. The program beeps when the search ends, and will show two Y-coordinates at the bottom of the graphics screen. m and M correspond to the minimum and maximum Y-coordinates respectively. "Max/min Extrema" "m = -4.4189491248509647" "M = 1.2774302002365305" The value on the left is the minimum Y and the value on the right is the maximum Y. If you look closely at the graph you should also be able to see the two points on the graph that are marked as the extreme points. Note that these are absolute extrema for the function over the closed search interval. There is another local extrema on the graph that the search function does not report. To find that extrema you should further restrict the search interval. Press once and you will return to the Extrema Menu where you should see the complete coordinates of the two points that have been found. The top point represents the maximum and the bottom point represents the minimum. Both the X and Y coordinates are given, even though the max/min values apply only to the Y- coordinates. "X = -1.32 (M) Maximum Y = 1.2774302002365305 X = -4.974 (m) minimum Y = -4.4189491248509647" Press again to completely return to the Extrema Menu. For the second extrema example we will turn off the visual display attribute. Press to turn off the visual display option. The program will perform the search without going into its graphics mode. Press to begin the search in text mode. You should note a small symbol on the screen that looks like it is spinning while the search continues. When the search ends the program will sound a short beep and you should see the same values returned as shown above. Press two times to return to the Main Menu. THE DISCRETE VERSUS CONNECTED GRAPH TYPES ========================================= When graphing any function you can have the program make the plot of the graph in one of two ways. The default graph type is called discrete and this means the individual points on the graph are plotted one by one with no particular connection between one point and the next. To see this attribute in a slightly emphasized form enter the function f(X) = 4*COS(2*X). Press to key in a new function then type <4> <*> <0> <(> <2> <*> <)> The status line at the top of the screen should show "f(X) = 4*COS(2*X)" Press twice to go to the Graph Menu and graph the new function. If you look carefully at the graph you will see a noticeable amount of space between one point and the next. The graph is made up of a series of discrete points. We will now change the graph type to the connected type. Press to return to the Graph Menu and once there press to change the graph type. You should see the graph type appear as "Connected" The next graph will be made by connecting each individual dot to the next dot with a solid line. Usually the connecting line segments are so short they are not noticeable and the function graph appears as a smooth curve. Press to see the new graph. You should notice how this graph looks more solid than the discrete graph. Sometimes it is more desirable to view a continuous graph in its connected form. But there are other times when a graph is more properly made by using the discrete type. As another example, we are going to enter the normal tangent function f(X) = TAN(X). Press to key in a new function. When prompted type <(> <)> The status line should show "f(X) = TAN(X)". Press to graph the tangent function. What appear as vertical asypmtotes are actually an incorrect depiction of the graph. The more proper way to view this function is to set the graph type to discrete. To see this press to get to the Graph Menu and then press to change the graph type to "Discrete". Now press to make a new graph. This new graph is more accurate, but you have to imagine there are vertical asymptotes which separate the distinct branches of the graph. In fact, this graph may be more difficult to read because your mind must fill in the dots where the vertical asymptotes make the graph look very thin. For functions which are piecewise continuous with vertical asymptotes the discrete graph type gives the most accurate depiction of the graph. Press once to return to the Graph Menu. GRAPHING WITH A PARAMETER ========================= The next feature of the YFUNX program we will demonstrate involves the use of what is called a graph parameter. For this program the graph parameter is an auxiliary variable that is denoted by the letter P. By controlling the use of P you can make a series of related graphs. Press

to get to the Parameter Menu from the Graph Menu. We will first demonstrate the use of P by keying in the function f(X) = P*SIN(X). Press to begin keying in a new function and when prompted type

<*> <(> <)> The status line at the top of the screen should show "f(X) = P*SIN(X)" The Parameter Menu shows the starting and ending values for P. The delta-P value gives the spacing between P-values over this interval and the number of P samples tells how many times the parameter P will be sampled over the given interval. The number of P-values and the delta-P value go together. Usually you can ignore the delta-P value and just enter the number of samples that you want. As each of these two quantities are edited the other quantity is automatically changed. The number of samples will usually be between 5 and 20. Press to change the starting and ending values of P and when prompted type <1> <5> The new P domain interval is defined starting at 1 and ending at 5. Next press and when prompted type <8> You should now see the number of P samples is 8 and the delta-P value is 0.5. The use of the parameter should already be turned on so press to make a graph using the P parameter. You should see a series of 9 graphs, all of which are sine waves with the same period, but the different graphs have different amplitudes. The smallest amplitude is 1 (P=1) and the largest amplitude is 5 (P=5). The other seven amplitudes are between 1 and 5 with a spacing of 0.5. Press once to return to the Graph Menu. We will now enter the function f(X) = COS(X) + P. Press and when prompted type <(> <)> <+>

Press

to get to the Parameter Menu from the Graph Menu. Once in the Parameter Menu press to change the starting and ending P-values and when prompted type <-> <3> <3> We will leave the number of parameter samples at 8. Press to make the graph. You should see a series of 9 cosine waves stacked one on top of the other. By varying the range of the parameter P and the number of parameter samples you can show any series of related graphs. The above two examples illustrate using the parameter to vary amplitudes and vertical shifts in a graph. By using f(X-P) for any function f you could show variations by horizontal shifts. You can use the P variable anywhere in a function formula to study how changing P varies the graph of the function. The variable P can appear in more than one place in your function formula, but there is only one parameter. This parameter is always denoted by P. Except for showing a series of related graphs, P is not intended for any other use within this version of YFUNX. Unless P appears at least once in your function formula, P will be ignored. Press

to return to the Parameter Menu and turn the use of the parameter off. Now whenever the above f(X) function gets evaluated P will act as a constant whose value is the starting domain value. Then press two more times to return to the Main Menu. MAKING A TABLE OF FUNCTION VALUES ================================= The most mundane feature of YFUNX is the ability to make a table of function values. This is not a significant feature, but since it is a Main Menu item we will give one example of its use. Actually, there are times when it is desirable to see a table of function values. But perhaps most users will only use this feature as a check on whether they have correctly entered a long complicated formula. As an example, consider the sum Y = X + (2*X)/3 + (4*X)/5. This formula can be entered without any parentheses or spaces. In that case it takes on the difficult to read form: Y = X+2*X/3+4*X/5. From the Main Menu press and when prompted, type in the formula as <+> <2> <*> <3> <+> <4> <*> <5> The top line in the Main Menu screen should show: "f(X) = X+2*X/3+4*X/5". Now press and you should see the "Table of Values Menu". To make a table with the default values, press and when prompted, enter the starting value as X=0. Type <0> and the program should make a table like the one shown below. +--------------------------------------------------+ | | | נננ x נננ נננ f(x) נננ | | | | 0. 0. | | 1. 2.4666666666666667 | | 2. 4.9333333333333333 | | 3. 7.4 | | 4. 9.8666666666666667 | | 5. 12.3333333333333333 | | 6. 14.8 | | 7. 17.2666666666666667 | | 8. 19.7333333333333333 | | 9. 22.2 | | 10. 24.6666666666666667 | | 11. 27.1333333333333333 | | 12. 29.6 | | 13. 32.0666666666666667 | | 14. 34.5333333333333333 | | 15. 37. | | 16. 39.4666666666666667 | | | +--------------------------------------------------+ There are two values that you can immediately check to verify the entered formula is really X + (2*X)/3 + (4*X)/5. When X=0 Y=0 and when X=15 Y=37. The table is made by starting with the X-value you give, and X is incremented line by line, using the value of delta-X. The delta-X value can be a negative value if you want to make a table with values of X that decrease. To evaluate a function at only one exact point make delta-X equal to 0. You make a new table every time you change the starting value. Now press or and you should return to the Main Menu. CONCLUSION ========== This concludes the YFUNX program tutorial. If you haven't done so already, you can now read the help information contained within each main program menu item. Most of the basic features have been covered here, but you will gain more insight by reading all the help information available to you. If after all this you still have questions, you can contact the author at the address given below. Press + to quit and exit from the entire YFUNX program. The YFUNX program is periodically updated to make improvements, add new features, (and sometimes to correct bugs!). You may also wish to contact the author to check if you have the latest version of the program. The author also invites your comments about how you liked the program and will consider any suggestions you may wish to offer for making the program even more useful. OTHER PROGRAMS ============== If you enjoy using the YFUNX program you may be interested to know there is a whole suite of mathematical programs made by the author of YFUNX. These programs are intended to help motivate an interest in mathematics and computer science. Some of the titles of these programs and a brief description of each is given below. 1. MATRIX - a program that teaches row operations with matrices. Features include fraction mode, decimal mode, solves linear systems, inverses, determinants, sets of basis vectors, eigenvectors and eigenvalues, Gram-Schmidt orthogonalization, and the simplex algorithm. 2. YFUNX - a program for graphing and analyzing functions in rectangular form, Y=F(X). Includes coordinate trace and tangent/normal line modes, zooming in and out, scalable axes, graph parameter variable. Numerical integration features standard algorithms plus Gaussian Quadrature and the Romberg algorithm. Animation features include plane areas, plane arc length, 3D volumes (disks & cylindrical shells) and 3D surface areas. Newton's method and the method of successive bisections are for solving F(X)=0. Automatically finds maximum/minimum extrema. All algorithms may be demonstrated in either graphics or text modes. 3. POLAR - a program for graphing and analyzing functions in polar form, R=F(@) or R^2=F(@). Similar to YFUNX, includes coordinate trace and tangent/normal line modes, zooming in and out, scalable axes, and a graph parameter variable. Numerical integration for polar areas and arc length. Automatically finds maximum/minimum extrema over any section of a curve. 4. PARAM - a program for graphing and analyzing functions in parametric form, X=F(T) and Y=G(T). Similar to YFUNX, includes coordinate trace and tangent/normal line modes, zooming in and out, scalable axes, and a graph parameter variable. Numerical integration calculates plane areas and arc length. Automatically finds maximum/minimum extrema over any section of a curve. 5. POLPM - a program for graphing and analyzing functions in polar coordinates, but that have been parametrized, say R=F(T) and @=G(T). Similar to the POLAR and PARAM programs, this program includes coordinate trace and tangent/normal line modes, zooming in and out, scalable axes, and a graph parameter variable. Numerical integration for plane areas and arc length. Automatically finds maximum/minimum extrema over any section of a curve. 6. DIFEQ - a program related to 1st order differential equations. Includes graphing the direction field and solves initial value problems using Euler methods and a 4th order Runge-Kutta method. Includes coordinate trace mode, zooming in and out, and scalable axes. Algorithms may be demonstrated in either graphics or text modes. 7. CURVE3D - a program for making 3D graphs of curves given in the parametric form X=f(t), Y=g(t), and Z=h(t). The resulting curve may be viewed from any position, and the drawing is a true-perspective 3D picture. 8. SURF3D - a program to graph 3-dimensional surfaces of the form Z=F(X,Y). The resulting surface may be viewed from any position, and the drawing is a true-perspective 3D picture. The surface may be displayed using lines of constant x, or constant y, or a fishnet. Included is a hidden line algorithm for more realistic pictures. 9. CFIT - a program which performs curve fits to data. Includes linear regression for linear, exponential, logarithmic, and power functions. Graphs scatter diagrams and the fitted function curves and performs a statistical analysis, including an automatic best fit selection. Data may be saved to or read from disk files. 10. GALTON - simulates coin tossing experiments related to probabilities and demonstrates graphically how the binomial distribution is related to the standard normal Gaussian bell-shaped curve. Also compares stack counts with the numbers generated in Pascal's Triangle. Either coins or ping-pong balls may be used in simulated experiments. Variable number of rows of pegs, variable number of objects, variable left-right probability for generating skewed distributions. Includes a single-step mode under full user control. 11. BUFFON - simulates needle dropping experiments related to probabilities used to approximate the number Pi. Needles are randomly dropped on a grid of equally spaced parallel lines. The length of each needle is 1/2 that of the distance between the lines. After dropping a large number of needles a count is made of the needles which cross a line. Most needles do not touch or cross any line, but the ratio of the total number of needles dropped divided by the number of needles which cross a line approximates Pi. 12. PROPC - a symbolic logic program that calculates truth tables, analyzes tautologies, parses infix formulas and displays their Polish notation form, and generates Karnaugh maps from either tables or formulas. 13. RPNDEMO - a program which simulates how a calculator with RPN logic works. This program includes its own language and is similar in power to the HP-41 calculator. Programs may be animated to show the internal workings of the machine. Can also be used to teach assembly language concepts. 14. CALC - a reverse Polish logic calculator that operates on 5 data types. Included are real and complex numbers, fractions, binary integers and polynomials. Special features include factoring integers and polynomials, analyzing repeating decimals and working with continued fractions. 15. LOAN - a finance program that handles the two standard cases of compound interest. Uses the 5 standard financial variables n i PV PMT FV found on most financial calculators. Can determine payment schedules for loans and annuities and can print amortization schedules for loans and interest earning schedules for lump sums and periodic payments. 16. FCARD - simple flash card type of program that can be used to memorize any simple series of facts, with one item per line of text. Items can be presented in a random order with timing if desired. 17. THANOI - a game known as the Towers of Hanoi. The game solution uses a recursive algorithm and the purpose of the program is to demonstrate the validity and simplicity of a recursive solution to a complex problem that would otherwise overwhelm a normal human being. 18. TRIANGLE - a simple program which solves triangle problems in which one is given 3 facts about a triangle and must solve for all the remaining parts. Handles all 19 cases of triangle inputs and includes the Law of Cosines and the ambiguous case of the Law of Sines. Can automatically determine when two valid triangle solutions exist. Draws all triangle solutions to scale on a graphics screen and computes the perimeter and and the area in addition to finding and labeling all the sides and angles. 19. EXPMCON - a utility type of program that works with the above MATRIX program and the commercial scientific word processor called EXP. This program converts MATRIX files from an ASCII format to the EXP format. 20. BMPLOT - a utility program that makes high resolution monochrome bitmap function plots, identical to the kinds of graphs made by the programs YFUNX, POLAR, PARAM, and POLPM. The bitmaps may be read into other programs such as paint or drawing or desktop publishing programs which can be used to add labels and titles. The monochrome bitmaps may be of any size or resolution so the output is compatible with virtually every printer and/or graphics environment. The file formats supported include PCX, TIFF, and BMP. The HP-GL/2 plotter language is an optional output to either a file or any HP-compatible plotter or PCL 5 LaserJet compatible printer. 21. XPRES - a program which computes integers with up to 20,000 digits per integer. This RPN calculator is useful for computing exact values of factorials, permutations, combinations, and powers of integers. For example, you can compute the exact value of numbers like 1000! or the exact value of 2 raised to the 5,000th power. Integers may be saved to or read from ASCII text disk files. 22. TURING - a program which simulates the operation of a Turing Machine which is an abstract model of a primitive digital computer. In fact, the model is fundamental to all digital (logical) computations. Such a machine was conceived by the British mathematician Alan Turing in 1935, long before digital computers became established. Turing also worked on machines to break codes used by the German Enigma spy machine in World War II. Three sample demonstration programs are included. 23. PTRIPLE - a program which generates and tests Pythagorean Triples. Three numbers, say a, b, c are a Pythagorean Triple if a^2 + b^2 = c^2. If the GCF among a, b,and c is 1 the triple is called primitive. Every non-primitive triple is a multiple of a primtive triple. This program works with both general and primitive triples and can make ranges of tables of triples in ASCII text files. For more information about any of these programs you may contact the author. John Kennedy Voice Phone/Messages any time of day or Mathematics Department night: (310) 450-5150 Extension 9721. Santa Monica College 1900 Pico Blvd. Internet E-Mail: jkennedy@netcon.smc.edu Santa Monica, CA 90405 U.S.A.

---

E-Mail Fredric L. Rice / The Skeptic Tank