Skip to main content
1-Visitor
October 26, 2011
Solved

Why does Mathcad return a complex number instead of an integer?

  • October 26, 2011
  • 3 replies
  • 5170 views

Hi all. I have a model that calculates heat transfer coefficient. It is supposed to and does most of the time, return a numerical value (an integer) for the heat transfer coefficient. However, sometimes it will return a complex number, e.g. 20 + 5i, instead of an integer. What does i stand for in Mathcad and how can I get the model to return an integer?

Best answer by Fred_Kohlhepp

Delali Dei wrote:

Hi all. I have a model that calculates heat transfer coefficient. It is supposed to and does most of the time, return a numerical value (an integer) for the heat transfer coefficient. However, sometimes it will return a complex number, e.g. 20 + 5i, instead of an integer. What does i stand for in Mathcad and how can I get the model to return an integer?

As you have surmised, i is the square root of -1, your result is complex.

Two questions:

  1. Why an integer?
  2. Can you post just the equation that results in the complex number?

3 replies

24-Ruby III
October 26, 2011

Hello!

Please, attach your Mathcad worksheet.

1-Visitor
October 26, 2011

Sorry I can't attach the Mathcad worksheet as it contains confidential information but is there any information I can give you which will help?

24-Ruby III
October 26, 2011

Need a screenshot showing the problem.

23-Emerald I
October 26, 2011

Delali Dei wrote:

Hi all. I have a model that calculates heat transfer coefficient. It is supposed to and does most of the time, return a numerical value (an integer) for the heat transfer coefficient. However, sometimes it will return a complex number, e.g. 20 + 5i, instead of an integer. What does i stand for in Mathcad and how can I get the model to return an integer?

As you have surmised, i is the square root of -1, your result is complex.

Two questions:

  1. Why an integer?
  2. Can you post just the equation that results in the complex number?
24-Ruby IV
October 26, 2011

Delali Dei wrote:

Hi all. I have a model that calculates heat transfer coefficient. It is supposed to and does most of the time, return a numerical value (an integer) for the heat transfer coefficient.

Why integer!?

It is a real value - see http://en.wikipedia.org/wiki/Heat_transfer_coefficient

23-Emerald I
October 26, 2011

I agree it should be real. But it shouldn't have to be an integer!

24-Ruby IV
October 26, 2011

Fred Kohlhepp wrote:

I agree it should be real. But it shouldn't have to be an integer!

Somtime it can by integer, by the rounding for example

In Mathcad MM we can switch off the calculation with complex numbers.

In this case we get not a complex number but an erroe message and can trace this error