Overview
Comment:Included glabal parameter passing.
Proper error handling.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 5ca9342409cb255e0b6b76704b66fb043d47be2e2bf49cc8f69ad13abe82b2d6
User & Date: gawthrop@users.sourceforge.net on 1996-08-24 14:02:39
Other Links: branch diff | manifest | tags
Context
1996-08-24
14:16:25
Global parameter passing. check-in: 56cc8a5b8b user: gawthrop@users.sourceforge.net tags: origin/master, trunk
14:02:39
Included glabal parameter passing.
Proper error handling.
check-in: 5ca9342409 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:34:48
Initial revision check-in: 3da332b509 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/sm2sr_m from [ee5a83415e] to [0883abce2f].

12
13
14
15
16
17
18



19
20
21
22
23
24
25
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.9  1996/08/18 12:01:45  peter
## Unified format of time responses.
##
## Revision 1.8  1996/08/15 16:23:39  peter
## Uses T in place of t to avoid name clash within function.
##
## Revision 1.7  1996/08/15 11:54:32  peter







>
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.10  1996/08/19 15:34:14  peter
## Now based on state - not descriptor matrices.
##
## Revision 1.9  1996/08/18 12:01:45  peter
## Unified format of time responses.
##
## Revision 1.8  1996/08/15 16:23:39  peter
## Uses T in place of t to avoid name clash within function.
##
## Revision 1.7  1996/08/15 11:54:32  peter
47
48
49
50
51
52
53

54
55
56
57
58
59
60
61
62
63
64
65



66
67
68
69
70
71
72
###############################################################

echo Creating $1_sr.m
echo Creating $1_sro.m
rm -f sm2sr_m.log
rm -f $1_sr.m
rm -f $1_sro.m


if [ "$2" = "" ]; 
then
  PARAMS='T=[0:0.1:10];u0=ones(nu,1);x0=zeros(nx,1);'
  echo Using default parameter $PARAMS
else
  PARAMS=$2;
fi

PARAMS="$PARAMS ;"

$MATRIX << EOF > sm2sr_m.log




  [nx,ny,nu,nz,nyz] = $1_def;
  t=0;	%Just in case it appears in the parameter list.

  $PARAMS

  %Defaults







>











|
>
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
###############################################################

echo Creating $1_sr.m
echo Creating $1_sro.m
rm -f sm2sr_m.log
rm -f $1_sr.m
rm -f $1_sro.m
rm -f mtt_error

if [ "$2" = "" ]; 
then
  PARAMS='T=[0:0.1:10];u0=ones(nu,1);x0=zeros(nx,1);'
  echo Using default parameter $PARAMS
else
  PARAMS=$2;
fi

PARAMS="$PARAMS ;"

$MATRIX << EOF > sm2sr_m.log 2>mtt_error

  % Read in the numeric system parameters
  $1_numpar;

  [nx,ny,nu,nz,nyz] = $1_def;
  t=0;	%Just in case it appears in the parameter list.

  $PARAMS

  %Defaults
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102













  [n,m]=size(T);
  if m>n
    T=T';
  end;

  [A,B,C,D] = $1_sm($1_numpar);
  [y,x] = sm2sr(A,B,C,D,T,u0,x0);

  if nx>0
    write_matrix([T x], '$1_sr');
  end;
  if ny>0
    write_matrix([T y], '$1_sro');
  end;

EOF



















|











>
>
>
>
>
>
>
>
>
>
>
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120


  [n,m]=size(T);
  if m>n
    T=T';
  end;

  [A,B,C,D] = $1_sm;
  [y,x] = sm2sr(A,B,C,D,T,u0,x0);

  if nx>0
    write_matrix([T x], '$1_sr');
  end;
  if ny>0
    write_matrix([T y], '$1_sro');
  end;

EOF

err_length=$(wc -c <mtt_error)

# Test for errors and print if any
if [ $err_length != "0" ]
then
  echo MTT has failed with the following errors '...'
  cat mtt_error
  exit 1
else
  exit 0
fi


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]