Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

[Programming] This values can not be compared 1

Status
Not open for further replies.

rrozz

Chemical
Jul 2, 2011
9
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.
 
Replies continue below

Recommended for you

Can you use Mathcad's "re" function applied to your array to extract the real pars?
 
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?
 
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.
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.

I can't load your example because I have Mathcad 13.
 
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
 
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?

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
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.
 
 http://files.engineering.com/getfile.aspx?folder=4f6dedb6-ea25-426d-81f1-65a869bf0fed&file=Help_needed2.xmcd
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?

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
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.

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
Thanks for your help.

I've fixed the problem on my own.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor