diff options
author | Shashank | 2017-05-29 12:40:26 +0530 |
---|---|---|
committer | Shashank | 2017-05-29 12:40:26 +0530 |
commit | 0345245e860375a32c9a437c4a9d9cae807134e9 (patch) | |
tree | ad51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/simulated_annealing/macros | |
download | scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2 scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip |
CMSCOPE changed
Diffstat (limited to 'modules/simulated_annealing/macros')
31 files changed, 422 insertions, 0 deletions
diff --git a/modules/simulated_annealing/macros/accept_func_default.bin b/modules/simulated_annealing/macros/accept_func_default.bin Binary files differnew file mode 100755 index 000000000..d656bafb6 --- /dev/null +++ b/modules/simulated_annealing/macros/accept_func_default.bin diff --git a/modules/simulated_annealing/macros/accept_func_default.sci b/modules/simulated_annealing/macros/accept_func_default.sci new file mode 100755 index 000000000..6a262b5a7 --- /dev/null +++ b/modules/simulated_annealing/macros/accept_func_default.sci @@ -0,0 +1,12 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function Level = accept_func_default(F_current, F_neigh, T) + Level = exp(-(F_neigh - F_current)/max(T,%eps)); +endfunction diff --git a/modules/simulated_annealing/macros/accept_func_vfsa.bin b/modules/simulated_annealing/macros/accept_func_vfsa.bin Binary files differnew file mode 100755 index 000000000..387c36a59 --- /dev/null +++ b/modules/simulated_annealing/macros/accept_func_vfsa.bin diff --git a/modules/simulated_annealing/macros/accept_func_vfsa.sci b/modules/simulated_annealing/macros/accept_func_vfsa.sci new file mode 100755 index 000000000..c43110544 --- /dev/null +++ b/modules/simulated_annealing/macros/accept_func_vfsa.sci @@ -0,0 +1,12 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function Level = accept_func_vfsa(F_current, F_neigh, T) + Level = 1 / (1 + exp(-(F_current - F_neigh)/max(T,%eps))); +endfunction diff --git a/modules/simulated_annealing/macros/buildmacros.bat b/modules/simulated_annealing/macros/buildmacros.bat new file mode 100755 index 000000000..c4e35ec40 --- /dev/null +++ b/modules/simulated_annealing/macros/buildmacros.bat @@ -0,0 +1 @@ +@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit;
\ No newline at end of file diff --git a/modules/simulated_annealing/macros/buildmacros.sce b/modules/simulated_annealing/macros/buildmacros.sce new file mode 100755 index 000000000..fde92fe47 --- /dev/null +++ b/modules/simulated_annealing/macros/buildmacros.sce @@ -0,0 +1,14 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - INRIA +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +if (isdef("genlib") == %f) then + exec(SCI+"/modules/functions/scripts/buildmacros/loadgenlib.sce"); +end + +genlib("simulated_annealinglib","SCI/modules/simulated_annealing/macros",%f,%t); diff --git a/modules/simulated_annealing/macros/cleanmacros.bat b/modules/simulated_annealing/macros/cleanmacros.bat new file mode 100755 index 000000000..5079dfd71 --- /dev/null +++ b/modules/simulated_annealing/macros/cleanmacros.bat @@ -0,0 +1,3 @@ +@del *.bin 2>NUL +@del lib 2>NUL +@del names 2>NUL
\ No newline at end of file diff --git a/modules/simulated_annealing/macros/compute_initial_temp.bin b/modules/simulated_annealing/macros/compute_initial_temp.bin Binary files differnew file mode 100755 index 000000000..3e6064fba --- /dev/null +++ b/modules/simulated_annealing/macros/compute_initial_temp.bin diff --git a/modules/simulated_annealing/macros/compute_initial_temp.sci b/modules/simulated_annealing/macros/compute_initial_temp.sci new file mode 100755 index 000000000..73cf7192f --- /dev/null +++ b/modules/simulated_annealing/macros/compute_initial_temp.sci @@ -0,0 +1,62 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function T_init = compute_initial_temp(x0, cit_f, proba_init, ItMX, param) + + if (~isdef("param","local")) then + param = []; + end + + [neigh_func,err] = get_param(param,"neigh_func",neigh_func_default); + [type_accept,err] = get_param(param,"type_accept","sa"); + + if ~isdef("cit_f","local") then + error(sprintf(gettext("%s: cit_f is mandatory"),"compute_initial_temp")); + else + if typeof(cit_f)=="list" then + deff("y=_cit_f(x)","y=cit_f(1)(x, cit_f(2:$))"); + else + deff("y=_cit_f(x)","y=cit_f(x)"); + end + end + + f_list = []; + x_current = x0; + f_current = _cit_f(x_current); + f_list = [f_list f_current]; + + for i=1:ItMX + x_current = neigh_func(x_current, 0, param); + f_current = _cit_f(x_current); + f_list = [f_list f_current]; + end + + NbInc = 0; + f_sum = 0; + + for i=2:size(f_list,2) + if (f_list(i-1)<f_list(i)) then + NbInc = NbInc + 1; + f_sum = f_sum + (f_list(i)-f_list(i-1)); + end + end + + if (NbInc>0) then + f_sum = f_sum / NbInc; + end + + if type_accept=="sa" then + // proba_init = exp(-delta_f/T_init) -> -delta_f / log(proba_init) = T_init + T_init = - f_sum ./ log(proba_init); + elseif type_accept=="vfsa" then + T_init = abs(f_sum / log(1/proba_init - 1)); + else + error(sprintf(gettext("%s: error - wrong accept type"),"compute_initial_temp")); + end +endfunction diff --git a/modules/simulated_annealing/macros/lib b/modules/simulated_annealing/macros/lib Binary files differnew file mode 100755 index 000000000..dd6729d38 --- /dev/null +++ b/modules/simulated_annealing/macros/lib diff --git a/modules/simulated_annealing/macros/names b/modules/simulated_annealing/macros/names new file mode 100755 index 000000000..08f7187c7 --- /dev/null +++ b/modules/simulated_annealing/macros/names @@ -0,0 +1,13 @@ +accept_func_default +accept_func_vfsa +compute_initial_temp +neigh_func_csa +neigh_func_default +neigh_func_fsa +neigh_func_vfsa +optim_sa +temp_law_csa +temp_law_default +temp_law_fsa +temp_law_huang +temp_law_vfsa diff --git a/modules/simulated_annealing/macros/neigh_func_csa.bin b/modules/simulated_annealing/macros/neigh_func_csa.bin Binary files differnew file mode 100755 index 000000000..f716efb73 --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_csa.bin diff --git a/modules/simulated_annealing/macros/neigh_func_csa.sci b/modules/simulated_annealing/macros/neigh_func_csa.sci new file mode 100755 index 000000000..d1205e008 --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_csa.sci @@ -0,0 +1,21 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function x_neigh = neigh_func_csa(x_current, T, param) + if ~isdef("param","local") then + param = []; + end + + [Sigma,err] = get_param(param,"sigma",ones(size(x_current,1), size(x_current,2))); + [Min,err] = get_param(param,"min_bound",-%inf*ones(size(x_current,1),size(x_current,2))); + [Max,err] = get_param(param,"max_bound",%inf*ones(size(x_current,1),size(x_current,2))); + + x_neigh = x_current + Sigma.*sqrt(2)*T*grand(1,1,"nor",0,1); + x_neigh = max(min(x_neigh, Max),Min); +endfunction diff --git a/modules/simulated_annealing/macros/neigh_func_default.bin b/modules/simulated_annealing/macros/neigh_func_default.bin Binary files differnew file mode 100755 index 000000000..637cea254 --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_default.bin diff --git a/modules/simulated_annealing/macros/neigh_func_default.sci b/modules/simulated_annealing/macros/neigh_func_default.sci new file mode 100755 index 000000000..f22bc14a8 --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_default.sci @@ -0,0 +1,22 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function x_neigh = neigh_func_default(x_current, T, param) + if ~isdef("param","local") then + param = []; + end + + [sa_min_delta,err] = get_param(param,"min_delta",-0.1*ones(size(x_current,1),size(x_current,2))); + [sa_max_delta,err] = get_param(param,"max_delta",0.1*ones(size(x_current,1),size(x_current,2))); + [Min,err] = get_param(param,"min_bound",-%inf*ones(size(x_current,1),size(x_current,2))); + [Max,err] = get_param(param,"max_bound",%inf*ones(size(x_current,1),size(x_current,2))); + + x_neigh = x_current + (sa_max_delta - sa_min_delta).*grand(size(x_current,1),size(x_current,2),"def") + sa_min_delta; + x_neigh = max(min(x_neigh, Max),Min); +endfunction diff --git a/modules/simulated_annealing/macros/neigh_func_fsa.bin b/modules/simulated_annealing/macros/neigh_func_fsa.bin Binary files differnew file mode 100755 index 000000000..775dd92f9 --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_fsa.bin diff --git a/modules/simulated_annealing/macros/neigh_func_fsa.sci b/modules/simulated_annealing/macros/neigh_func_fsa.sci new file mode 100755 index 000000000..99bdd8bfc --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_fsa.sci @@ -0,0 +1,21 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function x_neigh = neigh_func_fsa(x_current, T, param) + if ~isdef("param","local") then + param = []; + end + + [Sigma,err] = get_param(param,"sigma",ones(size(x_current,1),size(x_current,2))); + [Min,err] = get_param(param,"min_bound",-%inf*ones(size(x_current,1),size(x_current,2))); + [Max,err] = get_param(param,"max_bound",%inf*ones(size(x_current,1),size(x_current,2))); + + x_neigh = x_current + T*Sigma.*tan(%pi*(grand(size(x_current,1),size(x_current,2),"def") - 0.5)); + x_neigh = max(min(x_neigh, Max),Min); +endfunction diff --git a/modules/simulated_annealing/macros/neigh_func_vfsa.bin b/modules/simulated_annealing/macros/neigh_func_vfsa.bin Binary files differnew file mode 100755 index 000000000..c25053461 --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_vfsa.bin diff --git a/modules/simulated_annealing/macros/neigh_func_vfsa.sci b/modules/simulated_annealing/macros/neigh_func_vfsa.sci new file mode 100755 index 000000000..78fcf4875 --- /dev/null +++ b/modules/simulated_annealing/macros/neigh_func_vfsa.sci @@ -0,0 +1,26 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function x_neigh = neigh_func_vfsa(x_current, T, param) + if ~isdef("param","local") then + param = []; + end + + [Delta,err] = get_param(param,"delta",0.1*ones(size(x_current,1), size(x_current,2))); + [Min,err] = get_param(param,"min_bound",-%inf*ones(size(x_current,1),size(x_current,2))); + [Max,err] = get_param(param,"max_bound",%inf*ones(size(x_current,1),size(x_current,2))); + + y = zeros(size(x_current,1), size(x_current,2)); + for i=1:length(y) + a = grand(1,1,"def"); + y(i) = sign(a-0.5)*T*((1+1/T)^abs(2*a-1)-1); + x_neigh(i) = x_current(i) + y(i)*Delta(i); + end + x_neigh = max(min(x_neigh, Max),Min); +endfunction diff --git a/modules/simulated_annealing/macros/optim_sa.bin b/modules/simulated_annealing/macros/optim_sa.bin Binary files differnew file mode 100755 index 000000000..992d8263d --- /dev/null +++ b/modules/simulated_annealing/macros/optim_sa.bin diff --git a/modules/simulated_annealing/macros/optim_sa.sci b/modules/simulated_annealing/macros/optim_sa.sci new file mode 100755 index 000000000..5f1fe6378 --- /dev/null +++ b/modules/simulated_annealing/macros/optim_sa.sci @@ -0,0 +1,135 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// Copyright (C) 2010 - DIGITEO - Michael Baudin +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function [x_best, f_best, mean_list, var_list, temp_list, f_history, x_history , iter ] = optim_sa(x0, sa_f, ItExt, ItInt, T0, Log, param) + // Simulated annealing + // x0 : initial solution + // f : objective function + // ItExt : number of temperature decrease + // ItInt : number of iterations during one temperature step + // T0 : initial temperature + // Log : print some message during the run of the optimization + // param : a parameter list. this list contains the neighobrhood ('neigh_func') and some parameters related to this neighborhood functions (see the + // related function to list the available parameters) + + [nargout, nargin] = argn(); + + if ~isdef("param","local") then + param = []; + end + + [temp_law,err] = get_param(param,"temp_law",temp_law_default); + [neigh_func,err] = get_param(param,"neigh_func",neigh_func_default); + [accept_func,err] = get_param(param,"accept_func",accept_func_default); + [output_func,err] = get_param(param,"output_func",[]); + + if (~isdef("Log","local")) then + Log = %F; + end + + if (nargout>=6) then + f_history_defined = %T; + f_history = list(); + else + f_history_defined = %F; + end + + if (nargout>=5) then + temp_list_defined = %T; + temp_list = []; + else + temp_list_defined = %F; + end + + if (nargout>=7) then + x_history_defined = %T; + x_history = list(); + else + x_history_defined = %F; + end + + if ~isdef("sa_f","local") then + error(gettext("optim_sa: sa_f is mandatory")); + else + if typeof(sa_f)=="list" then + deff("y=_sa_f(x)","y=sa_f(1)(x, sa_f(2:$))"); + else + deff("y=_sa_f(x)","y=sa_f(x)"); + end + end + + T = T0; + + // Some variables needed to record the behavior of the SA + var_list = []; + mean_list = []; + temp_list = []; + + x_current = x0; + f_current = _sa_f(x_current); + + x_best = x_current; + f_best = f_current; + + for iter=1:ItExt + if ( output_func <> [] ) then + stop = output_func ( iter , x_best , f_best , T , saparams ); + if (stop) then + break + end + end + + f_list = []; + x_list = list(); + for j=1:ItInt + x_neigh = neigh_func(x_current,T,param); + f_neigh = _sa_f(x_neigh); + if ((f_neigh<=f_current)|(accept_func(f_current,f_neigh,T)>grand(1,1,"def"))) then + x_current = x_neigh; + f_current = f_neigh; + end + + f_list = [f_list f_current]; + + if (f_best>f_current) then + x_best = x_current; + f_best = f_current; + end + + if (x_history_defined) then + x_list($+1) = x_current; + end + end + + if (temp_list_defined) then + temp_list = [temp_list T]; + end + if (x_history_defined) then + x_history($+1) = x_list; + end + if (f_history_defined) then + f_history($+1) = f_list; + end + + // Computation of step_mean and step_var + step_mean = mean(f_list); + step_var = stdev(f_list); + mean_list = [mean_list step_mean]; + var_list = [var_list step_var]; + + if (Log) then + printf(gettext("%s: Temperature step %d / %d - T = %f, E(f(T)) = %f var(f(T)) = %f f_best = %f\n"), "optim_sa", iter, ItExt, T, step_mean, step_var, f_best); + end + + T = temp_law(T, step_mean, step_var, iter, max(size(x_current)), param); + end +endfunction + + diff --git a/modules/simulated_annealing/macros/temp_law_csa.bin b/modules/simulated_annealing/macros/temp_law_csa.bin Binary files differnew file mode 100755 index 000000000..9e07f5240 --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_csa.bin diff --git a/modules/simulated_annealing/macros/temp_law_csa.sci b/modules/simulated_annealing/macros/temp_law_csa.sci new file mode 100755 index 000000000..d4a76b18d --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_csa.sci @@ -0,0 +1,12 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function T = temp_law_csa(T, step_mean, step_var, temp_stage, n,param) + T = T * log(1+temp_stage)/log(2+temp_stage); +endfunction diff --git a/modules/simulated_annealing/macros/temp_law_default.bin b/modules/simulated_annealing/macros/temp_law_default.bin Binary files differnew file mode 100755 index 000000000..83c4280a5 --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_default.bin diff --git a/modules/simulated_annealing/macros/temp_law_default.sci b/modules/simulated_annealing/macros/temp_law_default.sci new file mode 100755 index 000000000..fd5640abc --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_default.sci @@ -0,0 +1,19 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function T = temp_law_default(T, step_mean, step_var, temp_stage, n,param) + if (~isdef("param","local")) then + param = []; // First create the empty var param + end + + [Beta,err] = get_param(param,"beta",0); + [_alpha,err] = get_param(param,"alpha",0.9); + + T = _alpha*T; +endfunction diff --git a/modules/simulated_annealing/macros/temp_law_fsa.bin b/modules/simulated_annealing/macros/temp_law_fsa.bin Binary files differnew file mode 100755 index 000000000..afa61fcca --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_fsa.bin diff --git a/modules/simulated_annealing/macros/temp_law_fsa.sci b/modules/simulated_annealing/macros/temp_law_fsa.sci new file mode 100755 index 000000000..c9232eb7a --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_fsa.sci @@ -0,0 +1,12 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function T = temp_law_fsa(T, step_mean, step_var, temp_stage, n, param) + T = T * (1+n)/(2+n); +endfunction diff --git a/modules/simulated_annealing/macros/temp_law_huang.bin b/modules/simulated_annealing/macros/temp_law_huang.bin Binary files differnew file mode 100755 index 000000000..fe934d353 --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_huang.bin diff --git a/modules/simulated_annealing/macros/temp_law_huang.sci b/modules/simulated_annealing/macros/temp_law_huang.sci new file mode 100755 index 000000000..764f9c2e4 --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_huang.sci @@ -0,0 +1,18 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function T = temp_law_huang(T, step_mean, step_var, temp_stage, n,param) + if (~isdef("param","local")) then + param = []; // First create the empty param var + end + + [lambda,err] = get_param(param,"lambda",0.01); + + T = T * exp(-lambda*T/step_var); +endfunction diff --git a/modules/simulated_annealing/macros/temp_law_vfsa.bin b/modules/simulated_annealing/macros/temp_law_vfsa.bin Binary files differnew file mode 100755 index 000000000..92c84b196 --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_vfsa.bin diff --git a/modules/simulated_annealing/macros/temp_law_vfsa.sci b/modules/simulated_annealing/macros/temp_law_vfsa.sci new file mode 100755 index 000000000..1392cb37e --- /dev/null +++ b/modules/simulated_annealing/macros/temp_law_vfsa.sci @@ -0,0 +1,19 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +function T = temp_law_vfsa(T, step_mean, step_var, temp_stage, n, param) + if (~isdef("param","local")) then + param = []; // First create the empty param var + end + + [c,err] = get_param(param,"c",0.01); + [dimension,err] = get_param(param,"dimension",3); + + T = T * (n/(n+1))^(1/dimension); +endfunction |