MATLAB Answers

Youngchan
0

fminsearch question for getting a minimum value of 'eqq' variable

Youngchan
さんによって質問されました 2012 年 7 月 12 日
This is the code for getting a minimum value of the 'x1, x2, x3, x4, x5, and x6' by using a 'fminsearch' function. 'eqq' contains x1, x2, ..., and x6 variables. The following are the code that I made and error message that I got when I run my code.
--------------------------------------------------- syms x1; syms x2; syms x3; syms x4; syms x5; syms x6;
P = zeros(2,2); P = [x1, 1-x1; 0, 1]; Q= zeros(2,3); Q = [x2, 1-x2, 0; 0, x3, 1-x3];
N=2; ppi_01 = 1; ppi_02 = 0; Tr = [0.13, 0.18, 0.31, 0.49, 0.53, 0.53, 0.55, 0.8, 1.44, 1.71, 1.82, 1.9, 1.99, 2.12, 2.15, 2.34, 2.54, 3.05, 3.36, 4.61];
ppi(1,1,1) = (ppi_01 * P(1,1) * Q(1,1) + ppi_02 * P(2,1) * Q(1,1)) / (ppi_01 * P(1,1) * Q(1,1) + ppi_01 * P(1,2) * Q(2,1) + ppi_02 * P(2,1) * Q(1,1) + ppi_02 * P(2,2) * Q(2,1)) ;
ppi(1,1,2) = (ppi_01 * P(1,1) * Q(1,2) + ppi_02 * P(2,1) * Q(1,2)) / (ppi_01 * P(1,1) * Q(1,2) + ppi_01 * P(1,2) * Q(2,2) + ppi_02 * P(2,1) * Q(1,2) + ppi_02 * P(2,2) * Q(2,2)) ;
ppi(1,1,3) = (ppi_01 * P(1,1) * Q(1,3) + ppi_02 * P(2,1) * Q(1,3)) / (ppi_01 * P(1,1) * Q(1,3) + ppi_01 * P(1,2) * Q(2,3) + ppi_02 * P(2,1) * Q(1,3) + ppi_02 * P(2,2) * Q(2,3)) ;
ppi(1,2,1) = (ppi_01 * P(1,2) * Q(2,1) + ppi_02 * P(2,2) * Q(2,1)) / (ppi_01 * P(1,1) * Q(1,1) + ppi_01 * P(1,2) * Q(2,1) + ppi_02 * P(2,1) * Q(1,1) + ppi_02 * P(2,2) * Q(2,1)) ;
ppi(1,2,2) = (ppi_01 * P(1,2) * Q(2,2) + ppi_02 * P(2,2) * Q(2,2)) / (ppi_01 * P(1,1) * Q(1,2) + ppi_01 * P(1,2) * Q(2,2) + ppi_02 * P(2,1) * Q(1,2) + ppi_02 * P(2,2) * Q(2,2)) ;
ppi(1,2,3) = (ppi_01 * P(1,2) * Q(2,3) + ppi_02 * P(2,2) * Q(2,3)) / (ppi_01 * P(1,1) * Q(1,3) + ppi_01 * P(1,2) * Q(2,3) + ppi_02 * P(2,1) * Q(1,3) + ppi_02 * P(2,2) * Q(2,3)) ;
ppi(2,1,1) = (ppi(1,1,1)*P(1,1)*Q(1,1) + ppi(1,2,1)*P(2,1)*Q(1,1)) / (ppi(1,1,1)*P(1,1)*Q(1,1) + ppi(1,1,1)*P(1,2)*Q(2,1) + ppi(1,2,1)*P(2,1)*Q(1,1) + ppi(1,2,1)*P(2,2)*Q(2,1)) ; % this will be used in the eq(14), eq(15), eq(16), theta1 = theta2 = 1
ppi(2,2,1) = (ppi(1,1,1)*P(1,2)*Q(2,1) + ppi(1,2,1)*P(2,2)*Q(2,1)) / (ppi(1,1,1)*P(1,1)*Q(1,1) + ppi(1,1,1)*P(1,2)*Q(2,1) + ppi(1,2,1)*P(2,1)*Q(1,1) + ppi(1,2,1)*P(2,2)*Q(2,1)) ; % same above ppi(2,1,2) = (ppi(1,1,1)*P(1,1)*Q(1,2) + ppi(1,2,1)*P(2,1)*Q(1,2)) / (ppi(1,1,1)*P(1,1)*Q(1,2) + ppi(1,1,1)*P(1,2)*Q(2,2) + ppi(1,2,1)*P(2,1)*Q(1,2) + ppi(1,2,1)*P(2,2)*Q(2,2)) ; % this will be used in eq(18)
ppi(2,2,2) = (ppi(1,1,1)*P(1,2)*Q(2,2) + ppi(1,2,1)*P(2,2)*Q(2,2)) / (ppi(1,1,1)*P(1,1)*Q(1,2) + ppi(1,1,1)*P(1,2)*Q(2,2) + ppi(1,2,1)*P(2,1)*Q(1,2) + ppi(1,2,1)*P(2,2)*Q(2,2)) ; % this will be used in eq(18)
ppi(3,1,1) = (ppi(2,1,2)*P(1,1)*Q(1,1) + ppi(2,2,2)*P(2,1)*Q(1,1)) / (ppi(2,1,2)*P(1,1)*Q(1,1) + ppi(2,1,2)*P(1,2)*Q(2,1) + ppi(2,2,2)*P(2,1)*Q(1,1) + ppi(2,2,2)*P(2,2)*Q(2,1)) ; % this will be used in eq(18)
ppi(3,2,1) = (ppi(2,1,2)*P(1,2)*Q(2,1) + ppi(2,2,2)*P(2,2)*Q(2,1)) / (ppi(2,1,2)*P(1,1)*Q(1,1) + ppi(2,1,2)*P(1,2)*Q(2,1) + ppi(2,2,2)*P(2,1)*Q(1,1) + ppi(2,2,2)*P(2,2)*Q(2,1)) ; % this will be used in eq(18)
ppi(3,1,2) = (ppi(2,1,2)*P(1,1)*Q(1,2) + ppi(2,2,2)*P(2,1)*Q(1,2)) / (ppi(2,1,2)*P(1,1)*Q(1,2) + ppi(2,1,2)*P(1,2)*Q(2,2) + ppi(2,2,2)*P(2,1)*Q(1,2) + ppi(2,2,2)*P(2,2)*Q(2,2)) ; % this will be used in eq(19)
ppi(3,2,2) = (ppi(2,1,2)*P(1,2)*Q(2,2) + ppi(2,2,2)*P(2,2)*Q(2,2)) / (ppi(2,1,2)*P(1,1)*Q(1,2) + ppi(2,1,2)*P(1,2)*Q(2,2) + ppi(2,2,2)*P(2,1)*Q(1,2) + ppi(2,2,2)*P(2,2)*Q(2,2)) ; % this will be used in eq(19)
ppi(3,1,1,1) = (ppi(2,1,1)*P(1,1)*Q(1,1) + ppi(2,2,1)*P(2,1)*Q(1,1)) / (ppi(2,1,1)*P(1,1)*Q(1,1) + ppi(2,1,1)*P(1,2)*Q(2,1) + ppi(2,2,1)*P(2,1)*Q(1,1) + ppi(2,2,1)*P(2,2)*Q(2,1)) ;
ppi(3,2,1,1) = (ppi(2,1,1)*P(1,2)*Q(2,1) + ppi(2,2,1)*P(2,2)*Q(2,1)) / (ppi(2,1,1)*P(1,1)*Q(1,1) + ppi(2,1,1)*P(1,2)*Q(2,1) + ppi(2,2,1)*P(2,1)*Q(1,1) + ppi(2,2,1)*P(2,2)*Q(2,1)) ;
ppi(4,1,1) = (ppi(3,1,1,1)*P(1,1)*Q(1,1) + ppi(3,2,1,1)*P(2,1)*Q(1,1)) / (ppi(3,1,1,1)*P(1,1)*Q(1,1) + ppi(3,1,1,1)*P(1,2)*Q(2,1) + ppi(3,2,1,1)*P(2,1)*Q(1,1) + ppi(3,2,1,1)*P(2,2)*Q(2,1)) ;
ppi(4,2,1) = (ppi(3,1,1,1)*P(1,2)*Q(2,1) + ppi(3,2,1,1)*P(2,2)*Q(2,1)) / (ppi(3,1,1,1)*P(1,1)*Q(1,1) + ppi(3,1,1,1)*P(1,2)*Q(2,1) + ppi(3,2,1,1)*P(2,1)*Q(1,1) + ppi(3,2,1,1)*P(2,2)*Q(2,1)) ;
syms t; % for calculating the integral variable
eq(1) = ppi_01 * exp(- exp(x6 * 1) * (Tr(1)/x5)^x4) * x4/x5 * (Tr(1)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(1)/x5)^x4) * x4/x5 * (Tr(1)/x5)^(x4-1) * exp(x6*2);
eq(2) = ppi_01 * exp(- exp(x6 * 1) * (Tr(2)/x5)^x4) * x4/x5 * (Tr(2)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(2)/x5)^x4) * x4/x5 * (Tr(2)/x5)^(x4-1) * exp(x6*2);
eq(3) = ppi_01 * exp(- exp(x6 * 1) * (Tr(3)/x5)^x4) * x4/x5 * (Tr(3)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(3)/x5)^x4) * x4/x5 * (Tr(3)/x5)^(x4-1) * exp(x6*2);
eq(4) = ppi_01 * exp(- exp(x6 * 1) * (Tr(4)/x5)^x4) * x4/x5 * (Tr(4)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(4)/x5)^x4) * x4/x5 * (Tr(4)/x5)^(x4-1) * exp(x6*2);
eq(5) = ppi_01 * exp(- exp(x6 * 1) * (Tr(5)/x5)^x4) * x4/x5 * (Tr(5)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(5)/x5)^x4) * x4/x5 * (Tr(5)/x5)^(x4-1) * exp(x6*2);
eq(6) = ppi_01 * exp(- exp(x6 * 1) * (Tr(6)/x5)^x4) * x4/x5 * (Tr(6)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(6)/x5)^x4) * x4/x5 * (Tr(6)/x5)^(x4-1) * exp(x6*2);
eq(7) = ppi_01 * exp(- exp(x6 * 1) * (Tr(7)/x5)^x4) * x4/x5 * (Tr(7)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(7)/x5)^x4) * x4/x5 * (Tr(7)/x5)^(x4-1) * exp(x6*2);
eq(8) = ppi_01 * exp(- exp(x6 * 1) * (Tr(8)/x5)^x4) * x4/x5 * (Tr(8)/x5)^(x4-1) * exp(x6*1) + ppi_02 * exp(- exp(x6*2) * (Tr(8)/x5)^x4) * x4/x5 * (Tr(8)/x5)^(x4-1) * exp(x6*2); % from equ(1) to equ(8) Tr is below 1
eq(9) = ( ppi_01*P(1,1)*Q(1,3) + ppi_01*P(1,2)*Q(2,3) + ppi_02*P(2,1)*Q(1,3) + ppi_02*P(2,2)*Q(2,3) ) * ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,3) * exp(- exp(x6 * 1) * ( ( (Tr(9)) / x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(9))/x5)^(x4-1) * exp(x6*1) + ppi(1,2,3) * exp(- exp(x6*2) * (((Tr(9))/x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(9)-1)/x5)^(x4-1) * exp(x6*2) ); % Tr(i), theta in Q(j,thata) and theta in ppi(k,i,theta) should be changed
eq(10) = ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1) * exp(- exp(x6 * 1) * ( ( (Tr(10)) / x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(10))/x5)^(x4-1) * exp(x6*1) + ppi(1,2,1) * exp(- exp(x6*2) * (((Tr(10))/x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(10))/x5)^(x4-1) * exp(x6*2) );
eq(11) = ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1) * exp(- exp(x6 * 1) * ( ( (Tr(11)) / x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(11))/x5)^(x4-1) * exp(x6*1) + ppi(1,2,1) * exp(- exp(x6*2) * (((Tr(11))/x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(11))/x5)^(x4-1) * exp(x6*2) );
eq(12) = ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1) * exp(- exp(x6 * 1) * ( ( (Tr(12)) / x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(12))/x5)^(x4-1) * exp(x6*1) + ppi(1,2,1) * exp(- exp(x6*2) * (((Tr(12))/x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(12))/x5)^(x4-1) * exp(x6*2) );
eq(13) = ( ppi_01*P(1,1)*Q(1,2) + ppi_01*P(1,2)*Q(2,2) + ppi_02*P(2,1)*Q(1,2) + ppi_02*P(2,2)*Q(2,2) ) * ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,2) * exp(- exp(x6 * 1) * ( ( (Tr(13)) / x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(13))/x5)^(x4-1) * exp(x6*1) + ppi(1,2,2) * exp(- exp(x6*2) * (((Tr(13))/x5)^x4 - (1/x5)^x4)) * x4/x5 * ((Tr(13))/x5)^(x4-1) * exp(x6*2) );
eq(14) = ( ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi(1,1,1)*P(1,1)*Q(1,1) + ppi(1,1,1)*P(1,2)*Q(2,1) + ppi(1,2,1)*P(2,1)*Q(1,1) + ppi(1,2,1)*P(2,2)*Q(2,1)) ) * ( ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,1,2)) + ppi(1,2,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,1,2)) ) ) * ( ( ppi(2,1,1) * exp(- exp(x6 * 1) * ( ( (Tr(14)) / x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(14))/x5)^(x4-1) * exp(x6*1) + ppi(2,2,1) * exp(- exp(x6*2) * (((Tr(14))/x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(14))/x5)^(x4-1) * exp(x6*2) ) );
eq(15) = ( ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi(1,1,1)*P(1,1)*Q(1,1) + ppi(1,1,1)*P(1,2)*Q(2,1) + ppi(1,2,1)*P(2,1)*Q(1,1) + ppi(1,2,1)*P(2,2)*Q(2,1)) ) * ( ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,1,2)) + ppi(1,2,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,1,2)) ) ) * ( ( ppi(2,1,1) * exp(- exp(x6 * 1) * ( ( (Tr(15)) / x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(15))/x5)^(x4-1) * exp(x6*1) + ppi(2,2,1) * exp(- exp(x6*2) * (((Tr(15))/x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(15))/x5)^(x4-1) * exp(x6*2) ) );
eq(16) = ( ( ppi_01*P(1,1)*Q(1,2) + ppi_01*P(1,2)*Q(2,2) + ppi_02*P(2,1)*Q(1,2) + ppi_02*P(2,2)*Q(2,2) ) * ( ppi(1,1,2)*P(1,1)*Q(1,2) + ppi(1,1,2)*P(1,2)*Q(2,2) + ppi(1,2,2)*P(2,1)*Q(1,2) + ppi(1,2,2)*P(2,2)*Q(2,2)) ) * ( ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,2)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,1,2)) + ppi(1,2,2)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,1,2)) ) ) * ( ( ppi(2,1,2) * exp(- exp(x6 * 1) * ( ( (Tr(16)) / x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(16))/x5)^(x4-1) * exp(x6*1) + ppi(2,2,2) * exp(- exp(x6*2) * (((Tr(16))/x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(16))/x5)^(x4-1) * exp(x6*2) ) ); % I didn't define the value of ppi(2,1,2) and ppi(2,2,2)
eq(17) = ( ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi(1,1,1)*P(1,1)*Q(1,1) + ppi(1,1,1)*P(1,2)*Q(2,1) + ppi(1,2,1)*P(2,1)*Q(1,1) + ppi(1,2,1)*P(2,2)*Q(2,1)) ) * ( ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,1,2)) + ppi(1,2,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,1,2)) ) ) * ( ( ppi(2,1,1) * exp(- exp(x6 * 1) * ( ( (Tr(17)) / x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(17))/x5)^(x4-1) * exp(x6*1) + ppi(2,2,1) * exp(- exp(x6*2) * (((Tr(17))/x5)^x4 - (2/x5)^x4)) * x4/x5 * ((Tr(17))/x5)^(x4-1) * exp(x6*2) ) );
eq(18) = ( ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi(1,1,1)*P(1,1)*Q(1,2) + ppi(1,1,1)*P(1,2)*Q(2,2) + ppi(1,2,1)*P(2,1)*Q(1,2) + ppi(1,2,1)*P(2,2)*Q(2,2) ) * ( ppi(2,1,2)*P(1,1)*Q(1,1) + ppi(2,1,2)*P(1,2)*Q(2,1) + ppi(2,2,2)*P(2,1)*Q(1,1) + ppi(2,2,2)*P(2,2)*Q(2,1)) ) * ( ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,1,2)) + ppi(1,2,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,1,2)) ) * ( ppi(2,1,2)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,2,3)) + ppi(2,2,2)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,2,3)) ) ) * ( ppi(3,1,1) * exp(- exp(x6 * 1) * ( (Tr(18)/x5)^x4 - (3/x5)^x4)) * x4/x5 * (Tr(18)/x5)^(x4-1) * exp(x6*1) + ppi(3,2,1) * exp(- exp(x6 * 2) * ( (Tr(18)/x5)^x4 - (3/x5)^x4)) * x4/x5 * (Tr(18)/x5)^(x4-1) * exp(x6*2) );
eq(19) = ( ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi(1,1,1)*P(1,1)*Q(1,2) + ppi(1,1,1)*P(1,2)*Q(2,2) + ppi(1,2,1)*P(2,1)*Q(1,2) + ppi(1,2,1)*P(2,2)*Q(2,2) ) * ( ppi(2,1,2)*P(1,1)*Q(1,1) + ppi(2,1,2)*P(1,2)*Q(2,1) + ppi(2,2,2)*P(2,1)*Q(1,1) + ppi(2,2,2)*P(2,2)*Q(2,1)) ) * ( ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,1,2)) + ppi(1,2,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,1,2)) ) * ( ppi(2,1,2)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,2,3)) + ppi(2,2,2)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,2,3)) ) ) * ( ppi(3,1,2) * exp(- exp(x6 * 1) * ( (Tr(19)/x5)^x4 - (3/x5)^x4)) * x4/x5 * (Tr(19)/x5)^(x4-1) * exp(x6*1) + ppi(3,2,2) * exp(- exp(x6 * 2) * ( (Tr(19)/x5)^x4 - (3/x5)^x4)) * x4/x5 * (Tr(19)/x5)^(x4-1) * exp(x6*2) );
eq(20) = ( ( ppi_01*P(1,1)*Q(1,1) + ppi_01*P(1,2)*Q(2,1) + ppi_02*P(2,1)*Q(1,1) + ppi_02*P(2,2)*Q(2,1) ) * ( ppi(1,1,1)*P(1,1)*Q(1,1) + ppi(1,1,1)*P(1,2)*Q(2,1) + ppi(1,2,1)*P(2,1)*Q(1,1) + ppi(1,2,1)*P(2,2)*Q(2,1) ) * ( ppi(2,1,1)*P(1,1)*Q(1,1) + ppi(2,1,1)*P(1,2)*Q(2,1) + ppi(2,2,1)*P(2,1)*Q(1,1) + ppi(2,2,1)*P(2,2)*Q(2,1)) * ( ppi(3,1,1)*P(1,1)*Q(1,1) + ppi(3,1,1)*P(1,2)*Q(2,1) + ppi(3,2,1)*P(2,1)*Q(1,1) + ppi(3,2,1)*P(2,2)*Q(2,1)) ) * ( ( ppi_01*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,0,1)) + ppi_02*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,0,1)) ) * ( ppi(1,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,1,2)) + ppi(1,2,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,1,2)) ) * ( ppi(2,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,2,3)) + ppi(2,2,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,2,3)) ) * ( ppi(3,1,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(x6),t,3,4)) + ppi(3,2,1,1)*exp(-int(x4/x5*(t/x5)^(x4-1)*exp(2*x6),t,3,4)) ) ) * ( ppi(4,1,1) * exp(- exp(x6 * 1) * ( (Tr(20)/x5)^x4 - (4/x5)^x4)) * x4/x5 * (Tr(20)/x5)^(x4-1) * exp(x6*1) + ppi(4,2,1) * exp(- exp(x6 * 2) * ( (Tr(20)/x5)^x4 - (4/x5)^x4)) * x4/x5 * (Tr(20)/x5)^(x4-1) * exp(x6*2) );
eqq = (-(log(eq(1)) + log(eq(2)) + log(eq(3)) + log(eq(4)) + log(eq(5)) + log(eq(6)) + log(eq(7)) + log(eq(8)) + log(eq(9)) + log(eq(10)) + log(eq(11)) + log(eq(12)) + log(eq(13)) + log(eq(14)) + log(eq(15)) + log(eq(16)) + log(eq(17)) + log(eq(18)) + log(eq(19)) + log(eq(20))));
x0 = [0;0;0;0;0;0];
[x,fval] = fminsearch( @(x1,x2,x3,x4,x5,x6)eqq, x0) ------------------------------------------------------------------ Here is the error message
??? The following error occurred converting from sym to double: Error using ==> mupadmex Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in ==> fminsearch at 191 fv(:,1) = funfcn(x,varargin{:});
Error in ==> main_variable_change_1 at 72 [x,fval] = fminsearch( @(x1,x2,x3,x4,x5,x6)eqq, x0) ----------------------------------------------------------------
Thank you for your reply previously

  0 件のコメント

サインイン to comment.

タグ

0 件の回答


Translated by