2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) ????-2008 - INRIA
4 // Copyright (C) 2010 - DIGITEO - Yann COLLETTE
6 // This file is distributed under the same license as the Scilab package.
9 function [co,u,g,itv,dtv,cof]=icsua(u,simu,nap,imp)
10 // Computation of the optimal control with weighting of the initial control
11 // and arithmetic weighting of the observations.
12 // A scaling brings all the components of the control to 1.
13 // The initially null componants stay null.
14 // Only works if the lower bound is positive.
15 // Weighting formula :
16 // cof(i,j)=nex / (abs(ob(1,j,i)) + ... + abs(ob(nex,j,i)) )
18 // [co,u,g,itv,dtv,cof]=icsua(u,simu,nap,imp)
21 // u(nu) : initial parameters
22 // nap : maximum number of call to the simulator
23 // imp : debug value during optimization
26 // u(nu) : final parameters
27 // g(nu) : finale gradient
28 // itv(nitv) : work area (fortran integers)
29 // dtv(ndtv) : work area (fortran double precision)
30 // cof(nob,ntob) : weighting coefficient of the cost
31 // Use the macros icot and icob to extract the state
35 error("call to icsua with binf not strictly positive");
38 u(1,i)=max( [binf(1,i),min([u(1,i),bsup(1,i)])] )
45 yob = 0.d0*ones(nob,ntob);
47 [cof] = fort("icscof",ico,1,"i",ntob,2,"i",nex,3,"i",...
48 nob,4,"i",yob,5,"d",ob,6,"d","sort",[1,nob*ntob],7,"d");
49 [co,u,g,itv,dtv] = icsegen(u,simu,nap,imp);