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.
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.
RE: Inserting units into a range variable
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
d[i:d.unitless[i*m
TTFN
RE: Inserting units into a range variable
Regards,
Cory
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips Fora.