 The Museum of HP Calculators

HP Forum Archive 20

 Finding extremums of function with complex derivateMessage #1 Posted by Lukas K. on 15 Oct 2011, 6:18 a.m. Given is the function I want to calculate the maximums auf this function using the FCN->EXTR function of the 50g. This fails with the message 'Bad Guess(es)', because the derivate of f is complex. Why is f' complex, whereas f only returns real values? Adding a ->NUM to the end of the Y-Var program slows down the plot and sends the calculator into an infinite loop when trying to find the maximum of f. The TI-83 fails at this, too. It finds the maximum at the guessed one. Has anyone an idea how to find the maximum of f (using the 50g)?

 Re: Finding extremums of function with complex derivateMessage #2 Posted by Allen on 15 Oct 2011, 8:44 a.m.,in response to message #1 by Lukas K. For most values of x the function would approach 4. You can see in this function , can you use the estimation? Edited: 15 Oct 2011, 8:56 a.m.

 Re: Finding extremums of function with complex derivateMessage #3 Posted by Crawl on 15 Oct 2011, 10:55 a.m.,in response to message #2 by Allen I think the URL you pasted didn't work right,how about this? Yeah, the exponential will be of the form (cos(t)+isin(t)). So that plus 1 has a maximum absolute value when it equals 2. (when t=0, 2pi, 4pi, etc) So you need to solve for (x+3.1e-6)/x = an integer. Or x = 3.1e-6/(n-1), with n an integer. I'm not sure why it seems like the derivative is complex; it shouldn't be. I'd have to check what the HP50g gives for that later. Edited: 15 Oct 2011, 10:58 a.m. after one or more responses were posted

 Re: Finding extremums of function with complex derivateMessage #4 Posted by Crawl on 15 Oct 2011, 10:56 a.m.,in response to message #3 by Crawl My URL didn't work either; the parentheses get lost. Oh, well.

 Re: Finding extremums of function with complex derivateMessage #5 Posted by Lukas K. on 15 Oct 2011, 11:20 a.m.,in response to message #3 by Crawl Well, plotting and finding it's maximums did the trick. Why didn't I think of this earlier? :( f' seems to be complex, because the derivate of |a+bi| is signum(a+bi), which returns a complex value :(

 Re: Finding extremums of function with complex derivateMessage #6 Posted by Crawl on 15 Oct 2011, 7:24 p.m.,in response to message #5 by Lukas K. I tried playing around with the HP50g with that expression, and it can give wildly varying forms depending on what you do with it. Some of which do not contain complex numbers at all. At least, make sure rigorous is on, so it doesn't simply return abs(x) as x. This is probably a situation for which the TI89 gives a more straight forward result. Edited: 15 Oct 2011, 7:25 p.m.

 Re: Finding extremums of function with complex derivateMessage #7 Posted by Han on 15 Oct 2011, 7:35 p.m.,in response to message #5 by Lukas K. Quote: Well, plotting and finding it's maximums did the trick. Why didn't I think of this earlier? :( f' seems to be complex, because the derivate of |a+bi| is signum(a+bi), which returns a complex value :( Are you sure that Re(f) = |f| ? If this is true, then you can graph Re(f) and get your answer that way. How about using the fact that |z|^2 = z * conj(z) and e^(i*t) = cos(t)+i*sin(t)?

 Re: Finding extremums of function with complex derivateMessage #8 Posted by bunuel66 on 17 Oct 2011, 6:06 a.m.,in response to message #7 by Han It seems that: Re(z)!=|z|^2 That said, max of f is 4 for x=3.1e-6/k, k being 0,1,2.... My two cents... Regards Go back to the main exhibit hall