


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A lab assignment for a mathematics course where students are required to use mathematica to answer various mathematical questions. The assignment includes instructions on how to create print statements, define piecewise functions, and use the bisection method to find roots. Students are also encouraged to use mathematica's features to help with the calculations and to submit their work in a mathematica notebook file.
Typology: Lab Reports
1 / 4
This page cannot be seen from the preview
Don't miss anything!
MATHS 159 Lab 9
This lab is due on Monday, November 16, 2009. For this lab, please find at least one partner from your section to work with – your group’s work should be turned in by only one member of the group, designated as the group leader. Using Mathematica, answer each of the questions below. Include all of your work for this lab, including written responses in single Mathematica notebook file, with answers to each question clearly marked (to help with this, use the formatting ideas we talked about in class). Whenever possible, to save time and do less hand calculation, use Mathematica’s features to help with these questions. Be as neat and complete as possible. Save this Mathematica file as LastnameFirstname15900XLab9.nb , where 00X is chosen to be 001 or 002, as appropriate to the section in which you are enrolled, using your group leader’s name. The group leader is responsible for turning in the assignment file with names of all members of the group written in the file and should send everybody in the group a copy of the file. Your group’s Mathematica file should also be emailed to our class Graduate Assistant, Priyanka Bhatlapenumarthi at bhrrpriyanka@gmail.com.
same as theirs! (Hint: Look up TraditionalForm in the Help file.)
RealOnly
. In Mathematica 7.0 this package is obsolete, so if you load it, Mathematica will warn you it is no longer being used.(a) Let f1[x]=x^(1/3). Using Mathematica, find each of the following: f1[1], f1[-1], f1’[x], f1’[1], and f1’[-1]. Then graph f1[x] and f1’[x] on the x-interval [-3,3]. What do you notice?
(b) One way to fix the “problem” with the cube root function in Mathematica is to use a piecewise definition for the function. Define f2[x] with the following commands:
f2[x_]:= x^(1/3) /; x > 0 f2[x_]:= -(-x)^(1/3) /; x < 0
Repeat part (a). Is there any improvement?
(c) Using commands such as If, Which, or Switch, create a cube root function r[x] that works the way the cube root is supposed to work, i.e. Mathematica can find r[1], r[-1], and plot both r[x] and r’[x] correctly.
(d) Repeat part (c) for f[x]=(Abs[x]-2)^(1/3). You should get these graphs for y = f[x] and y = f’[x]:
(e) Repeat part (d) with the following change. Instead of being given the value of n (i.e., how many times to repeat the process), you are only given the allowable error (and a maximum number of bisections to make). That is, given the error tolerance, you must continue using the bisection method until you are certain that the approximation of x_n is accurate to the actual root to within the error tolerance or you have completed the maximum number of bisections without achieving the desired accuracy. Make your program only print out the final interval and final approximation. Test your program with n = 50 and error tolerance = 0.0001. How does the output of this program compare to that in part (b) and (c)?