0
$\begingroup$

So i have this function for witch i made a 3D plot and tried to do a FindMaximum[func,{x,0},{y,0.45}]]search for coordinates x=0 and y=0.45 because it looks like the maximum is in that proximity but it gives me some ludicrous resaults that cant be right.If i just do func/.x->0/.y->0.45 it gives a value in the expected range.The range for x and y is 0 to 1. The function looks like this

func=(36 (-((
           4849678413722143149839946135 ((7 x^2)/5 - (12 x^3)/5 + 
              x^4) (-9 y + 12 y^2))/28326208592086409437597807496) + (
          10701629009321335947586202445 ((16 x^2)/5 - (21 x^3)/5 + 
             x^5) (-9 y + 12 y^2))/28326208592086409437597807496 + (
          302721643448438464893982092105 ((7 x^2)/5 - (12 x^3)/5 + 
             x^4) (-12 y + 20 y^3))/453219337473382551001564919936 - (
          9276785765744257133881114365 ((16 x^2)/5 - (21 x^3)/5 + 
             x^5) (-12 y + 20 y^3))/16186404909763662535770175712 + (
          5304264590147948993897932317 ((27 x^2)/5 - (32 x^3)/5 + 
             x^6) (-15 y + 30 y^4))/56652417184172818875195614992 - (
          139779071359314865060733865 (8 x^2 - 9 x^3 + x^7) (-18 y + 
             42 y^5))/16186404909763662535770175712)^2 + 
       108 (-((4849678413722143149839946135 ((14 x)/5 - (36 x^2)/5 + 
              4 x^3) (1/2 - (9 y^2)/2 + 4 y^3))/
           28326208592086409437597807496) + (
          10701629009321335947586202445 ((32 x)/5 - (63 x^2)/5 + 
             5 x^4) (1/2 - (9 y^2)/2 + 4 y^3))/
          28326208592086409437597807496 + (
          302721643448438464893982092105 ((14 x)/5 - (36 x^2)/5 + 
             4 x^3) (1 - 6 y^2 + 5 y^4))/
          453219337473382551001564919936 - (
          9276785765744257133881114365 ((32 x)/5 - (63 x^2)/5 + 
             5 x^4) (1 - 6 y^2 + 5 y^4))/16186404909763662535770175712 + (
          5304264590147948993897932317 ((54 x)/5 - (96 x^2)/5 + 6 x^5) (3/
             2 - (15 y^2)/2 + 6 y^5))/56652417184172818875195614992 - (
          139779071359314865060733865 (16 x - 27 x^2 + 7 x^6) (2 - 
             9 y^2 + 7 y^6))/16186404909763662535770175712)^2 - 
       36 (-((4849678413722143149839946135 ((7 x^2)/5 - (12 x^3)/5 + 
              x^4) (-9 y + 12 y^2))/28326208592086409437597807496) + (
          10701629009321335947586202445 ((16 x^2)/5 - (21 x^3)/5 + 
             x^5) (-9 y + 12 y^2))/28326208592086409437597807496 + (
          302721643448438464893982092105 ((7 x^2)/5 - (12 x^3)/5 + 
             x^4) (-12 y + 20 y^3))/453219337473382551001564919936 - (
          9276785765744257133881114365 ((16 x^2)/5 - (21 x^3)/5 + 
             x^5) (-12 y + 20 y^3))/16186404909763662535770175712 + (
          5304264590147948993897932317 ((27 x^2)/5 - (32 x^3)/5 + 
             x^6) (-15 y + 30 y^4))/56652417184172818875195614992 - (
          139779071359314865060733865 (8 x^2 - 9 x^3 + x^7) (-18 y + 
             42 y^5))/
          16186404909763662535770175712) (-((
           4849678413722143149839946135 (14/5 - (72 x)/5 + 12 x^2) (y/
              2 - (3 y^3)/2 + y^4))/28326208592086409437597807496) + (
          10701629009321335947586202445 (32/5 - (126 x)/5 + 20 x^3) (y/
             2 - (3 y^3)/2 + y^4))/28326208592086409437597807496 + (
          302721643448438464893982092105 (14/5 - (72 x)/5 + 12 x^2) (y - 
             2 y^3 + y^5))/453219337473382551001564919936 - (
          9276785765744257133881114365 (32/5 - (126 x)/5 + 20 x^3) (y - 
             2 y^3 + y^5))/16186404909763662535770175712 + (
          5304264590147948993897932317 (54/5 - (192 x)/5 + 30 x^4) ((3 y)/
             2 - (5 y^3)/2 + y^6))/56652417184172818875195614992 - (
          139779071359314865060733865 (16 - 54 x + 42 x^5) (2 y - 3 y^3 + 
             y^7))/16186404909763662535770175712) + 
       36 (-((4849678413722143149839946135 (14/5 - (72 x)/5 + 12 x^2) (y/
              2 - (3 y^3)/2 + y^4))/28326208592086409437597807496) + (
          10701629009321335947586202445 (32/5 - (126 x)/5 + 20 x^3) (y/
             2 - (3 y^3)/2 + y^4))/28326208592086409437597807496 + (
          302721643448438464893982092105 (14/5 - (72 x)/5 + 12 x^2) (y - 
             2 y^3 + y^5))/453219337473382551001564919936 - (
          9276785765744257133881114365 (32/5 - (126 x)/5 + 20 x^3) (y - 
             2 y^3 + y^5))/16186404909763662535770175712 + (
          5304264590147948993897932317 (54/5 - (192 x)/5 + 30 x^4) ((3 y)/
             2 - (5 y^3)/2 + y^6))/56652417184172818875195614992 - (
          139779071359314865060733865 (16 - 54 x + 42 x^5) (2 y - 3 y^3 + 
             y^7))/16186404909763662535770175712)^2)^0.5
Plot3D[func, {x, 0, 1}, {y, 0, 1}, AxesLabel -> Automatic, 
 PlotRange -> Full]  
FindMaximum[func, {{x, 0}, {y, 0.45}}]
$\endgroup$
1
$\begingroup$

If you give a constraint for the range x,y you can solve your problem:

FindMaximum[{func, 0 < x < 1, 0 < y < 1}, {{x, 0}, {y, 0.45}}]
(*{0.658277, {x -> 7.30777*10^-9, y -> 0.440418}}*)

alternatively without starting points

NMaximize[{func, 0 < x < 1, 0 < y < 1}, {x, y}]
(* {0.658277, {x -> -3.97487*10^-27, y -> 0.440418}} *) 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.