Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*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.

Students Click Here


Maximum values of a function

Maximum values of a function

Maximum values of a function

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


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

"answer"    P=3

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.


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.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


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:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close