Get Help

Turn on suggestions

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

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Absolute Value

Options

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

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

Showing results for

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-29-2018
06:46 PM

01-29-2018
06:46 PM

I am having an issue with finding the max value of positive and negative values. I want it to always pick the highest integer but to have it's sign remain the same.

For instance,

x=10, y=15, z=-20 are my numbers calculated that

t:=550*[max(x,y,z)] -p is depended on.

if I do r:= max(x,y,z) it will state that r=15 when I need it to pick the worse case for an equation it will be integrated in later on.

if I do r:= max(IxI,IyI,IzI) it will state r=20 but not -20 cause of the absolute value.

Is there a different approach I can do where I wouldn't have to use solve for t for each single case and pick the max absolute value of all three?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-30-2018
02:13 AM

01-30-2018
02:13 AM

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-29-2018
11:19 PM

01-29-2018
11:19 PM

Re: Absolute Value

max(|x|,|y|,|z|)=max(x,y,z)

This is fallible but works most of the time

if test is true you have a positive number

if test is false you have a negative number

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-30-2018
02:13 AM

01-30-2018
02:13 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-30-2018
04:41 AM

01-30-2018
04:41 AM

Re: Absolute Value

Hi Luc. I guess that your solution is correct, just a margin note: If x = max(A) then -x = min(-A).

Best regards.

Alvaro.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-30-2018
06:40 AM

01-30-2018
06:40 AM

Re: Absolute Value

Here are my 2 cents

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-30-2018
11:33 AM

01-30-2018
11:33 AM

Re: Absolute Value

When I do that, it tells me that "these values must all be of one type."

I am not sure what that means.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

01-30-2018
12:00 PM

01-30-2018
12:00 PM

Re: Absolute Value

Actually I was able to make it work with your method, Luc. thank you. My issue was that I was mixing {2,1} variables with {1,1} when what I needed to do first is find the maxabs of the {2,1} and then combine them all in one matrix to find the total maxabs of (B). It's a bit longer the steps but it gives the correct solution.