×
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

Inserting units into a range variable
2

Inserting units into a range variable

Inserting units into a range variable

(OP)
I am using Mathcad 8.

I am trying to calculate a cylinder's mass as both diameter and length change.

I have defined the density as rho:= 7900 kg m-3 by using Insert, Unit from the toolbar.

I have defined i:=1..8 and j:=1..9.

I have defined the diameter and length as range variables:

d[i:=0.020, 0.022, 0.025, 0.030, 0.040, 0.050, 0.075, 0.100

len[j:=0.002, 0.004, 0.007, 0.012, 0.020, 0.030, 0.050, 0.075, 0.100

I have defined mass[i,j:= π/4*d[i2*rho*len[j

The calculation provides a matrix of i rows and j columns with the correct numbers, but the units are kg/m3 because d and len do not have units assigned.  I tried to insert the units in the defining equations and the mass equation, but I don't seem to know the proper syntax.

All help is appreciated.

Regards,

Cory

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips Fora.

Replies continue below

Recommended for you

RE: Inserting units into a range variable

Cory,

A couple of possibilities ....

1.  define the units with each entry i.e. 0.02m,0.022m, etc
2.  after you have set up d and len, try multiplying by the units i.e.  d:= d*m.  Then each value of d will have the unit m.
3.  I usually set these up in a matrix and multiply the matrix by the units.

Good Luck

rd78

RE: Inserting units into a range variable

Alternately, you can also define the ancillary vectors and the assign the units with something like:

d[i:d.unitless[i*m

TTFN

RE: Inserting units into a range variable

(OP)
Thank you rd78 & IRstuff!

Regards,

Cory

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips Fora.

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