Error in solve function - constraining variables

DATA: Available in the attached excel sheet,
T900(1) = cellB3; T900(2) = cellB4; T1000(1) = cellC3
so on and so forth!
A= -1.830; B= 5347
Numerator1=((10^(A+(B/T900(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(22)))*4.3018*2.59)/1.386294);
Numerator2=((10^(A+(B/T1000(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(22)))*4.3018*2.59)/1.386294);
Numerator3=((10^(A+(B/T1100(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(22)))*4.3018*2.59)/1.386294);
Ratio1 = ((Numerator1)/3.63E-06);
Ratio2 = ((Numerator2)/5.72E-06);
Ratio3 = ((Numerator3)/8.87E-06);
Solx = solve([(Ratio1)+(Ratio2)+(Ratio3) ==3,-6.36812==A+(B*8.52E-04),-6.09207==A+(B*7.85E-04),-5.70056==A+(B*7.28E-04)], [A,B])
Invalid MEX-file 'C:\Program Files\MATLAB\R2015b\toolbox\symbolic\symbolic\mupadmex.mexw64': The specified
module could not be found.
Error in mupadengine/evalin (line 111)
res = mupadmex(statement,output_type{:});
Error in solve>getEqns (line 399)
argv{k} = evalin(symengine, 'FALSE');
Error in solve (line 225)
[eqns,vars,options] = getEqns(varargin{:});
Could some one please explain the error message for me? I am trying to perfect the values of A and B so that it fits all 4 equations! If you can think of any other method to do it please do suggest some. Thank you!

Answers (1)

Your Symbolic Toolbox is not correctly installed.
On the other hand, you are asking to solve 4 equations for two variables that have already been assigned numeric values. Even if we guess that maybe A and B should be
syms A B
without numeric values, since you look like you are solving for A and B, you still end up with 4 equations in two unknowns.
You are also asking to solve(), which is asking for algebraic solutions, exact solutions, but you are using lots and lots of floating point data, which suggests that you should be looking for numeric solutions instead of algebraic solutions.
If you take the second of your equations as being correct but assuming that A and B should be symbolic, and you solve for either of the variables and do a substitution into the left side of your first equation (sum of ratios), then with a small bit of graphing you can show that the left side of the first equation is no less than 32.42088640, and so the sum of the ratios cannot possibly be 3 if A and B are symbolic and the second equation is true.
All in all it appears that your equations are incorrect.

13 Comments

WOW! Thanh you so much for your detailed answer. I understand your details. Is there any other function which I can use to perfect the values of A and B such that the ratios sum up to 1? The other three equations can be removed/ignored. I would like matlab to change the values of A and B such that the ratios sum up to 1. Thank you again!
That would give you one equation in two unknowns which would have infinite solutions
I understand that algebraic solving won't work! But can we do an optimization function, wherein I give an initial value for A and B and matlab optimizes that values such that it can make the sum of the ratios equal to 1?
Thank you!
No, not with one equation with two unknowns. You could give it one or the other value and have it calculate the second, but that would not be optimization. It would, though, involve finding a numeric root of a sum of exponentials.
okay, that makes sense. What about finding a minimum for A and B that satisfies the condition? (if A is on x axis and B on Y axis the surface would have an minimum that satisfies the equation ratio1+ratio2+ratio3=3). Will that work? You are being very helpful! Thank you so much for that!
... No?
The sum of the three ratios can be any positive value, and for any given real A there is a B that gives that sum, and for any given real B there is an A that gives that sum.
The sum is much more sensitive to changes in A than to changes in B
You could make it more interesting by putting constraints on A or B, like one of them must be non-negative. Be careful, though: if you require that both are non-negative then the smallest sum you can get is about 9800.
AluAl
AluAl on 20 May 2016
Edited: AluAl on 20 May 2016
How do I write the code for it? I can constrain that B should be non-negative and A is a negative value. I don't require A and B such that it only gives 3 as the sum of the ratios. I just need a global minimum for A and B such that the ratio is close to 3! Is that possible in any way?! Thank you
num = xlsread('Matlabdata.xlsx');
T900 = sym(num(:,1));
T1000 = sym(num(:,2));
T1100 = sym(num(:,3));
syms A B
Numerator1=((10^(A+(B/T900(1)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(2)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(3)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(4)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(5)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(6)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(7)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(8)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(9)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(10)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(11)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(12)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(13)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(14)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(15)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(16)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(17)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(18)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(19)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(20)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(21)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T900(22)))*sym(4.3018)*sym(2.59))/sym(1.386294));
Numerator2=((10^(A+(B/T1000(1)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(2)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(3)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(4)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(5)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(6)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(7)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(8)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(9)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(10)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(11)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(12)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(13)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(14)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(15)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(16)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(17)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(18)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(19)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(20)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(21)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1000(22)))*sym(4.3018)*sym(2.59))/sym(1.386294));
Numerator3=((10^(A+(B/T1100(1)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(2)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(3)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(4)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(5)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(6)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(7)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(8)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(9)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(10)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(11)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(12)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(13)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(14)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(15)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(16)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(17)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(18)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(19)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(20)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(21)))*sym(4.3018)*sym(2.59))/sym(1.386294))+((10^(A+(B/T1100(22)))*sym(4.3018)*sym(2.59))/sym(1.386294));
Ratio1 = ((Numerator1)/sym(3.63E-06));
Ratio2 = ((Numerator2)/sym(5.72E-06));
Ratio3 = ((Numerator3)/sym(8.87E-06));
solA = solve(Ratio1+Ratio2+Ratio3==3,A);
bestB = 0; %constrain to non-negative
bestA = double(subs(solA,B,bestB));
If you increase B then bestA will decrease, so this is the least-negative A with non-negative B such that the ratio is 3.
Thank you Mr.Robertson. I saw your comment only recently. I even tried the code but since I don't have the symbolic toolbox I could not make it work. However, I have another method. Please tell me if this one is right for my problem.
Since the sum of Ratios may not work I have taken the differences and tried to find the value of A and B such that the sum of the differences is the minimum possible. This is my code.
endNumerator1=((10^(A+(B/T900(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(22)))*4.3018*2.59)/1.386294);
Numerator2=((10^(A+(B/T1000(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(22)))*4.3018*2.59)/1.386294);
Numerator3=((10^(A+(B/T1100(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(22)))*4.3018*2.59)/1.386294);
Diff1 = abs(Numerator1-3.63E-06);
Diff2 = abs(Numerator2-5.72E-06);
Diff3 = abs(Numerator3-8.87E-06);
Optimin=@(A,B)Diff1+Diff2+Diff3;
[y,fval]=fminsearch(Optimin,[-1.8380,-5347])
The problem is when I try to find the minimum, it returns the same value as my intial! Where am I going wrong?
(data available in the attached file above)
endNumerator1 = @(A,B) ((10^(A+(B/T900(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T900(22)))*4.3018*2.59)/1.386294);
Numerator2 = @(A,B) ((10^(A+(B/T1000(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1000(22)))*4.3018*2.59)/1.386294);
Numerator3 = @(A,B) ((10^(A+(B/T1100(1)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(2)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(3)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(4)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(5)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(6)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(7)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(8)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(9)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(10)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(11)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(12)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(13)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(14)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(15)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(16)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(17)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(18)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(19)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(20)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(21)))*4.3018*2.59)/1.386294)+((10^(A+(B/T1100(22)))*4.3018*2.59)/1.386294);
Diff1 = @(A,B) abs(Numerator1(A,B)-3.63E-06);
Diff2 = @(A,B) abs(Numerator2(A,B)-5.72E-06);
Diff3 = @(A,B) abs(Numerator3(A,B)-8.87E-06);
Optimin = @(A,B)Diff1(A,B)+Diff2(A,B)+Diff3(A,B);
[y,fval] = fminsearch( @(AB) Optimin(AB(1),AB(2)), [-1.8380,-5347])
Thank you for the rectifications! Could you please explain the following error that I received,
Error using fminsearch (line 83) FMINSEARCH requires at least two input arguments or a structure with valid fields.
I have corrected a typing mistake on my last line.
That helped a lot! Thank you Mr. Roberson.

Sign in to comment.

Asked:

on 15 May 2016

Commented:

on 7 Jun 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!