cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

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

ptc-4237493
1-Visitor

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

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?

ACCEPTED SOLUTION

Accepted Solutions

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?

View solution in original post

8 REPLIES 8

Hello!

Please, attach your Mathcad worksheet.

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?

Need a screenshot showing the problem.

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?

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

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

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

I've found the source of the problem thanks

Announcements

Top Tags