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
|
# Arguments
system=$1;
system_def=$1_def.r
system_cse=$1_cse.r
system_scse=$1_scse.r
# Parameters
n=`echo $2 | sed 's/,/ /g' |wc -w`
echo $n_parameters
parameters=`echo $2 | sed 's/,/ /g' |\
awk '{
for (i=1; i<=NF; i++) {
printf("mttpar(%i,1) := %s;\n", i, $i);
printf("mttcoef(%i,1) := %ss;\n", i, $i);
}
}'`
matrix="matrix mttpar("$n",1); matrix mttcoef("$n",1);"
echo $parameters
echo $matrix
# Number of states
Nx=`grep "MTTNx " <$system_def | awk '{print $3}' | sed 's/;//'`
#Inform user
echo Creating $system_scse "(for parameters $2, $Nx states)"
|
|
<
>
>
>
>
>
>
|
>
>
>
>
>
|
>
|
>
|
>
|
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
46
47
48
49
50
51
52
53
54
55
|
# Arguments
system=$1;
system_def=$1_def.r
system_cse=$1_cse.r
system_scse=$1_scse.r
# Parameters
n=`echo $2 | sed 's/,/ /g' |wc -w` ## Number of parameters
## Parameter information for reduce.
parameters=`echo $2 | sed 's/,/ /g' |\
awk '{
for (i=1; i<=NF; i++) {
printf("mttpar(%i,1) := %s;\n", i, $i);
printf("mttcoef(%i,1) := %ss;\n", i, $i);
}
}'`
## Update sympar list.
echo Recreating $1_sympar.txt
# Zap any sensitivity coeficients
mv $1_sympar.txt mtt_junk
grep -v MTT_Sensitivity_Coefficients mtt_junk > $1_sympar.txt
# Create the new sens coeffs at end of list.
echo $2 | sed 's/,/ /g' |\
awk '{
for (i=1; i<=NF; i++) {
printf("%ss\tMTT_Sensitivity_Coefficients\n",$i);
}
}' >> $1_sympar.txt
touch $1_sympar.txt
matrix="matrix mttpar("$n",1); matrix mttcoef("$n",1);"
# Number of states
Nx=`grep "MTTNx " <$system_def | awk '{print $3}' | sed 's/;//'`
#Inform user
echo Creating $system_scse "(for parameters $2, $Nx states)"
|