1 Pages (10 items)
Smath Equivalent to MathCAD min() and max() - Messages
#1 Posted: 5/13/2020 1:14:29 PM
Hello,
Does smath have a built-in function that performs the Mathcad min() and max() ? I see in smath, these function names exist but they are being using for matrix / vector functions. The code in Mathcad is this:

Seismic, TL, and Ls, are all numeric variables with units elsewhere in the calculation sheet. min() function description from Mathcad:

I could solve this programmatically a couple of different ways, but I wanted to check with the community before writing a work around. Several engineering codes require minimums / maximum values if the calculated requirement falls below the minimum / maximum respectively. This is an example of two such a cases.
Another option is to write my own function and re-use it, I am just not exactly sure how to achieve that.
Thanks for this wonderful product!
Mike
Does smath have a built-in function that performs the Mathcad min() and max() ? I see in smath, these function names exist but they are being using for matrix / vector functions. The code in Mathcad is this:
Seismic, TL, and Ls, are all numeric variables with units elsewhere in the calculation sheet. min() function description from Mathcad:
I could solve this programmatically a couple of different ways, but I wanted to check with the community before writing a work around. Several engineering codes require minimums / maximum values if the calculated requirement falls below the minimum / maximum respectively. This is an example of two such a cases.
Another option is to write my own function and re-use it, I am just not exactly sure how to achieve that.
Thanks for this wonderful product!
Mike
#2 Posted: 5/13/2020 1:33:48 PM
#3 Posted: 5/13/2020 2:02:56 PM
Hi Sergio,
I appreciate your quick reply. I had developed my workaround before I read your guidance:

Cumbersome, but it works. Then I did what you suggested which was just to define my varibles in simple vector form:

Much cleaner! I tried pressing the "Thanks" button, but it keeps giving me an error message (using Firefox 76). So, thank you
Mike
I appreciate your quick reply. I had developed my workaround before I read your guidance:
Cumbersome, but it works. Then I did what you suggested which was just to define my varibles in simple vector form:
Much cleaner! I tried pressing the "Thanks" button, but it keeps giving me an error message (using Firefox 76). So, thank you
Mike
#4 Posted: 5/13/2020 7:11:10 PM
#5 Posted: 11/24/2020 12:05:29 PM
#6 Posted: 11/24/2020 12:39:32 PM
WroteWroteIt seems to me that you answered yourself. min and max can easily be used by organizing elements in vectors. With the Custom Function plugin you can use the shape most similar to the one you want
sergio
Doesn't work for me. Where is a problem?
Capital letter on "Max" (not "max").
Of course, you need to install Custom Function plugin first.
#7 Posted: 11/24/2020 12:45:04 PM
WroteWroteIt seems to me that you answered yourself. min and max can easily be used by organizing elements in vectors. With the Custom Function plugin you can use the shape most similar to the one you want
sergio
Doesn't work for me. Where is a problem?
Hi. Try with eval(max[ ... ]). max() and min(), and some other requires eval for work as usually others in SMath. For numerical procedures, always call them with eval. In any case, for symbolics max and min are not implemented, and probably can't be.
Best regards.
Alvaro.
#8 Posted: 11/24/2020 2:15:17 PM
WroteDoesn't work for me. Where is a problem?
For vectors: min or Min ... max or Max.
For scalar function, Golden Ratio.
You have no vector, no function ... therefore no min/max, Min/Max
#9 Posted: 11/24/2020 2:17:48 PM
#10 Posted: 11/24/2020 2:59:25 PM
1 Pages (10 items)
-
New Posts
-
No New Posts