finding the maximum
Aug 09, 2013
10:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 09, 2013
10:35 AM
finding the maximum
Could some one point out where im going wrong in finding the maximum of my function. I thought it should be trivial.
I want to create a generic way to pass any function. Please see attached.
Thanks
Jason
Labels:
- Labels:
-
Other
4 REPLIES 4
Aug 09, 2013
10:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 09, 2013
10:50 AM
Its OK, I've done it. I changed the order of the two line sin the for loop and it worked 😉
Jason
Aug 09, 2013
01:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 09, 2013
01:38 PM
Or maybe better using just one if-statement
or even a more analytical approach (with all limitations of root, of course) which will yield more precise results more quickly
Aug 09, 2013
01:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 09, 2013
01:49 PM
Or
Aug 09, 2013
04:14 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Aug 09, 2013
04:14 PM
Here is a version with some error handling which should work even if the extremum is not between xlo and xhi.
