Contact US

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

error: value has units but unitless

error: value has units but unitless

error: value has units but unitless

I strated learning MATHCAD few days back and started first design worksheet as attached. But i couldnt resolve the error: This value has units:Unitless, but must have units:Pressure..
Iam getting the abov eerror in the program. can someone help me to resolve the error..


RE: error: value has units but unitless

There is no file attached!

RE: error: value has units but unitless

If I want to use compound if statement(conditional branching), how can I assign KLr (calculate max kl/r in the if statement)

Thanks once again for the help..

RE: error: value has units but unitless

I think the most natural way to fix the problem is to use "otherwise" statements.

In Mathcad a program is only allowed to return values of equal dimensions for all cases. E.g. you can't write a function which returns a length, if the argument is 1 and an area if the argument is 2. The way you have written your routine it may happen, that the line which assigns klr is the last line evaluated and so klr would be returned. klr is unitless and the other possible return values are of dimension pressure and that doesn't work. Using otherwise statements makes it clear to Mathcad that all cases are covered and klr will never be a return value. Its also good habit to use explicit return statements.

See the attached file for a few ways to handle the situation, also covering your question about the assignment of klr in case of the nested if functions, but I in no way would recommend using that confusing display.

RE: error: value has units but unitless

Thanks for your help..
I really liked the way you explained different case scenarios...

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


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