home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.ai.fuzzy      Fuzzy logic... all warm and fuzzy-like      1,275 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 380 of 1,275   
   Fred the Wonder Worm to Dr. Muhammad Masroor Ali   
   Re: Maximum and minimum values of quadra   
   04 Jan 05 04:17:32   
   
   XPost: sci.math, sci.math.symbolic   
   From: ftww@maths.usyd.edu.au   
      
   In article <9be27e8f.0501020515.38688911@posting.google.com>,   
   Dr. Muhammad Masroor Ali  wrote:   
   > Hello All,   
   > I am rather stuck with some quadratic equation and thought that you   
   > could help.   
   >   
   > I have four quadratic equations of the form,   
   > y = a x^2 + bx + c, where 0 <= x <= 1.   
   >   
   > I need to find the maximum and minimum values of y (from four values)   
   > for each point in the range of x ([0.0,1.0]). I know that I can plot   
   > the equations and find the result visually. But is there a way of   
   > solving this analytically?   
   >   
   > The situation is further complicated by the fact that not a single   
   > equation gives the min (max) value in that range, the lines do   
   > intersect and the equation giving min (max) do change.   
      
   I _think_ that the other followups I have seen have missed the point.   
   Either that, or I have. :)  I assume that you mean that you have four   
   quadratic functions (call them f1,f2,f3,f4), and for each point x in   
   [0..1] you are interested in the following two values:   
      
       g(x) = Min(f1(x), f2(x), f3(x), f4(x))   
       h(x) = Max(f1(x), f2(x), f3(x), f4(x))   
      
   (Also, perhaps you are interested in the global minima and maxima.)   
   The rest of this article assumes this is the case -- apologies if   
   this is not what you were interested in.   
      
   Anyway, g and h will be formed from the union of pieces of the   
   original functions over certain intervals.  To take a simplified   
   example, if f1 = (x - 1/2)^2 and f2 = (x - 1)^2 - 1/4, then g is   
   f1 in the interval [0..1/2] and f2 in the interval [1/2..1].   
   (Similarly, h is f2 in [0..1/2] and f1 in [1/2..1].)   
      
   The key point to notice is that the transition between one piece   
   and another can only occur when two of the functions have common   
   values, which is to say at a root of fi - fj = 0 for some i,j.   
   So, you can find all these roots (there are at most 12), discard   
   any outside [0..1] since you don't care about them, add in the   
   endpoints 0 and 1 if not present, and order these values (also,   
   throw away duplicates).  This gives a subdivision of [0..1] into   
   intervals on each of which g and h will be equivalent to one of   
   the original functions.   
      
   To determine which function applies in a given interval, evaluate   
   each function at an internal point -- the midpoint is an obvious   
   candidate -- and choose the appropriate function based on these.   
      
   If you are after the global minima/maxima only, this is a much   
   easier question -- they will arise at either 0, 1, or the turning   
   points of the functions.   
      
   Cheers,   
   Geoff.   
      
   -----------------------------------------------------------------------------   
   Geoff Bailey (Fred the Wonder Worm)   |   Programmer by trade --   
   ftww@maths.usyd.edu.au                |       Gameplayer by vocation.   
   -----------------------------------------------------------------------------   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca