×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Maximum values of a function

## Maximum values of a function

(OP)
How do I get mathcad 5.0 to return a maximum value for a function without having to print out a table of values, looking at them to find the maximum, and typing it into my next equations, the function is a quadratic equation and has a maximum value. Help!
Flowerhopper   cjomlo@iland.net

### RE: Maximum values of a function

one way to do it would be to use the max() function.  I believe the syntax would be max(my_array)=
but I'm not sitting in front of mathcad right now. (if you'd like to wait until january, I'll get you the answer then)

another way would be to calculate the derivative of the eqn, find the zero points of the derivative, and then figure out (either by looking at the sign of the second derivative or by checking values) which ones are max values and which are mins

### RE: Maximum values of a function

This is an example using a later version of MathCad I don't know if this works with MathCad 5

example

f(x):= 2+6x-x^2
x:=2
Given
x>0
P:= Maximize(f,x)

f(P)=11

### RE: Maximum values of a function

Neither of those is easy in early versions of Mathcad

The obvious thing to do in this case is to differentiate the quadratic and then test the solutions (bearing in mind that quadratics often go to infinity) to that function.

The other more general alternative is to build a vector of values and then a vector of gradients and then search for points of inflexion.

Getting the index figure for each point of inflexion is /possible/, even in the very earliest version of Mathcad, you need to set up another vector that increments until a point of inflexion is found, I think using either "if" or the totally weird "until". I did this a long time ago and can't remember the details. If you can afford to wait three weeks then I'll look it up in my notes.

Cheers

Greg Locock

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!