Changeset 98
- Timestamp:
- 06/05/13 16:00:10 (11 years ago)
- Location:
- altifloat
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
altifloat/scripts/floater_d_test.i
r86 r98 16 16 17 17 set_modeltime 0 18 19 #uniquement activer les trajectoires de type M model20 activ M only21 22 forward23 24 savestate r_float 0 i 0 A 3 ../obs_float/r_float_forward.dat25 26 activ D only27 28 #testdf 1 29 21 4 r 0.0001 0.000129 30 31 32 33 18 print_cost ON 34 19 … … 43 28 setm_ddf1 1.0 44 29 30 31 run_inc 32 goto fin 33 34 #uniquement activer les trajectoires de type M model 35 activ M only 36 37 forward 38 39 savestate r_float 0 i 0 A 3 ../obs_float/r_float_forward.dat 40 41 activ D only 42 43 #testdf 1 29 21 4 r 0.0001 0.0001 44 45 46 47 48 print_cost ON 49 50 setm_impres 3 51 setm_io 6 52 setm_mode 0 53 #set_nbiter 100 54 set_nbiter 20 55 setm_nsim 200 56 setm_dxmin 1.0e-12 57 setm_epsg 1.0e-12 58 setm_ddf1 1.0 59 45 60 RUNM 46 61 savestate r_cout_d 0 i 0 A 3 ../obs_float/r_cout_d_optim_1.dat … … 208 223 #testing the gradients of each module 209 224 225 fin -
altifloat/src/Yworkdir/Y2floater_delta.h
r86 r98 3399 3399 if (strcmp(argv[0], "update_uv") == 0) 3400 3400 update_uv(); 3401 else if (strcmp(argv[0], "run_inc") == 0) 3402 run_inc(argc, argv); 3401 3403 else codret=0; 3402 3404 return(codret); -
altifloat/src/floater.h
r86 r98 7 7 YREAL vr_dy=0; 8 8 9 10 11 //Options du run incrmental 12 int nb_extiter=6; 13 short inc_save=1; 14 char dirsave[50]="../obs_float/"; 15 char savename[50]="optim"; 16 extern float Y3ddf1; 9 17 //Declaration 10 18 … … 15 23 void after_it(int nit){ 16 24 17 printf("u_d(9,16)=%f %f %f %f\n",YS1_u_d(9,16),YS1_u_d(10,16),YS1_u_d(10,17),YS1_u_d(9,17));25 //printf("u_d(9,16)=%f %f %f %f\n",YS1_u_d(9,16),YS1_u_d(10,16),YS1_u_d(10,17),YS1_u_d(9,17)); 18 26 } 19 27 void forward_before(int ctrp){ … … 50 58 51 59 // } 60 61 void run_inc(int argv, char *argc[]) { 62 //Run the incremental optimisation 63 //1 forward of the complete model 64 //2 initialize du et dv to zero 65 //3 minimize the incremental cost function 66 //4 update u and v 67 68 /* 69 Options 70 nb_extiter : number of extern loop (default=6) 71 inc_save : save option 72 0 : no save 73 1 (default): save after each extern loop r_float,u and v 74 dirsave : directory in case inc_save>0 (default="../obs_float/") 75 savename : basename of save fils (default "optim") 76 */ 77 char filesave[100]; 78 int i; 79 80 char sactiv[20]="activ"; 81 char sMD[20]="M"; 82 char sonly[20]="only"; 83 char *liste[3]; 84 liste[0]=sactiv; 85 liste[1]=sMD; 86 liste[2]=sonly; 87 /*Check M1QN3 config*/ 88 if (YNbItRun<=0) 89 { printf("runm(2): number of run iteration not seted; use set_nbiter please\n"); 90 //return(0); 91 } 92 if (Y3ddf1<=0) 93 { printf("runm(2): expected positive fcost decrease missed; use setm_ddf1\n"); 94 //return(0); 95 } 96 if (YioInsertObsCtr<0) 97 printf("runm(2): warning : oh oh, run with no obs !!! \n"); 98 99 YTypeAdjust = ADJUST_M1QN3; //d'office avec M1QN3 100 101 //Savestate config 102 YioModulot = OFF; //On sauvegarde tous les pas de temps 103 YioWrite = ON; 104 // Yio_savestate(cdes[1], cdes[3], 0, cdes[7]); 105 YioState=0 ;//Save all states 106 YioBin=OFF; //ascii output 107 YioAscii=ON; //ascii output 108 YioAxes=ON; //save axe numbers 109 110 for (i=0;i<nb_extiter;i++) { 111 strcpy(liste[1],"M"); 112 Yactraj(3, liste); 113 Yset_modeltime(0); 114 before_it(1); 115 Yforward(-1, 0); 116 117 if (inc_save==1 && i>0) { 118 //save rfloat 119 YioTime=ON; 120 sprintf(filesave,"%sr_float_%s_%2d.dat",dirsave,savename,i+1); 121 Yio_savestate("r_float","i",0,filesave); 122 } 123 strcpy(liste[1],"D"); 124 Yactraj(3,liste); 125 Yset_modeltime(0); 126 127 128 Y3run ('0'); 129 update_uv(); 130 if (inc_save==1) { 131 132 133 //save u 134 YioTime=OFF; 135 sprintf(filesave,"%su%s%2d.dat",dirsave,savename,i+1); 136 Yio_savestate("u","ij",0,filesave); 137 138 //save v 139 sprintf(filesave,"%sv%s%2d.dat",dirsave,savename,i+1); 140 Yio_savestate("v","ij",0,filesave); 141 142 } 143 } 144 /*End of the optimization, we run another time the model to compute the final value of r_float 145 */ 146 strcpy(liste[1],"M"); 147 Yactraj(3, liste); 148 Yset_modeltime(0); 149 before_it(1); 150 Yforward(-1, 0); 151 152 } -
altifloat/src/floater_delta.d
r86 r98 113 113 //insert_fct arg load_aviso 114 114 insert_fct update_uv 115 insert_fct arg run_inc 115 116 116 -
altifloat/src/locate.h
r84 r98 5 5 int j_ll=(int)x; 6 6 int k_ll=(int)y; 7 if (j_ll==Yj & k_ll==Yk)7 if (j_ll==Yj && k_ll==Yk) 8 8 { 9 printf("j_ll=%d ; k_ll=%d\n",j_ll,k_ll);9 //printf("j_ll=%d ; k_ll=%d\n",j_ll,k_ll); 10 10 YS1_uinter(Yi,YTemps)=YS1_u(Yj,Yk);//la 1ere sortie du module uinter pour le floater i est la valeur du module u en Yj Yk 11 11 YS2_uinter(Yi,YTemps)=YS1_u(Yj+1,Yk); … … 32 32 int j_ll=(int)x; 33 33 int k_ll=(int)y; 34 if (j_ll==Yj & k_ll==Yk)34 if (j_ll==Yj && k_ll==Yk) 35 35 { 36 36 YG1_u(Yj,Yk)+=YG1_uinter(Yi,YTemps); -
altifloat/src/locate_d.h
r84 r98 5 5 int j_ll=YS1_xinter(Yi,YTemps); 6 6 int k_ll=YS5_xinter(Yi,YTemps); 7 if (j_ll==Yj & k_ll==Yk)7 if (j_ll==Yj && k_ll==Yk) 8 8 { 9 9 //printf("j_ll=%d ; k_ll=%d\n",j_ll,k_ll); … … 25 25 int j_ll=YS1_xinter(Yi,YTemps); 26 26 int k_ll=YS5_xinter(Yi,YTemps); 27 if (j_ll==Yj & k_ll==Yk)27 if (j_ll==Yj && k_ll==Yk) 28 28 { 29 29 YG1_u_d(Yj,Yk)+=YG1_uinter_d(Yi,YTemps); -
altifloat/src/r_cout_d.h
r86 r98 2 2 { 3 3 YS1=xd+YS1_r_float(Yi,YTemps); 4 printf("xd=%f x=%f\n",xd,YS1_r_float(Yi,YTemps));4 //printf("xd=%f x=%f\n",xd,YS1_r_float(Yi,YTemps)); 5 5 YS2=yd+YS2_r_float(Yi,YTemps); 6 6 -
altifloat/src/ur.h
r84 r98 7 7 vr_dx=(v2-v1)+(v1-v2-v3+v4)*(y-y1); 8 8 vr_dy=(v3-v1)+(v1-v2-v3+v4)*(x-x1); 9 printf("u1=%f ; u2=%f\n",u1,u2);9 //printf("u1=%f ; u2=%f\n",u1,u2); 10 10 } 11 11
Note: See TracChangeset
for help on using the changeset viewer.