File: do_setup.sci

package info (click to toggle)
scilab 2.4-1
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 55,196 kB
  • ctags: 38,019
  • sloc: ansic: 231,970; fortran: 148,976; tcl: 7,099; makefile: 4,585; sh: 2,978; csh: 154; cpp: 101; asm: 39; sed: 5
file content (32 lines) | stat: -rw-r--r-- 804 bytes parent folder | download
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
function wpar=do_setup(wpar)
// set integration parameters
// Copyright INRIA
if wpar(4)==[] then wpar(4)=100000;end
if wpar(3)==[] then wpar(3)=[1.d-4,1.d-6,1.d-10,wpar(4)+1];end
tolerances=wpar(3);
tf=wpar(4)
atol=tolerances(1);rtol=tolerances(2);ttol=tolerances(3);deltat=tolerances(4)
while %t do
  [ok,tf,atol,rtol,ttol,deltat]=getvalue('Set parameters',[
      'Final integration time';
      'Integrator absolute tolerance';
      'Integrator relative tolerance';
      'Tolerance on time'
      'deltat'],..
	  list('vec',1,'vec',1,'vec',1,'vec',1,'vec',1),..
	  [string([tf;atol;rtol;ttol;deltat])])
  if ~ok then break,end
  if or([tf,atol,rtol,ttol,deltat]<=0) then
    message('Parameter must  be positive')
  else
    wpar(3)=[atol;rtol;ttol;deltat]
    wpar(4)=tf
    break
  end
end