Differences From Artifact [216203f9c6]:

To Artifact [9640440e1a]:


11
12
13
14
15
16
17



18
19
20
21
22
23
24
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27







+
+
+







# Copyright (c) P.J.Gawthrop, 1996.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.8  1996/09/13 17:54:08  peter
## Now writes default $PARAMS to $1_args.m - $1_ode may use it.
##
## Revision 1.7  1996/09/12 18:41:48  peter
## Standard error handling added.
##
## Revision 1.6  1996/08/24 14:11:04  peter
## Global parameter passing.
##
## Revision 1.5  1996/08/18 12:01:26  peter
49
50
51
52
53
54
55
56

57
58
59
60
61
62
63
52
53
54
55
56
57
58

59
60
61
62
63
64
65
66







-
+







else
  PARAMS=$2;
fi

PARAMS="$PARAMS ;"


$MATRIX << EOF > ode2odes_m.log 2>mtt_error
$MATRIX << EOF > ode2odes_m.log 2>mtt_error.txt

  %Read in parameters
  $1_numpar;

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

74
75
76
77
78
79
80
81
82












83
84

85
86
87
88
89
90
91

92
93
94
95
96
97
98
77
78
79
80
81
82
83


84
85
86
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103

104
105
106
107
108
109
110
111







-
-
+
+
+
+
+
+
+
+
+
+
+
+

-
+






-
+








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

if nx>0
  x = lsode('$1_ode', x0, T);
  write_matrix([T,x], '$1_odes');
%  x = lsode('$1_ode', x0, T);
%Euler integration
  x = x0;
  X=[];
  dt = T(2)-T(1);
  for t=T'
    X = [X x];
    dx = $1_ode(x,t);
    x = x + dx*dt;
  end;
  X = X';
  write_matrix([T,X], '$1_odes');
else
  x = zeros(size(T));
  X = zeros(size(T));
end;

if ny>0
  i=0;
  for tt=T'
    i=i+1;
    y(i,:) = $1_odeo(x(i,:),tt)';
    y(i,:) = $1_odeo(X(i,:),tt)';
  end;
  write_matrix([T,y], '$1_odeso');
end;

EOF

# Now invoke the standard error handling.

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