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!

Inserting units into a range variable 2

Status
Not open for further replies.

CoryPad

Materials
Apr 15, 2002
5,192
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

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
 
Alternately, you can also define the ancillary vectors and the assign the units with something like:

d[i:d.unitless[i*m

TTFN
 
Thank you rd78 & IRstuff!

Regards,

Cory

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips Fora.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor