×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# [Programming] This values can not be compared

## [Programming] This values can not be compared

(OP)
I've got a program that defines d.nom[i if W.p[i < 0,02 and if u.w2[i > 2m/s.

The values W.p cannot be compared with 0,02... that is what mathcad responds with.

I checked that the problem could be with the array of W.p`, cos it contains the complex numbers.

Does anyone know how to create a function that substracts array as so to have only REAL numbers in the final array? By the way, the complex numbers are not placed in the array one after another so any substract can not be used.

### RE: [Programming] This values can not be compared

Can you use Mathcad's "re" function applied to your array to extract the real pars?

### RE: [Programming] This values can not be compared

(OP)
I didn't try it as I've read that it extract only the real parts from a complex, whereas I need to extract all the complex values from the array, which contain both the real and the complex numbers.

Thanks for a prompt answer anyways, any other suggestions?

### RE: [Programming] This values can not be compared

If you can find the real parts, then you have the imaginary parts as well, don't you?

### RE: [Programming] This values can not be compared

#### Quote:

Does anyone know how to create a function that substracts array as so to have only REAL numbers in the final array?
Why not IFRs suggestion?  You can use:

MR:=Re(M) and use the vectorize operator _ to make it apply to each element in matrix M.

#### Quote:

I didn't try it as I've read that it extract only the real parts from a complex, whereas I need to extract all the complex values from the array, which contain both the real and the complex numbers.
If you want the imaginary part, use Im instead of Re.

### RE: [Programming] This values can not be compared

I got that message in a program last week because I was trying to compare a value with units to a number (200 psig > 100 is undefined).

I didn't open your sheet, but that was the fix for that message in one of my programs.

David

### RE: [Programming] This values can not be compared

Where's the rest of the sheet?  Your sheet only contains the definition of d.nom'.  There's nothing that defines d.nom', or W.p[i, or u.w2'[i

Is this for school?  How do you expect to get help by noly providing a tiny fraction of the problem?

### RE: [Programming] This values can not be compared

(OP)
Well,
I can of course give you all my stuff, but it has 80 pages in Mathcad. The problem concerns creating a program to select proper heat exchanger from heat exchangers' standard.

All the data for this program is located in excel or come from excel and has been converted a couple of times in Mathcad. There are 10 documents in excel with different data for this project. So there is why i don't have defined rest of variables.

I will copy those final data needed for this program and enclose here.

I will try with Re function afterwards.

### RE: [Programming] This values can not be compared

You have yet to describe what you really want to do with the complex quantities.  What's the significance?  Do you want to zero out the imaginary parts?  Do you want the absolute magnitude of the complex values?  Do you want to zero out the entire value?  Just what do you want to do ?

Obviously, you cannot directly compare a complex value to a real value.

Why are there complex values at all?

### RE: [Programming] This values can not be compared

There appears to be some other problems in your program, since there doesn't appear to be any difference between the input vector and the output vector if the complex values are zero'd out.

### RE: [Programming] This values can not be compared

(OP)

I've fixed the problem on my own.

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!