12.07.2015 Views

Learning Guide Learning Guide

Learning Guide Learning Guide

Learning Guide Learning Guide

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.2 Solving Numerically: fsolve • 53{x = RootOf(_Z 5 − 2 _Z + 3, index = 1)},{x = RootOf(_Z 5 − 2 _Z + 3, index = 2)},{x = RootOf(_Z 5 − 2 _Z + 3, index = 3)},{x = RootOf(_Z 5 − 2 _Z + 3, index = 4)},{x = RootOf(_Z 5 − 2 _Z + 3, index = 5)}RootOf(expr) is a placeholder for all the roots of expr. This indicatesthat x is a root of the polynomial z 5 − 2z + 3, while the index parameternumbers and orders the solutions. This can be useful if your algebra is overa field different from the complex numbers. By using the evalf command,you obtain an explicit form of the complex roots.> evalf(%);{x = 0.9585321812 + 0.4984277790 I},{x = −0.2467292569 + 1.320816347 I},{x = −1.423605849},{x = −0.2467292569 − 1.320816347 I},{x = 0.9585321812 − 0.4984277790 I}A general expression for the roots of degree five polynomials in termsof radicals does not exist.3.2 Solving Numerically: fsolveThe fsolve command is the numeric equivalent of solve. The fsolvecommand finds the roots of the equation(s) by using a variation of Newton’smethod, producing approximate (floating-point) solutions.> fsolve({cos(x)-x = 0}, {x});{x = 0.7390851332}For a general equation, fsolve searches for a single real root. For apolynomial, however, it looks for all real roots.> poly :=3*x^4 - 16*x^3 - 3*x^2 + 13*x + 16;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!