MATH/CMSC 206 - Introduction to Matlab

Announcements Syllabus Tutorial Projects Submitting

Answers to Self-Test

1. First, use "solve" to solve the following equation symbolically: sin(x) = .5. Note that MATLAB finds two solutions!

syms x
solve(sin(x) - .5)
 
ans =
 
     pi/6
 (5*pi)/6
 

2. Now try to use fzero to solve this same equation numerically. See if you can find "initial estimates" that will yield each of the two solutions you found in part 1.

fzero(@(x) sin(x) - .5, 1)
fzero(@(x) sin(x) - .5, 3)
ans =

    0.5236


ans =

    2.6180

3. Which solutions are more precise, those found symbolically, or those found numerically?

Typically symbolic solutions are more precise, since they do not involve rounding answers. Numerical solutions are almost always an approximation.

4. Which can be used to solve a wider spectrum of problems: symbolic methods or numerical methods?

Numerical solutions can solve problems that are very difficult if not impossible to solve symbolically.