April 2008
Complex Results in Mathcad
by Mathcad Staff

In Mathcad, certain calculations may result in complex numbers. A complex number in Mathcad is indicated by an "i" following the number. A common example is finding the square root of a negative number. You can calculate this with the square root operator or the exponentiation operator as shown below:




In fact, using the exponentiation operator to find the nth root of a negative number often returns a complex solution, even though a real solution may be present. Consider the cube root of -27:



even though



Principal Value


When there are multiple roots, as is the case here, the exponentiation operator returns the principal value, that is the value with the smallest positive angle with respect to the positive real axis in the complex plane.


Note that the nth root operator always defaults to the positive root, if one is available. (Note the nth root operator is on the Calculator toolbar or type [Ctrl]] [\].



If there is no real root, the nth root operator defaults to the principal value.


arg Function


Obviously, the principal value need not be the positive root. Mathcad's arg function can be used to validate this assertion.



returns the principal argument of z between -p and p, including p.





whereas



To find all three solutions, including the positive root, you can solve for the roots symbolically.  First, set up an equation to solve using any variable and the Boolean equality from the Boolean toolbar or by typing [Ctrl] =



Next, use the solve keyword from the Symbolic toolbar to find the roots.



Note that Mathcad displays all values simultaneously, both real and complex.


It is also possible to find these roots numerically, using the polyroots function.






Click to download Mathcad file
. (Mathcad 11)


Was this article helpful? Let us know.









[PRINTER FRIENDLY VERSION]
HOME

Key Enhancements for Pro/ENGINEER Wildfire 4.0
PTC Updates
Tips of the Month
Mathcad Methods
Knowledge Base Exclusive
Webcasts & Events
Building The Blizzard: A Student Robotics Team Makes its Mark
Finding the Values of Steam Properties with Mathcad

Contact PTC | Privacy Policy | PTC Express Archive | Subscribe | Edit Profile

  PTC, 140 Kendrick Street, Needham, MA 02494 USA