Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Jun 28, 2018
12:41 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 28, 2018
12:41 PM

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,

Labels:

2 REPLIES 2

Jun 28, 2018
01:20 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 28, 2018
01:20 PM

Hi,

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

Jun 28, 2018
04:18 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Jun 28, 2018
04:18 PM

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

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:

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:

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