Changeset 11446
- Timestamp:
- 02/14/12 16:28:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/classes/inversion.m ¶
r11276 r11446 8 8 iscontrol = 0 9 9 tao = 0 10 incomplete_adjoint = 0 10 11 control_parameters = NaN 11 12 nsteps = 0 … … 43 44 function obj = setdefaultparameters(obj) % {{{ 44 45 45 %parameter to be inferred by control methods (only 46 %drag and B are supported yet) 47 obj.control_parameters={'FrictionCoefficient'}; 46 %default is incomplete adjoint for now 47 obj.incomplete_adjoint=1; 48 48 49 %number of steps in the control methods 50 obj.nsteps=20; 49 %parameter to be inferred by control methods (only 50 %drag and B are supported yet) 51 obj.control_parameters={'FrictionCoefficient'}; 51 52 52 %maximum number of iteration in the optimization algorithm for 53 %each step 54 obj.maxiter_per_step=20*ones(obj.nsteps,1); 53 %number of steps in the control methods 54 obj.nsteps=20; 55 55 56 %the inversed parameter is updated as follows: 57 %new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1]; 58 %usually the gradient_scaling must be of the order of magnitude of the 59 %inversed parameter (10^8 for B, 50 for drag) and can be decreased 60 %after the first iterations 61 obj.gradient_scaling=50*ones(obj.nsteps,1); 56 %maximum number of iteration in the optimization algorithm for 57 %each step 58 obj.maxiter_per_step=20*ones(obj.nsteps,1); 62 59 63 %several responses can be used: 64 obj.cost_functions=101*ones(obj.nsteps,1); 60 %the inversed parameter is updated as follows: 61 %new_par=old_par + gradient_scaling(n)*C*gradient with C in [0 1]; 62 %usually the gradient_scaling must be of the order of magnitude of the 63 %inversed parameter (10^8 for B, 50 for drag) and can be decreased 64 %after the first iterations 65 obj.gradient_scaling=50*ones(obj.nsteps,1); 65 66 66 %step_threshold is used to speed up control method. When 67 %misfit(1)/misfit(0) < obj.step_threshold, we go directly to 68 %the next step 69 obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement. 67 %several responses can be used: 68 obj.cost_functions=101*ones(obj.nsteps,1); 70 69 71 %stop control solution at the gradient computation and return it? 72 obj.gradient_only=0; 70 %step_threshold is used to speed up control method. When 71 %misfit(1)/misfit(0) < obj.step_threshold, we go directly to 72 %the next step 73 obj.step_threshold=.7*ones(obj.nsteps,1); %30 per cent decrement. 73 74 74 %cost_function_threshold is a criteria to stop the control methods. 75 %if J[n]-J[n-1]/J[n] < criteria, the control run stops 76 %NaN if not applied 77 obj.cost_function_threshold=NaN; %not activated 75 %stop control solution at the gradient computation and return it? 76 obj.gradient_only=0; 77 78 %cost_function_threshold is a criteria to stop the control methods. 79 %if J[n]-J[n-1]/J[n] < criteria, the control run stops 80 %NaN if not applied 81 obj.cost_function_threshold=NaN; %not activated 78 82 79 83 end % }}} … … 87 91 88 92 checkfield(md,'inversion.iscontrol','values',[0 1]); 93 checkfield(md,'inversion.tao','values',[0 1]); 94 checkfield(md,'inversion.incomplete_adjoint','values',[0 1]); 89 95 checkfield(md,'inversion.control_parameters','cell',1,'values',{'BalancethicknessThickeningRate' 'FrictionCoefficient' 'MaterialsRheologyBbar' 'Vx' 'Vy'}); 90 96 checkfield(md,'inversion.nsteps','numel',1,'>=',1); … … 107 113 function disp(obj) % {{{ 108 114 fielddisplay(obj,'iscontrol','is inversion activated?'); 115 fielddisplay(obj,'incomplete_adjoint','do we assume linear viscosity?'); 109 116 fielddisplay(obj,'control_parameters','parameter where inverse control is carried out; ex: {''FrictionCoefficient''}, or {''MaterialsRheologyBbar''}'); 110 117 fielddisplay(obj,'nsteps','number of optimization searches'); … … 137 144 WriteData(fid,'object',obj,'fieldname','iscontrol','format','Boolean'); 138 145 WriteData(fid,'object',obj,'fieldname','tao','format','Boolean'); 146 WriteData(fid,'object',obj,'fieldname','incomplete_adjoint','format','Boolean'); 139 147 if ~obj.iscontrol, return; end 140 148 WriteData(fid,'object',obj,'fieldname','nsteps','format','Integer');
Note:
See TracChangeset
for help on using the changeset viewer.