cd v:\cursos\pos\otimiza\aulas what M-files in the current directory v:\cursos\pos\otimiza\aulas CATALIS fmincon1 minlp1 swarm EXTRATOR fminunc1 minlp2 test0 LUCRO fminusub minlp3 test1 MINQUA fun minlp4 test10 MODELO func44 minlp5 test11 Minqua44 gmilp1 minlp6 test12 Modelo44 gminlp1 minlpn test13 OPT_RES gminlp2 modelagem test14 PLANOS gminlp3 naturais test15 READ2 gminlp4 newton test16 SEMIDEF gminlp5 newton_h test17 SMODELO gminlp6 newton_mod test18 aurea gmodelagem newtont test19 bandem1 gmurray nlconst test1gn bfgs grad nlp_internal test1m bracket grg pareto18 test2 buscarnd gtest1 pareto19 test20 cgrad gtest10 pareto20 test21 checkbounds gtest12 pareto21 test22 coggins gtest13 powell test23 compdir gtest2 qpsub test3 complex gtest8 refino test4 dados_ex6_44 gtest9 restr test5 dfp hkjeeves restr1 test6 dual htest1 restr14 test7 ex2_karm htest10 restr15 test8 ex_karma htest2 restr16 test9 ex_qp1 htest9 restr17 teste_buscarnd ex_qp2 interior restr20 univar ex_qp3 karmarkar restr21 varmetr ex_swarm lmarqua rosembr visual exmilp lp_nlp set1 writearq exmilp2 milp setoptim xplot exmilprog milp1 sol_extrat exmilprog2 milprog sqp extrat minlp steepdes type minqua % Estimacao de parametros nao-lineares dados =[... 0 0 1 0.058 2 0.217 3 0.36 4 0.488 5 0.6 6 0.692 7 0.772 8 0.833 9 0.888 10 0.925]; t = dados(:,1); y_k = dados(:,2); clf plot(t,y_k,'o'), title('dados experimentais'), figure(gcf), pause % % modelo: f(t)_k = 1 - (a1 * exp(-t/a1) - a2 * exp (-t/a2))/(a1-a2) % a = [1 0.5]'; v=version; if v(1) > '4', OPTIONS=optimset('LargeScale','off','Display','iter','LevenbergMarquardt','on','LineSearchType','cubicpoly'); % OPTIONS=optimset('LargeScale','on','Display','iter'); [a,nres,res,eflag,out]=lsqnonlin('modelo',a,[],[],OPTIONS,dados); else OPTIONS=foptions; [a,OPTIONS,res]=leastsq('modelo',a,OPTIONS,[],dados); end disp('parametros do modelo:'); a e=modelo(a,dados); plot(t,y_k-e,t,y_k,'o'), title('modelo x dados'), figure(gcf); edit minqua disp(sprintf('%d',feature('SessionTool'))) 0 ; dbstatus dbstack dbstack ; disp(which('minqua')); v:\cursos\pos\otimiza\aulas\MINQUA.M mdbstatus 'v:\cursos\pos\otimiza\aulas\minqua.m' eval( 'if exist(''OPTIONS'',''var''), mauifunc(OPTIONS), end', ''); eval( 'if exist(''dados'',''var''), mauifunc(dados), end', ''); eval( 'if exist(''OPTIONS'',''var''), mauifunc(OPTIONS), end', ''); eval( 'if exist(''parametros'',''var''), mauifunc(parametros), end', ''); eval( 'if exist(''dados'',''var''), mauifunc(dados), end', ''); eval( 'if exist(''y_k'',''var''), mauifunc(y_k), end', ''); eval( 'if exist(''a'',''var''), mauifunc(a), end', ''); eval( 'if exist(''parametros'',''var''), mauifunc(parametros), end', ''); eval( 'if exist(''do'',''var''), mauifunc(do), end', ''); eval( 'if exist(''y_k'',''var''), mauifunc(y_k), end', ''); eval( 'if exist(''version'',''var''), mauifunc(version), end', ''); eval( 'if exist(''modelo'',''var''), mauifunc(modelo), end', ''); dbstack ; disp(which('modelo')); v:\cursos\pos\otimiza\aulas\MODELO.M mdbstatus 'v:\cursos\pos\otimiza\aulas\modelo.m' eval( 'if exist(''y_k'',''var''), mauifunc(y_k), end', ''); eval( 'if exist(''a'',''var''), mauifunc(a), end', ''); eval( 'if exist(''o'',''var''), mauifunc(o), end', ''); eval( 'if exist(''modelo'',''var''), mauifunc(modelo), end', ''); eval( 'if exist(''leastsq'',''var''), mauifunc(leastsq), end', ''); eval( 'if exist(''leastsq'',''var''), mauifunc(leastsq), end', ''); eval( 'if exist(''modelo'',''var''), mauifunc(modelo), end', ''); minqua Directional Iteration Func-count Residual Step-size derivative Lambda 1 2 1.25749 1 -2.17 2 5 770.103 1 1.1e+003 3 8 1.25654 0.000806 -1.18 364.981 4 11 1.2544 1 -0.00215 15.4765 5 14 1.20592 1 -0.0478 0.887845 6 17 0.732717 1 -0.4 0.154549 7 20 0.170594 1 -0.338 0.0503955 8 23 0.0129911 1 -0.0619 0.0210873 9 26 0.00113497 1 -0.00282 0.00974848 10 29 0.000900183 1 -2.98e-005 0.00470381 11 32 0.000896671 1 -2.65e-006 0.00176334 12 35 0.000891065 1 -5.61e-006 0.00058776 13 38 0.000881682 1 -7.97e-006 0.000173239 14 41 0.000875555 1 -3.11e-006 7.29566e-005 15 44 0.000874681 1 -2.48e-007 3.45136e-005 16 47 0.000874598 1 -1.02e-008 1.70098e-005 Optimization terminated successfully: Gradient in the search direction less than tolFun Gradient less than 10*(tolFun+tolX) parametros do modelo: a = 2.9866 1.9239 eval( 'if exist(''OPTIONS'',''var''), mauifunc(OPTIONS), end', ''); ActiveConstrTol: [] DerivativeCheck: [] Diagnostics: [] DiffMaxChange: [] DiffMinChange: [] Display: 'iter' GoalsExactAchieve: [] GradConstr: [] GradObj: [] Hessian: [] HessMult: [] HessPattern: [] HessUpdate: [] Jacobian: [] JacobMult: [] JacobPattern: [] LargeScale: 'off' LevenbergMarquardt: 'on' LineSearchType: 'cubicpoly' MaxFunEvals: [] MaxIter: [] MaxPCGIter: [] MeritFunction: [] MinAbsMax: [] Preconditioner: [] PrecondBandWidth: [] ShowStatusWindow: [] TolCon: [] TolFun: [] TolPCG: [] TolX: [] TypicalX: [] nres nres = 8.7459e-004 ;