10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright (c) P.J.Gawthrop, 1991, 1994.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.2 2001/07/13 04:54:04 geraint
## Branch merge: numerical-algebraic-solution back to main.
##
## Revision 1.1.4.1 2001/05/04 04:07:24 geraint
## Numerical solution of algebraic equations.
## sys_ae.cc written for unsolved inputs.
## Solution of equations using hybrd from MINPACK (as used by Octave fsolve).
|
>
>
>
>
>
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# Copyright (c) P.J.Gawthrop, 1991, 1994.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.3.4.1 2002/09/03 23:44:43 geraint
## adding global optimisation (-optg).
##
## Revision 1.3 2001/07/27 23:29:10 geraint
## Optimises only when requested (-opt).
##
## Revision 1.2 2001/07/13 04:54:04 geraint
## Branch merge: numerical-algebraic-solution back to main.
##
## Revision 1.1.4.1 2001/05/04 04:07:24 geraint
## Numerical solution of algebraic equations.
## sys_ae.cc written for unsolved inputs.
## Solution of equations using hybrd from MINPACK (as used by Octave fsolve).
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
## Initial revision
##
###############################################################
optimise=''; optimise_msg=''
while [ -n "`echo $1 | grep '^-'`" ]; do
case $1 in
-optimise)
optimise='-optimise'
optimise_msg=' with optimisation' ;;
*)
echo "$1 is an invalid argument - ignoring" ;;
esac
shift
done
# Create the reduce output code
def2write_r $optimise $1 ode
def2write_r $optimise $1 odeo
#Inform user
echo Creating $1_ode.r $optimise_msg
echo Creating $1_odeo.r $optimise_msg
# Remove the old log file
rm -f cse2ode_r.log
|
|
|
|
>
>
>
|
|
|
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
## Initial revision
##
###############################################################
optimise=''; optimise_msg=''
while [ -n "`echo $1 | grep '^-'`" ]; do
case $1 in
-optimise_global )
optimise='-optimise_global'
optimise_msg=' with global optimisation' ;;
-optimise_local )
optimise='-optimise_local'
optimise_msg=' with local optimisation' ;;
*)
echo "$1 is an invalid argument - ignoring" ;;
esac
shift
done
# Create the reduce output code
def2write_r $1 ode
def2write_r $1 odeo
#Inform user
echo Creating $1_ode.r $optimise_msg
echo Creating $1_odeo.r $optimise_msg
# Remove the old log file
rm -f cse2ode_r.log
|
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
OUT "$1_odeo.r";
write "%File: $1_odeo.r";
in ("$1_odeo_write.r");
write "END;";
SHUT "$1_odeo.r";
quit;
EOF
# Now invoke the standard error handling.
mtt_error_r cse2ode_r.log
|
>
>
>
>
>
>
>
>
<
<
<
<
<
<
<
<
|
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
OUT "$1_odeo.r";
write "%File: $1_odeo.r";
in ("$1_odeo_write.r");
write "END;";
SHUT "$1_odeo.r";
quit;
EOF
if [ ${optimise:-""} = "-optimise_global" ]; then
mtt_optimise global $1 ode
mtt_optimise global $1 odeo
elif [ ${optimise:-""} = "-optimise_local" ]; then
mtt_optimise local $1 ode
mtt_optimise local $1 odeo
fi
# Now invoke the standard error handling.
mtt_error_r cse2ode_r.log
|