Skip to main content
11-Garnet
November 12, 2024
Question

min and max function in mathcad

  • November 12, 2024
  • 2 replies
  • 2077 views

I've attached a snapshot of the Mathcad sheet where I'm working. I need some guidance on how to use the minimum and maximum functions in Mathcad to obtain the FTMF values.

 

AK_10948685_0-1731404000908.png

 

2 replies

23-Emerald V
November 12, 2024

Is the below of any help?

 

Range vectors are useful, but it is generally better to work with vectors.  Your F (which I've renamed vec) is a common user-defined function that converts ranges and matrices into vectors. You'll find it called rng2vec, amongst other things, but the operation of converting matrices into vectors already has the name vec, and it's merely been given an additional Mathcad-specific task.

 

2024 11 12 A.png

 

Stuart

25-Diamond I
November 12, 2024

Instead of creating a range j and then converting it to a vector you could create the vector of angles right ahead.
As Stuart I assumed that you meant the angles to be in degree and added that (pseudo) unit.

Note that Prime assumes angles to be in radiant and also displays angles in radiants unless otherwise told by adding the unit 'deg'.

Vectorization when creating the FTMF vector is not mandatory in your case but this depends on the calculations used and so you are always on the safe side if you apply explicit vectorization when you feed a vector into a scalar function.

Werner_E_1-1731414763342.png

 

Prime 10 sheet attached

 

23-Emerald V
November 12, 2024

I have a set of functions to handle the commonplace tasks of converting range variables to vectors and/or creating additional range variables that will index into vectors or alongside non-integral range variables.   I usually keep them in a (collapsed) Area in my default worksheet.

 

The built-in function format shows a range as a string comprised of either "start..stop" or "start, next..stop" ... but only if it is on the right-hand side of a definition.  If it's on the left-hand side, then Mathcad will iterate through format's argument and apply format to each value in the ranges' sequence.

 

2024 11 12 E.png

 

Stuart

25-Diamond I
November 12, 2024

Its a really pity that a user-defined function vec`() can't be used the most natural way which would be something like

Werner_E_0-1731425911975.png

Instead we have to define a temporary range variable and must take care how to use it

Werner_E_1-1731426025718.png