Changeset 1185 for applications/dual/SIDP/SIDPS/matlab
- Timestamp:
- 09/14/10 13:38:21 (14 years ago)
- Location:
- applications/dual/SIDP/SIDPS/matlab
- Files:
-
- 1 added
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/dual/SIDP/SIDPS/matlab/Beta.txt
r1181 r1185 1 1.0000000e-004 7. 3794257e-001 1.4757851e+000 2.2136277e+000 2.9514703e+000 3.6893128e+000 4.4271554e+000 5.1649980e+000 5.9028405e+000 6.6406831e+0001 1.0000000e-004 7.0280615e-001 1.4055123e+000 2.1082184e+000 2.8109246e+000 3.5136307e+000 4.2163369e+000 4.9190430e+000 5.6217492e+000 6.3244553e+000 -
applications/dual/SIDP/SIDPS/matlab/C.txt
r1181 r1185 1 9.6000000e-001 4.1904762e-002 1.3714286e-001 3.2380952e-002 9.1428571e-002 6.6666667e-002 1.3333333e-002 1.3333333e-002 0.0000000e+000 7.6190476e-0031 3.0533333e+000 1.5523810e+000 2.9333333e-001 1.9809524e-001 1.2000000e-001 1.0476190e-001 3.0476190e-002 7.8095238e-002 0.0000000e+000 2.4761905e-002 -
applications/dual/SIDP/SIDPS/matlab/choose_best_control.m
r1181 r1185 1 function best_control=choose_best_control(H,C,index, eta0,horizont,candidates,compare_parameters)1 function best_control=choose_best_control(H,C,index,apriori,horizont,candidates,compare_parameters) 2 2 num_of_candidates=size(candidates,1); 3 3 n_0=compare_parameters.n0; … … 8 8 C(index)=candidates(i); 9 9 for j=1:n_0 10 realization1(i,j)=generate_realization( eta0,index,H,C,horizont);10 realization1(i,j)=generate_realization(apriori,index,H,C,horizont); 11 11 end 12 12 end … … 40 40 C(index)=candidates(i); 41 41 for j=1:n_1 42 realization2(j)=generate_realization( eta0,index,H,C,horizont);42 realization2(j)=generate_realization(apriori,index,H,C,horizont); 43 43 end 44 44 mean_values(i)=mean_values(i)/(1+n_1/n_0)+mean(realization2)/(1+n_0/n_1); -
applications/dual/SIDP/SIDPS/matlab/generate_realization.m
r1181 r1185 1 function realization=generate_realization(eta,index,H,C,horizont) 1 function realization=generate_realization(apriori,index,H,C,horizont) 2 eta=apriori.eta0; 3 switch(apriori.Hc) 4 case(0) 5 eta=0; 6 case(1) 7 eta=eta*rand; 8 case(2) 9 %eta=eta*abs((1+randn)/5^(index-1)); 10 %eta=eta/10^(-floor(-H(index)/H(end)*size(H,2))-1); 11 eta=eta/10^H(index); 12 case(3) 13 %eta=eta/2*abs((1+randn)/5^(index-1)); 14 eta=eta/10^H(index)*rand; 15 end 16 2 17 realization=0; 3 18 beta=H(index); -
applications/dual/SIDP/SIDPS/matlab/interpol.m
r1181 r1185 5 5 else 6 6 if (pom(end)<0 || pom(end)==0) 7 rizeni=C(end) ;7 rizeni=C(end)*2^pom(end); 8 8 else 9 9 for i=2:size(H,2) -
applications/dual/SIDP/SIDPS/matlab/nastav.m
r1181 r1185 32 32 n_grid_max=30; 33 33 34 y0=1 ;35 b0= 1;34 y0=100; 35 b0=0; 36 36 P0=10; 37 Hc=0; 37 38 38 39 n0=20; … … 60 61 apriori.b0=b0; 61 62 apriori.P0=P0; 63 apriori.Hc=Hc; 62 64 end -
applications/dual/SIDP/SIDPS/matlab/sidp3.m
r1181 r1185 8 8 compare_parameters.rinott=4; 9 9 10 %apriori.eta0=abs(apriori.y0)/system.sigma;11 apriori.eta0=0;10 apriori.eta0=abs(apriori.y0)/system.sigma; 11 %apriori.eta0=0; 12 12 13 13 apriori.beta0=abs(apriori.b0)/sqrt(apriori.P0); … … 33 33 for k=1:sidp_parameters.n_grid 34 34 candidates=generate_candidates(C(k), search_region, sidp_parameters.num_of_candidates); 35 C(k)=choose_best_control(H,C,k,apriori .eta0,sidp_parameters.horizont,candidates,compare_parameters);35 C(k)=choose_best_control(H,C,k,apriori,sidp_parameters.horizont,candidates,compare_parameters); 36 36 end 37 37 … … 49 49 end 50 50 51 %subplot(2,1,1);52 %plot(H,C,['',col(j)]); hold on; a=max(a,max(C(:)));51 % subplot(2,1,1); 52 % plot(H,C,['',col(j)]); hold on; a=max(a,max(C(:))); 53 53 end 54 54 55 %xlabel('\fontsize{18} \beta'); ylabel('\fontsize{18} \nu^{ (2)}_0'); set(gca,'ylim',[0 a]); set(gca,'xlim',[0 H(end)]); legend('\pi_1','\pi_2','\pi_3','\pi_4');56 %subplot(2,1,2);57 %plot(0:sidp_parameters.n_iter,[w' x' ones(size(x,2),1)]); xlabel('\fontsize{18} iterace'); ylabel('\fontsize{18} relativn�tr�'); legend('mean','median');set(gca,'ylim',[0.99 max(w(1),x(1))]); set(gca,'xtick',0:sidp_parameters.n_iter); set( get(gcf, 'Children'), 'FontSize', 18);55 %xlabel('\fontsize{18} \beta'); ylabel('\fontsize{18} \nu^{ (2)}_0'); set(gca,'ylim',[0 a]); set(gca,'xlim',[0 H(end)]); legend('\pi_1','\pi_2','\pi_3','\pi_4'); 56 %subplot(2,1,2); 57 %plot(0:sidp_parameters.n_iter,[w' x' ones(size(x,2),1)]); xlabel('\fontsize{18} iterace'); ylabel('\fontsize{18} relativn�tr�'); legend('mean','median');set(gca,'ylim',[0.99 max(w(1),x(1))]); set(gca,'xtick',0:sidp_parameters.n_iter); set( get(gcf, 'Children'), 'FontSize', 18); 58 58 %[w;x] 59 59 end