??? Input argument "x" is undefined.
Afficher commentaires plus anciens
I want to solve a set of nonlinear equations to get a set of six parameters x(1):x(6).These are my code:
function F = ParameterEstimation(x)
T = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12];
for T = [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12];
miu(T) = [1;2;3;4;5;6;7;8;9;10;11;12]; %%not the actual values
sigma(T)=[1;2;3;4;5;6;7;8;9;10;11;12];
delta(T)=[1;2;3;4;5;6;7;8;9;10;11;12];;
dryprob(T)=[1;2;3;4;5;6;7;8;9;10;11;12];
end
x0 = [0; 0; 0; 0; 0; 0];
for T=1:12
F = [miu(T)-(x(1)*x(6)*(1+(x(2)/x(3)))*(x(5)/(x(4)-1))*T);
k1-(2*x(1)*(1+(x(2)/x(3)))*x(6)^2+(x(1)*(1+(x(2)/x(3))*(x(6)^2)*x(3)/((x(3)^2)-1)))*(x(5)^x(4)/(x(4)-1)));
k2-(((x(1)*(1+(x(2)/x(3)))* x(2))/((x(3)^2)-1))*(x(5)^x(4)/(x(4)-1)));
sigma(T) -((((2*x(5))^(2-x(4)))/(x(4)-2)*(k1-(k2/x(3))))-(((2*x(5))^(2-x(4)))/((x(4)-2)*(x(4)-3))*(k1-(k2/x(3)^2)))+(2/((x(4)-2)*(x(4)-3)))*(k1*((T+x(5))^(3-x(4)))-(k2/x(3))*((x(3)*T+x(5))^(3-x(4)))));
delta(T) - ((k1/ (x(4)-2)*(x(4)-3))*(x(5)^(3-x(4))+(2*T+x(5)^(3-x(4)))-(2*(T+x(5))^(3-x(4))))+(k2/(x(3)^2*(x(4)-2)*(x(4)-3)))*(2*((x(3)*T+x(5))^(3-x(3))))-x(5)^(3-x(4))-((2*x(3)*T+x(5))^(3-x(4))));
f1 - ((x(1)*x(5)/(x(3)*(x(4)-1)))*(1+(x(3)*(x(2)+(x(3)/2)))-(1/4)*x(3)*(x(2)+x(3))*(x(2)+2*x(3))+(x(3)*(x(2)+x(3))*(4*x(2)^2+27*x(2)*x(3)+36*x(3)^2))/72));
f2 - (x(1)*x(5)/((x(2)+x(3))*(x(4)-1))*(1-x(2)-x(3)+(3/2)*x(3)*x(2)+x(3)^2+(x(2)^2/2)));
f3 - ((x(1)*x(5)/((x(2)+x(3))*(x(4)-1)))*(x(5)/(x(5)+T*(x(2)+x(3))))^(x(4)-1)*(1-x(4)-x(3)+(3/2)*x(3)*x(2)+x(3)^2+(x(2)^2/2)));
dryprob(T)- (exp(-x(1)*T-f1+f2+f3))];
end
options=optimset('Display','iter'); % Option to display output
[x,fval] = fsolve(ParameterEstimation,x0,options); % Call optimizer
p/s : i am very sorry since the equations are too long. but that's the real equations i hv to solve. Then, i got the error ??? Input argument "x" is undefined. and i dont know what it is and how to fix it :( please help me......
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Systems of Nonlinear Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!