summaryrefslogtreecommitdiff
path: root/modules/optimization/demos/icse/README
blob: 362acf94eeae302f01d078221bfc5f02f28b9786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
              Use of ICSE within SCILAB

-1- The user must provide a ``simulator'' program for his problem:
 
      this simulator is made of a main routine :

      subroutine mysim(ind,nu,u,co,g,itv,rtv,dtv)
      external secmbr, cost, inist
      call icse(ind,nu,u,co,g,itv,rtv,dtv,secmbr,cost,inist)
      end

      and three additional subroutines secmbr, cost and inist

     where secmbr, cost, inist are symbolic name of particular routines
       secmbr : computes the RHS 
       cost   : computes the cost function
       inist  : computes the initial state

       cost may be replaced by the predefined routine icsec2 for quadratic cost.

       inist may be replaced by the predefined routine icsei for standard
            initialization.

 It is better to put the four routines in a single file called mysim.f

-2- compile (f77) the file mysim.f 

-3- Link mysim with scilab :
    link('mysim.o',mysim)

    Otherwise you have to link your program as follows:
 .modify the routines/default/foptim.f routine to add the call to mysim 
 .put your mysim.f file in the routines/default directory, 
 .append mysim.o in ICSE variable definition within routines/default/Makefile
 .re-generate a new scilab with the main Makefile