Skip to content

How Can I identify who is the maximum variable? #20171

Discussion options

You must be logged in to vote

We can define something like this using the expression editor.

if (le(abs(max(force1, force2, force3) - force1), 0.0001), 1, 
   if (le(abs(max(force1, force2, force3) - force2), 0.0001), 2, 
      if (le(abs(max(force1, force2, force3) - force3), 0.0001), 3, 0)))

Is this what you're looking for? We take the max of the three forces and subtract out each of the forces, then take the absolute value and check if it is below some epsilon (I chose 0.0001). Then we can use the conditional structure to pick a value for each force and a value for no force, which shouldn't be any of the cells.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by fernest0
Comment options

You must be logged in to vote
1 reply
@JustinPrivitera
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants