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.51.2.1 2001/03/01 05:05:53 geraint
## Minor revisions.
##
## Revision 1.51 2001/02/19 06:33:19 geraint
## Removed operation form loop.
##
## Revision 1.50 2001/02/18 09:18:49 geraint
|
>
>
>
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.51.2.2 2001/03/02 00:45:21 geraint
## Separated Euler and Implicit methods in .cc code and dependencies.
##
## Revision 1.51.2.1 2001/03/01 05:05:53 geraint
## Minor revisions.
##
## Revision 1.51 2001/02/19 06:33:19 geraint
## Removed operation form loop.
##
## Revision 1.50 2001/02/18 09:18:49 geraint
|
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
#include <octave/${feval_header}>
#endif
#include "${sys}_def.h"
#include "${sys}_sympar.h"
#ifdef STANDALONE
extern ColumnVector F${sys}_input (
ColumnVector &x,
ColumnVector &y,
const double &t,
ColumnVector &par);
extern ColumnVector F${sys}_logic (
|
>
>
|
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
|
#include <octave/${feval_header}>
#endif
#include "${sys}_def.h"
#include "${sys}_sympar.h"
#ifdef STANDALONE
#include <csignal>
extern ColumnVector F${sys}_input (
ColumnVector &x,
ColumnVector &y,
const double &t,
ColumnVector &par);
extern ColumnVector F${sys}_logic (
|
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
|
fi
cat <<EOF >> $filename
inline void
mtt_write (const double &t,
ColumnVector &x,
ColumnVector &y,
const int &nrows)
{
static Matrix data;
static int row;
const int nx = x.length (), ny = y.length ();
register int col = 0;
if (0 == row)
data = Matrix (nrows, 1+ny+1+nx, 0.0);
data.elem (row, col) = t;
|
|
>
>
>
>
>
>
>
>
|
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
|
fi
cat <<EOF >> $filename
inline void
mtt_write (const double &t,
ColumnVector &x,
ColumnVector &y,
const int &nrows,
const bool aborting = false)
{
static Matrix data;
static int row;
if (aborting)
{
Matrix written_data = data.extract (0, 0, row-1, data.cols ()-1);
save_ascii_data_for_plotting (cout, written_data, "MTT_data");
}
const int nx = x.length (), ny = y.length ();
register int col = 0;
if (0 == row)
data = Matrix (nrows, 1+ny+1+nx, 0.0);
data.elem (row, col) = t;
|
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
|
#else // ! STANDALONE
set_global_value ("MTT_data", data);
#endif
}
}
#ifdef STANDALONE
int main (void) {
#else
DEFUN_DLD (${sys}_ode2odes, args, ,
"Octave ode2odes representation of system with $method integration method
Usage: ${sys}_ode2odes (x, par, simpar)
")
{
static octave_value_list retval;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
|
#else // ! STANDALONE
set_global_value ("MTT_data", data);
#endif
}
}
#ifdef STANDALONE
void handle_sigfpe (int i)
#ifdef __GNUC__
__attribute__ ((noreturn));
void handle_sigfpe (int i)
#endif // __GNUC__
{
ColumnVector null (0.0);
cerr << "Error: Caught floating point exception ..." << endl
<< " ... writing data to standard output ..." << endl;
mtt_write (0.0, null, null, 0, true);
cerr << " ... aborting." << endl;
abort ();
}
int main (void) {
signal (SIGFPE, handle_sigfpe);
#else
DEFUN_DLD (${sys}_ode2odes, args, ,
"Octave ode2odes representation of system with $method integration method
Usage: ${sys}_ode2odes (x, par, simpar)
")
{
static octave_value_list retval;
|