Differences From Artifact [e5d0e1820f]:

To Artifact [8e9033d762]:


1
2
3
4
5
6
7
8
9
10
11




12
13
14
15
16
17
18
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
    ######################################

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




## Revision 1.76  2002/05/08 14:14:55  geraint
## Tidied up ode2odes code - reduced interweaving of STANDALONE/OCTAVEDLD sections
##
## Revision 1.75  2002/05/07 13:48:42  geraint
## Improved clarity of code generated for -cc and -oct (except ode2odes).
## Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents.
##











>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/sh

     ###################################### 
     ##### Model Transformation Tools #####
    ######################################

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.77  2002/05/08 16:03:32  geraint
## Added mex support for ode2odes: mtt sys ode2odes mexglx.
## This mex stuff seems to require octave2.1-headers.
##
## Revision 1.76  2002/05/08 14:14:55  geraint
## Tidied up ode2odes code - reduced interweaving of STANDALONE/OCTAVEDLD sections
##
## Revision 1.75  2002/05/07 13:48:42  geraint
## Improved clarity of code generated for -cc and -oct (except ode2odes).
## Octave DEFUN_DLDs now call (rather than replace) their .cc equivalents.
##
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
}

void
${sys}_ode2odes (ColumnVector &state0, ColumnVector &numpar, ColumnVector &simpar)
{
  static double first, dt, last, stepfactor;
  first		= simpar (0);
  dt		= simpar (1);
  last		= simpar (2);
  stepfactor	= simpar (3);

  static ColumnVector	dx (MTTNX, 0.0);
  static ColumnVector	x (MTTNX, 0.0);
  static ColumnVector	u (MTTNU, 0.0);
  static ColumnVector	y (MTTNY, 0.0);








|
|







1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
}

void
${sys}_ode2odes (ColumnVector &state0, ColumnVector &numpar, ColumnVector &simpar)
{
  static double first, dt, last, stepfactor;
  first		= simpar (0);
  last		= simpar (1);
  dt		= simpar (2);
  stepfactor	= simpar (3);

  static ColumnVector	dx (MTTNX, 0.0);
  static ColumnVector	x (MTTNX, 0.0);
  static ColumnVector	u (MTTNU, 0.0);
  static ColumnVector	y (MTTNY, 0.0);

1153
1154
1155
1156
1157
1158
1159


1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
  state0	= mtt_state (numpar);

  ${sys}_ode2odes (state0, numpar, simpar);

  return 0;
}
#elif (CODEGENTARGET == OCTAVEDLD)


DEFUN_DLD (${sys}_ode2odes, args, ,
"Octave ode2odes representation of system with $method integration method\nUsage: mtt_data = ${sys}_ode2odes (state0, numpar, simpar)\n")
{
  static octave_value_list retval;

  static ColumnVector	state0 (MTTNX);
  static ColumnVector	numpar (MTTNPAR);
  static ColumnVector	simpar (8);
  
  int nargin = args.length ();
  switch (nargin)
    {
    case 3:
      simpar	= args(2).${vector_value} ();
      numpar	= args(1).${vector_value} ();
      state0	= args(0).${vector_value} ();
      break;
    case 2:
      simpar	= mtt_simpar ();
      numpar	= args(1).${vector_value} ();
      state0	= args(0).${vector_value} ();







>
>













|







1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
  state0	= mtt_state (numpar);

  ${sys}_ode2odes (state0, numpar, simpar);

  return 0;
}
#elif (CODEGENTARGET == OCTAVEDLD)
#include <mtt_simpar.hh>

DEFUN_DLD (${sys}_ode2odes, args, ,
"Octave ode2odes representation of system with $method integration method\nUsage: mtt_data = ${sys}_ode2odes (state0, numpar, simpar)\n")
{
  static octave_value_list retval;

  static ColumnVector	state0 (MTTNX);
  static ColumnVector	numpar (MTTNPAR);
  static ColumnVector	simpar (8);
  
  int nargin = args.length ();
  switch (nargin)
    {
    case 3:
      simpar	= mtt_simpar (args(2).map_value ());
      numpar	= args(1).${vector_value} ();
      state0	= args(0).${vector_value} ();
      break;
    case 2:
      simpar	= mtt_simpar ();
      numpar	= args(1).${vector_value} ();
      state0	= args(0).${vector_value} ();

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