Thank you very much sirs for giving replies.
Functions are f1(x,y) = 0 & f2(x,y) = 0.
I am giving code so that you can evaluate the code on your system directly.
syms x y f1 f2
f1 = 2822464228751971/(4503599627370496*((2484360419406893*x)/36028797018963968 + (5582909719129191*y)/9007199254740992 + 1))  140234579115081/(4503599627370496*((8089325470800733*x)/144115188075855872 + (3304637458891429*y)/288230376151711744 + 1)) + 320816161903291/(2251799813685248*((6024484531985885*x)/9007199254740992 + (6197466521865093*y)/36028797018963968 + 1)) + 1041325558631747/(36028797018963968*((1388000383401105*x)/576460752303423488 + (603386941836381*y)/9007199254740992 + 1)) + 3248847174498757/(36028797018963968*((2338212506704719*x)/288230376151711744 + (8910002399985347*y)/72057594037927936 + 1)) + 2996237640680017/(36028797018963968*((3416882408443869*x)/2251799813685248 + (8442790123351649*y)/72057594037927936 + 1)) + 2276131449401325/(4503599627370496*((2248687015757317*x)/576460752303423488 + (4572443574873573*y)/9007199254740992 + 1)) +
4479020945402813/(72057594037927936*((6524521880384857*x)/9007199254740992 + (1760797610596235*y)/18014398509481984 + 1)) + 1470675427754771/(18014398509481984*((8050589761579725*x)/9007199254740992 + (8341274636311469*y)/72057594037927936 + 1))  4826228655060733/(144115188075855872*((7699484597058077*x)/4611686018427387904 + (334769527150077*y)/36028797018963968 + 1)) ;
f2 = 1242486569177609/(72057594037927936*((2484360419406893*x)/36028797018963968 + (5582909719129191*y)/9007199254740992 + 1)) + 121629086934271/(36028797018963968*((8089325470800733*x)/144115188075855872 + (3304637458891429*y)/288230376151711744 + 1)) + 5998260655906273/(9007199254740992*((6024484531985885*x)/9007199254740992 + (6197466521865093*y)/36028797018963968 + 1))  1971407955810865/(36028797018963968*((1388000383401105*x)/576460752303423488 + (603386941836381*y)/9007199254740992 + 1))  874581120276129/(18014398509481984*((2338212506704719*x)/288230376151711744 + (8910002399985347*y)/72057594037927936 + 1)) + 7131526150318003/(4503599627370496*((3416882408443869*x)/2251799813685248 + (8442790123351649*y)/72057594037927936 + 1))  3826478189007699/(72057594037927936*((2248687015757317*x)/576460752303423488 + (4572443574873573*y)/9007199254740992 + 1)) +
6538975049719411/(9007199254740992*((6524521880384857*x)/9007199254740992 + (1760797610596235*y)/18014398509481984 + 1)) + 8189185522877099/(9007199254740992*((8050589761579725*x)/9007199254740992 + (8341274636311469*y)/72057594037927936 + 1))  500042358655175/(9007199254740992*((7699484597058077*x)/4611686018427387904 + (334769527150077*y)/36028797018963968 + 1)) ;
fh = matlabFunction([f1 ; f2],'vars',{[x,y]});
options = optimset('Display','off','TolFun',1e10);
min_rise = 0.02;
X = 0.2 : min_rise: 1500; Y = 0.2 : min_rise : 1500;
f1val = subs(f1, {x,y}, {X, Y}) ;
f2val = subs(f2, {x,y}, {X, Y}) ;
fsolve_ind1 = find( abs(f1val ) == min( abs(f1val ) ) );
fsolve_ind2 = find( abs(f2val ) == min( abs(f2val ) ) );
[min(f1val), min(f2val)]
if( ( min( abs(f1val ) ) <= 10^(6) ) && ( min( abs(f2val ) ) <= 10^(6) ) )
fsolve_ind1 = find( abs(f1val ) == min( abs(f1val ) ) );
fsolve_ind2 = find( abs(f2val ) == min( abs(f2val ) ) );
elseif( ( min( abs(f1val ) ) > 10^(6) )  ( min( abs(f2val ) ) > 10^(6) ) )
floor_f1val = log10(abs(f1val ));
expone_f1 = fix(floor_f1val );
floor_f2val = log10(abs(f2val));
expone_f2 = fix(floor_f2val );
divide_min = abs( 6/max( min( expone_f1 ), min(expone_f2) ) );
if( divide_min >= 6 )
divide_min = 3;
end
min_rise = min_rise/(10^divide_min);
X = 0.2 : min_rise: 1500; Y = 0.2 : min_rise : 1500;
clear f1val ; clear f2val ;
f1val = subs(f1, {x,y}, {X, Y}) ;
f2val = subs(f2, {x,y}, {X, Y}) ;
fsolve_ind1 = find( abs(f1val ) == min( abs(f1val ) ) );
fsolve_ind2 = find( abs(f2val ) == min( abs(f2val ) ) );
[min(f1val), min(f2val)]
end
%%%%%% Taking the surrounding X & Y values that bring min values for f1 &
%%%%%% f2 functions.
x_value = [X(fsolve_ind1), X(fsolve_ind1), X(fsolve_ind1), X(fsolve_ind1) + 1, X(fsolve_ind1)  1, X(fsolve_ind1) + 2, X(fsolve_ind1) 2 ,X(fsolve_ind1) , X(fsolve_ind1) ];
y_value = [Y(fsolve_ind1) + 1, Y(fsolve_ind1)1, Y(fsolve_ind1), Y(fsolve_ind1), Y(fsolve_ind1) , Y(fsolve_ind1), Y(fsolve_ind1), Y(fsolve_ind1) + 2, Y(fsolve_ind1) 2 ];
x1_value = [X(fsolve_ind2), X(fsolve_ind2), X(fsolve_ind2), X(fsolve_ind2) + 1, X(fsolve_ind2)  1, X(fsolve_ind2) + 2, X(fsolve_ind2) 2 ,X(fsolve_ind2) , X(fsolve_ind2) ];
y1_value = [Y(fsolve_ind2)+1, Y(fsolve_ind2)1,Y(fsolve_ind2), Y(fsolve_ind2), Y(fsolve_ind2) , Y(fsolve_ind2), Y(fsolve_ind2), Y(fsolve_ind2) + 2, Y(fsolve_ind2) 2 ];
%%%% using fsolve to get the solution for f1 & f2 functions with initial guess as %%%%% x_value & y_value
for i = 1 : length(x_value),
[sol_fsolve(:,i), value(:,i), outflag(i)] = fsolve(fh, [x_value(i), y_value(i) ] ,options );
end
%%%% using fsolve to get the solution for f1 & f2 functions with initial guess as %%%%% x1_value & y1_value
later_xvalue = length(x_value) + 1;
for i = 1 : length(x1_value),
[sol_fsolve(:,later_xvalue), value(:,later_xvalue), outflag(later_xvalue)] = fsolve(fh, [x1_value(i), y1_value(i) ] ,options );
later_xvalue = later_xvalue + 1 ;
end
%%% Trying to findout the solution for f1 & f2 functions by taking those values which %%% give lesser " value" for the functions.
len_pos = length( sol_fsolve );
if( len_pos ~= 0)
indpos1 = find( (sol_fsolve(1,:)>=0)&(sol_fsolve(2,:)>=0));
if( length(indpos1) >= 1)
op_val = find( abs(value(1,indpos1)) == min( abs(value(1,indpos1)) ) );
op_val1 = find( abs(value(2,indpos1)) == min( abs(value(2,indpos1)) ) );
if( op_val == op_val1 )
if( length(op_val) > 1 )
final_x_value= sol_fsolve(1, indpos1(op_val(1)) ); final_y_value= sol_fsolve(2, indpos1(op_val(1)) );
elseif(length(op_val) == 1 )
final_x_value= sol_fsolve(1, indpos1(op_val) ); final_y_value = sol_fsolve(2, indpos1(op_val) );
end
elseif( abs( abs(value(1,op_val))  abs(value(1,op_val1)) ) < abs( abs(value(2,op_val))  abs(value(2,op_val1)) ) )
if( length(op_val1)> 1)
final_x_value= sol_fsolve(1, indpos1(op_val1(1)) ); final_y_value= sol_fsolve(2, indpos1(op_val1(1)) );
elseif(length(op_val1) == 1 )
final_x_value = sol_fsolve(1, indpos1(op_val1) ); final_y_value= sol_fsolve(2, indpos1(op_val1) );
end
elseif( abs( abs(value(1,op_val))  abs(value(1,op_val1)) ) >= abs(abs(value(2,op_val))  abs(value(2,op_val1))) )
if( length(op_val)> 1)
final_x_value= sol_fsolve(1, indpos1(op_val(1)) ); final_y_value= sol_fsolve(2, indpos1(op_val(1)) );
elseif(length(op_val) == 1 )
final_x_value= sol_fsolve(1, indpos1(op_val) ); final_y_value= sol_fsolve(2, indpos1(op_val) );
end
end
else
final_x_value= 0; final_y_value= 0;
end
else
final_x_value= 0; final_y_value= 0;
end
[final_x_value,final_y_value]
The correct values to be obtained for final_x_value & final_y_value are : 4.4552e+002 & 8.4597e+002 . But, i am getting final_x_value & final_y_value as : 4.3948e+002 & 8.3229e+002.
If i give command " [op, val] = fsolve(fh, [ 4.4552e+002, 8.4597e+002 ] ,options ) " for the correct x & y values , then i get the f1 function value = 2.9363e009 & f2 function value = 3.6558e008.
For the command " [op, val] = fsolve(fh, [ 4.3948e+002 , 8.3229e+002 ] ,options ) " , then i get the f1 function value = 6.6746e006 & f2 function value = 4.0965e006.
These f1 & f2 function values clearly tell me that i am missing out the initial guess for fsolve command.
If you know, please tell me how to make the correct initial guess for fsolve .
Sorry if it is consuming your time and thank you very much again for spending your time for my problem.
With best regards,
kalpana
"Steven_Lord" <slord@mathworks.com> wrote in message <kvnjve$efk$1@newscl01ah.mathworks.com>...
>
>
> "Torsten " <Torsten.Hennig@umsicht.fraunhofer.de> wrote in message
> news:kvn673$72j$1@newscl01ah.mathworks.com...
> > "kalpana " <naidukalpana@yahoo.co.in> wrote in message
> > <kvn4vj$imv$1@newscl01ah.mathworks.com>...
> >>
> >> For X = 2 : 0.2 : 1000 & Y = 2 : 0.2 :1000, i have calculated f1(X,Y) &
> >> f2(X,Y) values. I checked the min(f1) and min(f2) values. They are coming
> >> around 10^(4) & 10^(6). But, still the initial guess taken is coming as
> >> wrong. May be, i have to further increase the X range and Y range for
> >> calculating f1(X,Y) & f2(X,Y) values . This is something like : X = 2 :
> >> 0.02 : 1000 & Y = 2 : 0.02 :1000. When i take like this, some times i am
> >> getting correct values. But, some times, i am getting as : " Out of
> >> memory. HELP MEMORY for your options " . I have to look for some other
> >> way to circumwent this problem. Thank you for your answer.
> >>
> >> With best regards,
> >> kalpana
> >
> > What is the result when you evaluate
> > f1(8.9830e+000,1.7937e+001), f2( 8.9830e+000,1.7937e+001) and
> > f1(8.7616e+000,2.0232e+001), f2(8.7616e+000,2.0232e+001)
> > ?
>
> That's the wrong question to ask. The correct question is, when you run your
> code like:
>
> solution = fsolve(...)
>
> what is the result you receive when you execute:
>
> functionValues = [f1(solution(1), solution(2)), f2(solution(1),
> solution(2))]
>
> Sometimes the digits that don't print using FORMAT SHORT can be significant.
> Using the contents of the variables instead of the displayed values of the
> variables avoids that problem.
>
> To the OP, if that doesn't resolve the problem, post a SMALL description of
> your f1 and f2 functions. If they're "well behaved" then you may just need
> to relax your tolerance. Instead of using a tolerance of 1e10 on the
> function value, try more like 1e6 or 1e7. If your function is something
> oscillatory or "poorly behaved" then you may have problems. For instance,
> trying to find a solution to this:
>
> http://www.mathworks.com/matlabcentral/fileexchange/35311matlabplotgallerysurfacecontourplot/content/html/Surface_Contour_Plot.html
>
> is probably going to lead you in circles (literally.)
>
> 
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com
