cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to make multiple user defined function and use range value as input.

Highlighted
Participant

How to make multiple user defined function and use range value as input.

Hi,

 

Basically, i am trying to calculate deflection of a beam by using Mathcad.

But I cant define my range variable with units (mm).

I believe using range variable are not allowed as input for the multiple user defined as in the photo.

Is there any way to input value using range values with units into a multiple user defined function and then plot the graph?

 

 

Thank you,

2 REPLIES 2

Re: How to make multiple user defined function and use range value as input.

Hi,

 

I have found over time the following little function extremely useful.

Capture.JPG

 

Re: How to make multiple user defined function and use range value as input.

1) You sure can define a range with units! The error message tells you exactly whats wrong and how you can correct it:

B1.PNG

But even if you supply the second value (and its a good habit to apply the unit to 0, too) your calculation would not work because you should not use a range  for this task. You get the error that you can't compare a range to a scalar:

b2.PNG

You should use a vector instead of a range. You could use Terrys utility function to create that vector or use a dirty, undocumented trick to turn a range into a function - you simply type an equal sign after the 100m to evaluate the range and bingo, its turned into a vector. The calculation still would not work as you can't compare a vector (x) to a scalar (L.2), too. So its a good idea to turn your calculation into a function and call that function vectorized:

B3.PNG

You should provide an otherwise statement as what you had typed missed the cases x<=0 and x=L.2.