×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • 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.

Students Click Here

"IF" function with undefined "OTHERWISE" item?

"IF" function with undefined "OTHERWISE" item?

"IF" function with undefined "OTHERWISE" item?

(OP)
Hi,
Please, could you help me? I have problem with "IF" function. I have function named "f1" and "f2".
f1:=0..10
f2:=0..10
Sum of these function cannot be greater that 10. If the sum is greater, then function is undefined.

I tried do that by the help of the "IF" function.
if(f1+f2<10,f1+f2,0)
But there is "OTHERWISE" item. I use "0", but would like to use "UNDEFINED", or something like that.

It is possible to do that?

Thanks
Replies continue below

Recommended for you

RE: "IF" function with undefined "OTHERWISE" item?

But the funcion won't work because you can't compare the results of adding two range variables to a scalar.  Try creating a vector and comparing each element.

RE: "IF" function with undefined "OTHERWISE" item?

What you may be looking for is NaN (no quotes), which will define a result as Not a Number.


Peter

RE: "IF" function with undefined "OTHERWISE" item?

Bizcoz,
Unfortunately you don't have what you think you have.
As written, what you have is two range variables - these are implied for loops.

You can assign NaN (Not a Number) to a result to indicate undefined.

I presume you are doing 'numeric' calculations rather than fancy formula manipulation (symbols).

f1(a):=a
f2(b):=b
[f1, f2 not really needed]

F3(a,b):=if(a+b>10,NaN,a+b)

Philip
Stick a work sheet on http://collab.mathsoft.com/~Mathcad2000 for more replies

RE: "IF" function with undefined "OTHERWISE" item?

One possibility would be to set the "undefined" value to something out of range, then manually set your z axis so this range is not shown.  For instance in your plot on the upper left:  set the undefined value to be -1 (rather than 0), then left click the graph, select properties, uncheck auto scale z axis, then set the z axis limits to 0 and 10.

Peter

RE: "IF" function with undefined "OTHERWISE" item?

If you save as V11 format (.mcd) then more folk can read it.

There are still a large community who are sticking at V11 until V14/15 becomes more stable and efficient.

V14 is good for pro/e integration but still has a couple of rough edges for those using symbolics [has new MuPad engine].

Philip

RE: "IF" function with undefined "OTHERWISE" item?

I'm getting a set of plots in V11.

What am I looking for that isn't working?

 

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.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close