︙ | | | ︙ | |
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.54 1997/02/09 20:33:13 peterg
## Replaced a.out with ./a.out
##
## Revision 1.53 1997/02/09 20:30:04 peterg
## Copied from tweedledum.
##
# Revision 1.54 1997/02/07 13:33:03 peterg
|
>
>
>
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.
###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
# Revision 1.55 1997/02/24 19:31:10 peterg
# Removed numpar.m requirement from .m files
#
## Revision 1.54 1997/02/09 20:33:13 peterg
## Replaced a.out with ./a.out
##
## Revision 1.53 1997/02/09 20:30:04 peterg
## Copied from tweedledum.
##
# Revision 1.54 1997/02/07 13:33:03 peterg
|
︙ | | | ︙ | |
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
exit
fi
# Clean up
if [ "$1" = "clean" ] && [ "$2" = "" ]; then
echo 'Removing all generated files for all systems'
rm -f *.log mtt_info.txt warning.txt
rm -f *_abg.m *_abg.ps *_args.* *_cr.r *_sympar.r
rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.*
rm -f *_sub.sh *_type.sh
rm -f *_dae*.* *_cse.* *_ode*.* *_obs.* *_rfe.* *_ss.*
rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_ir*.* *_*fr.*
rm -f *_numpar.m *_numpar.c
rm -f mtt_error.txt mtt_info.txt
exit
fi
# Clean up named system
if [ "$2" = "clean" ] && [ "$3" = "" ]; then
echo 'Removing all generated files for system ' $1
rm -f *.log mtt_info.txt warning.txt
rm -f $1_abg.m $1_abg.ps $1_args.* $1_cr.r $1_sympar.r
rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.*
rm -f $1_sub.sh $1_type.sh
rm -f $1_dae*.* $1_cse.* $1_ode*.* $1_obs.* $1_rfe.* $1_ss.*
rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.*
rm -f $1_numpar.m $1_numpar.c
rm -f mtt_error.txt mtt_info.txt
exit
fi
# Invoke explicit requests for modification
if [ "$2" = "abg" ] && [ "$3" = "fig" ]; then
echo Editing $1_$2.$3
($FIG $1_$2.$3; cp $1_abg.fig $1_$1_abg.fig) &
|
|
|
|
|
|
|
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
|
exit
fi
# Clean up
if [ "$1" = "clean" ] && [ "$2" = "" ]; then
echo 'Removing all generated files for all systems'
rm -f *.log mtt_info.txt warning.txt
rm -f *_abg.m *_abg.ps *_args.* *_cr.r *_sympar.r *_sympar.c
rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.*
rm -f *_sub.sh *_type.sh
rm -f *_dae*.* *_cse.* *_ode*.c *_ode*.m *_obs.* *_rfe.* *_ss.*
rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_ir*.* *_*fr.*
rm -f *_numpar.m *_numpar.c
rm -f mtt_error.txt mtt_info.txt
exit
fi
# Clean up named system
if [ "$2" = "clean" ] && [ "$3" = "" ]; then
echo 'Removing all generated files for system ' $1
rm -f *.log mtt_info.txt warning.txt
rm -f $1_abg.m $1_abg.ps $1_args.* $1_cr.r $1_sympar.r $1_sympar.c
rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.*
rm -f $1_sub.sh $1_type.sh
rm -f $1_dae*.* $1_cse.* $1_ode*.c $1_ode*.m $1_obs.* $1_rfe.* $1_ss.*
rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.*
rm -f $1_numpar.m $1_numpar.c
rm -f mtt_error.txt mtt_info.txt
exit
fi
# Invoke explicit requests for modification
if [ "$2" = "abg" ] && [ "$3" = "fig" ]; then
echo Editing $1_$2.$3
($FIG $1_$2.$3; cp $1_abg.fig $1_$1_abg.fig) &
|
︙ | | | ︙ | |
509
510
511
512
513
514
515
516
517
518
519
520
521
522
|
$1_params.c:
echo Creating $1_params.c
( \
echo '/*'; \
echo "%% Parameter file for system $1 ($1_params.c)"; \
echo "%% This file provides the system params for simulation:";\
echo '*/'; \
echo '$1_params()'; \
echo '{'; \
echo '};'; \
)> $1_params.c
#SUMMARY odes ODE simulation header file (h)
$1_odes.h:
|
>
|
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
|
$1_params.c:
echo Creating $1_params.c
( \
echo '/*'; \
echo "%% Parameter file for system $1 ($1_params.c)"; \
echo "%% This file provides the system params for simulation:";\
echo '*/'; \
echo "#include \"$1_sympar.c\""; \
echo '$1_params()'; \
echo '{'; \
echo '};'; \
)> $1_params.c
#SUMMARY odes ODE simulation header file (h)
$1_odes.h:
|
︙ | | | ︙ | |
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
|
)> $1_input.m
#SUMMARY input input signal definition (c)
$1_input.c:
echo Creating $1_input.c
( \
echo "$1_input(t)"; \
echo ' float t;'; \
echo '/*'; \
echo "%% Input file for system $1 ($1_input.c)"; \
echo "%% This file provides the system input for simulation:";\
echo '*/'; \
cat $MTTPATH/trans/rcs_header.c; \
echo; \
echo "/* Change the following lines as you wish */"; \
echo '{'; \
echo '};'; \
)> $1_input.c
#SUMMARY sspar steady-state definition (r)
$1_sspar.r:
echo Creating $1_sspar.r
(\
|
|
>
|
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
|
)> $1_input.m
#SUMMARY input input signal definition (c)
$1_input.c:
echo Creating $1_input.c
( \
echo "$1_input(t)"; \
echo ' double t;'; \
echo '/*'; \
echo "%% Input file for system $1 ($1_input.c)"; \
echo "%% This file provides the system input for simulation:";\
echo '*/'; \
cat $MTTPATH/trans/rcs_header.c; \
echo; \
echo "/* Change the following lines as you wish */"; \
echo '{'; \
echo ' extern double u;'; \
echo '};'; \
)> $1_input.c
#SUMMARY sspar steady-state definition (r)
$1_sspar.r:
echo Creating $1_sspar.r
(\
|
︙ | | | ︙ | |
609
610
611
612
613
614
615
616
617
618
619
620
621
622
|
#SUMMARY sympar symbolic parameters (r)
# Lbl to sympar conversion
$1_sympar.r: $1_lbl.txt $1_params.r
lbl2sympar_txt2r $1
echo "IN \"$1_params.r\";" >> $1_sympar.r
echo 'END;' >> $1_sympar.r
#SUMMARY abg acausal bond graph (m)
#Raw bond graph to acausal bond graph: mfile
$1_abg.m: $1_rbg.m $1_sub.sh
sh $1_sub.sh "mtt -q -l $level+1 " ' abg m'
rbg2abg_m $1
|
>
>
>
>
>
|
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
|
#SUMMARY sympar symbolic parameters (r)
# Lbl to sympar conversion
$1_sympar.r: $1_lbl.txt $1_params.r
lbl2sympar_txt2r $1
echo "IN \"$1_params.r\";" >> $1_sympar.r
echo 'END;' >> $1_sympar.r
#SUMMARY sympar symbolic parameters (c)
# r to c sympar conversion -- its part of the ode_r2c tool
$1_sympar.c: $1_sympar.r
sympar_r2c $1
#SUMMARY abg acausal bond graph (m)
#Raw bond graph to acausal bond graph: mfile
$1_abg.m: $1_rbg.m $1_sub.sh
sh $1_sub.sh "mtt -q -l $level+1 " ' abg m'
rbg2abg_m $1
|
︙ | | | ︙ | |
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
|
#SUMMARY ode ordinary differential equations (view)
#SUMMARY ode ordinary differential equations (ps)
#Ordinary differential equations
$1_ode.r: $1_cse.r $1_def.r $1_sympar.r
cse2ode_r $1; tidy $1_ode.r
$1_ode.m: $1_def.r $1_ode.r $1_sympar.r
ode_r2m $1; matlab_tidy $1_ode.m; matlab_tidy $1_odeo.m
$1_ode.c: $1_def.r $1_ode.r $1_sympar.r
ode_r2c $1
$1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r
ode_r2tex $1; latex_tidy $1_ode.tex
#SUMMARY obs observer equations for CGPC (r)
#SUMMARY obs observer equations for CGPC (m)
#SUMMARY obs observer equations for CGPC (tex)
|
|
|
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
|
#SUMMARY ode ordinary differential equations (view)
#SUMMARY ode ordinary differential equations (ps)
#Ordinary differential equations
$1_ode.r: $1_cse.r $1_def.r $1_sympar.r
cse2ode_r $1; tidy $1_ode.r
$1_ode.m: $1_def.r $1_ode.r $1_sympar.r
ode_r2m $1; matlab_tidy $1_ode.m; matlab_tidy $1_odeo.m
$1_ode.c: $1_def.r $1_ode.r $1_sympar.r $1_sympar.c
ode_r2c $1
$1_ode.tex: $1_ode.r $1_sympar.r $1_simp.r
ode_r2tex $1; latex_tidy $1_ode.tex
#SUMMARY obs observer equations for CGPC (r)
#SUMMARY obs observer equations for CGPC (m)
#SUMMARY obs observer equations for CGPC (tex)
|
︙ | | | ︙ | |
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
|
ifeq ($computation,octave)
$1_odes.m: $1_ode.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
ode2odes_m $1 '$ARGS'
endif
ifeq ($computation,c)
$1_odes.m: $1_odes.c $1_ode.c $1_numpar.c $1_odes.h $1_params.c $1_input.c
echo Creating $1_odes.m
echo 'Compiling ...'
gcc $1_odes.c $1_ode.c $1_numpar.c $1_params.c $1_input.c
echo 'Running ...'; ./a.out; echo 'Done.'
endif
$1_odeso.m: $1_odes.m
touch $1_odeso.m
$1_daes.m: $1_dae.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
dae2daes_m $1 '$ARGS'
$1_daeso.m: $1_daes.m
touch $1_daeso.m
|
>
|
|
|
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
|
ifeq ($computation,octave)
$1_odes.m: $1_ode.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
ode2odes_m $1 '$ARGS'
endif
ifeq ($computation,c)
$1_odes.m: $1_odes.c $1_ode.c $1_numpar.c $1_odes.h $1_params.c $1_input.c
echo Creating $1_odes.m
echo Creating $1_odeso.m
echo 'Compiling ...'
gcc $1_odes.c $1_ode.c $1_numpar.c $1_params.c $1_input.c -lm
echo 'Running ...'; ./a.out; rm -f a.out; echo 'Done.'
endif
$1_odeso.m: $1_odes.m
touch $1_odeso.m
$1_daes.m: $1_dae.m $1_numpar.m $1_params.m $1_args.m $1_def.m $1_input.m
dae2daes_m $1 '$ARGS'
$1_daeso.m: $1_daes.m
touch $1_daeso.m
|
︙ | | | ︙ | |
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
|
#Default view
ifeq ($REPTYPE,bg)
$1_$2.view : $1_$2.pview
endif
ifeq ($REPTYPE,data)
$1_$2.view : $1_$2.dview
endif
ifeq ($REPTYPE,tex)
$1_$2.view : $1_$2.tview
endif
|
>
|
>
>
|
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
|
#Default view
ifeq ($REPTYPE,bg)
$1_$2.view : $1_$2.pview
endif
ifeq ($REPTYPE,data)
# This is the gnuplot version which leaves lots of defunct processes
# $1_$2.view : $1_$2.dview
$1_$2.view: $1_$2.ps
ghostview $1_$2.ps&
endif
ifeq ($REPTYPE,tex)
$1_$2.view : $1_$2.tview
endif
|
︙ | | | ︙ | |