Plotting Complex Data in Mathcad

Plotting Complex Data in Mathcad

Watch out for complex numbers in your data, which can not be plotted in Mathcad. Imaginary parts in your numbers leads to either incomplete graphs or errors instead of plots. To work with complex numbers, you can plot the real and imaginary parts of your numbers separately, or reframe your data to calculate only the real part before plotting.

2D Plots

Mathcad 2D plots skip numbers that have an imaginary part. Use the data shown in Figure 1 as an example.

View the plotted data in Figure 2. Notice there is a break in the line and the point at x = 3 is missing.

You can separate the real and imaginary parts before plotting using Mathcad's Re (returns the real part of a complex number) and Im (returns the imaginary part of a complex number) functions as shown in Figure 3.

Alternately, you can make the numbers real by taking the magnitude. For example, plotting the output of an FFT often produces an unexpected plot since most of the values have a complex part As shown in Figure 4. Note the use of the vectorize operator [Ctrl] [-] to apply the absolute value operator on an element-by-element basis.

Note the complex data shown in Figure 5, and the plotted data in Figure 6. If all data is complex, you see an error rather than a plot.

3D Plots

Mathcad 3D plots ignore the imaginary part of any data and plot only the real part. So again, the two components must be separated for complex-valued inputs. Input a complex function as shown in Figure 7.

The real part of the input is shown in Figure 8 and the imaginary part is shown in Figure 9.

The matrix input to plotting routines is shown in Figure 10.

Plot both the real and imaginary parts as contours as shown in Figures 11 and 12.

Learn more with other tutorials...

Using Multiple Representations to Explore Mathematics with Mathcad 15.0
Creating a Box Plot with Mathcad Prime 1.0
  • Creating a Box Plot with Mathcad Prime 1.0

  • |
  • 1511 Views
  • |
  • Introductory Level
  • |
  • This brief video illustrates how to use Mathcad Prime 1.0 to make a visual comparison of two data sets using a box-and-whisker plot.
Enhancing Student Learning via Mathcad 15.0's Live Mathematical Capabilities
Want more? Get more from PTC University!

Looking for PTC Mathcad Training?

Whether you're looking for specific training courses, or a personalized corporate learning program that meets your training schedule and budget requirements, PTC University can help you boost your productivity.
Contact us today   
Replay video? Resume video