Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Brent's method for computing extrema
14-03-2016, 08:12 PM
Post: #1
Brent's method for computing extrema
This HP Prime program demonstrates how to interact with a function called minima which computes a single minimum of a user-defined function. The user provides an initial and final value for a search interval along with a convergence criterion.

Here is the output for this program. For this example the user-defined function is simply y = cos(x) and the search interval was 0 to 2 pi. To find the maximum value of a function, remember that a maximum is simply a minimum with a negative attitude! So for this example, changing the user-defined function to y = -cos(x) will find a maximum if one exists in the search interval.

brent's minima method

y = cos(x)

minima = 3.14159265359

error = 0

The error displayed here is pi minus the value computed by the minima function.


Attached File(s)
.zip  demo_minima.zip (Size: 83.67 KB / Downloads: 1)
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)